1 Introduction

The Schrödinger equation (SE) solution with spherically symmetric potential plays a fundamental role in many fields of modern physics, particularly high energy physics. Recently, many researchers have shown great attempts to solve the Schrödinger equation (SE) in higher dimensions [1]. The study of the higher dimensions is more general, and it can directly obtain the results in lower dimensions. The SE has been solved with various types of spherically symmetric potentials such as the Hydrogen atom potential [2], Coulomb potential [3], Mie-type potential [4], Kratzer plus screen Coulomb potential [5], Cornell potential [6], and others [7]. The study of quarkonium systems provides a good understanding of the quantitative description of quantum chromodynamics (QCD) theory, the standard model, and particle physics [8]. The SE well describes the quarkonia with heavy quark and antiquark and their interaction. The solution of this equation with a spherical potential is one of the most critical problems in quarkonia systems [9]. These potentials should take into account the two essential features of strong interaction: asymptotic freedom and quark confinement [10]. The Yukawa potential was proposed by Yukawa in 1935 as an effective non-relativistic potential describing the strong interactions between nucleons. It takes the form [11]

$$ V(r) = - \frac{{A_{0} e^{ - \alpha r} }}{r} $$
(1)

It can be seen as a Coulomb potential if \( \alpha = 0 \), with \( A_{0} \) describing the strength of the interaction and \( A_{0} = aZ \), \( a = \left( {137.037} \right)^{ - 1} \) is the fine-structure constant, and Z is the atomic number and \( \alpha \) is the screening parameter. The shape of the potential is, as shown in Fig. 1. This potential is often used to compute bound-state normalizations and energy levels of natural atoms [12,13,14,15]. The Klein–Gordon equation containing a four-vector linear momentum operator and a rest mass requires introducing the four-vector potential \( V(r) \) and a space time scalar potential \( S(r) \). With the configuration \( S(r) = V(r) \) or \( S(r) = - V(r) \), it has been shown extensively in literature that the Klein–Gordon equation share the same energy spectrum [16]. While \( S(r) = V(r) = 2V(r) \), gives non-relativistic limits of the equation conforming exactly to that of the Schrödinger equation [17,18,19,20].

Fig. 1
figure 1

Plots of Yukawa potential with r in (fm−1)

Chakrabarti and Das [21] presented a perturbative solution of the Riccati equation leading to a super analytic potential for Yukawa potential. Ikhdair and Sever [22] investigated energy levels of neutral atoms by applying an alternative perturbative scheme in solving the Schrödinger equation for the Yukawa potential model with a modified screening parameter. Ikhdair and Sever also studied bound states of the Hellmann potential, representing the superposition of the attractive Coulomb potential and the Yukawa potential [23]. Liverts et al. [24] used the quasi- linearization method (QLM) for solving SE with a Yukawa potential. Apart from that, many authors have solved non-relativistic wave equations with Cornell potential. For instance, Vega and Flores [25] solved the Schrödinger equation with the Cornell potential using the variational method and supersymmetric quantum mechanics (SUSYQM). Ciftci and Kisoglu [26] addressed non-relativistic arbitrary l-states of quarkonium through the Asymptotic Iteration Method (AIM). The energy eigenvalues with any \( l \ne 0 \) states and mass of the massive quark-antiquark system (quarkonium) are gotten. The quarks are considered as spinless for easiness and are bounded by Cornell potential. An analytic solution of the N-dimensional radial Schrödinger equation with the mixture of vector and scalar potentials via the Laplace transformation method (LTM) was studied by [27]. The results were employed to analyze the different properties of the heavy-light mesons. Al-Jamel and Widyan [28] studied heavy quarkonium (\( c\bar{c} \) and \( b\bar{b} \)) mass spectra in a Coulomb field plus quadratic potential using the Nikiforov–Uvarov method. In their work, the spin-averaged mass spectra of heavy quarkonia (\( c\bar{c} \) and \( b\bar{b} \)) in a Coulomb plus quadratic potential is analyzed within the non-relativistic Schrödinger equation. Al-Oun et al. [29] examine heavy quarkonia (\( c\bar{c} \) and \( b\bar{b} \)) characteristics in the general framework of a non-relativistic potential model consisting of a Coulomb plus quadratic potential. Kumar and Chand [30] carried out an asymptotic study to the N-dimensional radial Schrödinger equation for the quark-antiquark interaction potential employing asymptotic iteration method (AIM). In this work, we seek to study the heavy quarkonium system through the Klein–Gordon equation analytical solutions with Yukawa potential using the NU method. We apply the results to analyze the properties of quarkonium particles such as masses.

The paper is organized as follows: In Sect. 2, the Nikiforov–Uvarov (NU) method is reviewed. In Sect. 3, the bound state energy eigenvalues and the corresponding eigenfunction are calculated in D-dimensional space. In Sect. 4, the results are discussed. In Sect. 5, the conclusion is presented.

2 Review of Nikiforov–Uvarov (NU) method

The NU method was proposed by Nikiforov and Uvarov as a suitable method to obtain the solution of the second-order differential equation via a coordinate transformation \( s = s(r) \), of the form [31]

$$ \psi^{\prime\prime}\left( s \right) + \frac{{\tilde{\tau }\left( s \right)}}{\sigma \left( s \right)}\psi^{\prime}\left( s \right) + \frac{{\tilde{\sigma }\left( s \right)}}{{\sigma^{2} \left( s \right)}}\psi \left( s \right) = 0, $$
(2)

where \( \tilde{\sigma }(s)\,{\text{and}}\,\sigma \left( s \right) \) are polynomials, at most second degree, and \( \tilde{\tau }(s) \) is a first-degree polynomial. The exact solution of Eq. (2) can be obtained by using the transformation:

$$ \psi \left( s \right) = \phi \left( s \right)y_{n} \left( s \right). $$
(3)

This transformation reduces Eq. (2) into a hypergeometric-type equation of the form

$$ \sigma \left( s \right)y^{\prime \prime } \left( s \right) + \tau \left( s \right)y^{\prime } \left( s \right) + \lambda y\left( s \right) = 0. $$
(4)

The function \( \phi (s) \) can be defined as the logarithm derivative

$$ \frac{{\phi^{\prime } \left( s \right)}}{\phi \left( s \right)} = \frac{\pi \left( s \right)}{\sigma \left( s \right)}, $$
(5)

With \( \pi (s) \) being at most a first-degree polynomial. The second part of \( \psi (s) \) being \( y(s) \) in Eq. (4) is the hypergeometric function with its polynomial solution given by Rodrigues relation as

$$ y_{n} \left( s \right) = \frac{{B_{nl} }}{\rho \left( s \right)}\frac{{{\text{d}}^{n} }}{{{\text{d}}s^{n} }}\left[ {\sigma^{n} \left( s \right)\rho \left( s \right)} \right], $$
(6)

where \( B_{nl} \) is the normalization constant and \( \rho \left( s \right) \) the weight function which satisfies the condition below:

$$ \left( {\sigma \left( s \right)\rho \left( s \right)} \right)^{\prime } = \tau \left( s \right)\rho \left( s \right) $$
(7)

where also

$$ \tau \left( s \right) = \tilde{\tau }\left( s \right) + 2\pi \left( s \right) $$
(8)

For bound solutions, it is required that

$$ \frac{{{\text{d}}\tau \left( s \right)}}{{{\text{d}}s}} < 0 $$
(9)

The eigenfunction and eigenvalues can be obtained using the definition of the function \( \pi (s) \) and parameter λ, given as:

$$ \pi \left( s \right) = \frac{{\sigma^{\prime}\left( s \right) - \tilde{\tau }\left( s \right)}}{2} \pm \sqrt {\left( {\frac{{\sigma^{\prime}\left( s \right) - \tilde{\tau }\left( s \right)}}{2}} \right)^{2} - \tilde{\sigma }\left( s \right) + k\sigma \left( s \right)} , $$
(10)

and

$$ \lambda = k_{ - } + \pi_{ - }^{\prime } \left( s \right) $$
(11)

The value of k can be obtained by setting the discriminant in the square root in Eq. (10) equal to zero. As such, the new eigenvalues equation can be given as

$$ \lambda_{n} + n\tau^{\prime } (s) + \frac{n(n - 1)}{2}\sigma^{\prime \prime } (s) = 0,(n = 0,1,2, \ldots ). $$
(12)

2.1 Bound state solution of the Klein–Gordon equation with Yukawa potential

The Klein–Gordon equation for a spinless particle for \( \hbar = c = 1 \) in D-dimensions is given as [32]

$$ \left[ { - \nabla^{2} + \left( {M + S(r)} \right)^{2} + \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{{4r^{2} }}} \right]\psi \left( {r,\theta ,\varphi } \right) = \left[ {E_{nl} - V(r)} \right]^{2} \psi \left( {r,\theta ,\varphi } \right) $$
(13)

where \( \nabla^{2} \) is the Laplacian, M is the reduced mass, \( E_{nl} \) is the energy spectrum, n, and l are the radial and orbital angular momentum quantum numbers, respectively, or vibration–rotation quantum number in quantum chemistry. It is a common practice that for the wavefunction to satisfy the boundary conditions it can be rewritten as

$$ \psi \left( {r,\theta ,\varphi } \right) = \frac{{R_{nl} }}{r}Y_{lm} \left( {\theta ,\varphi } \right) $$
(14)

The angular component of the wavefunction could be separated leaving only the radial part as shown below

$$ \frac{{d^{2} R\left( r \right)}}{{dr^{2} }} + \left[ {\left( {E_{nl}^{2} - M^{2} } \right) + V^{2} (r) - S^{2} (r) - 2\left( {E_{nl} V(r) + MS(r)} \right) - \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{{4r^{2} }}} \right]R(r) = 0 $$
(15)

Thus, for equal vector and scalar potentials \( V(r) = S(r) = 2V(r) \), then Eq. (15) becomes

$$ \frac{{d^{2} R\left( r \right)}}{{dr^{2} }} + \left[ {\left( {E_{nl}^{2} - M^{2} } \right) - 2V(r)\left( {E_{nl} + M} \right) - \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{{4r^{2} }}} \right]R(r) = 0 $$
(16)

We carry out Taylor series expansion of the exponential term in Eq. (1) up to order three, in order to make the potential to interact in the quark–antiquark system and this yields,

$$ \frac{{e^{ - \alpha r} }}{r} = \frac{1}{r} - \alpha + \frac{{\alpha^{2} r}}{2} - \frac{{\alpha^{3} r^{2} }}{6} + \cdots $$
(17)

We substitute Eq. (17) into (1) and obtain

$$ V(r) = - \frac{{A_{0} }}{r} + \alpha A_{0} - \frac{{A_{0} \alpha^{2} r}}{2} + \frac{{A_{0} \alpha^{3} r^{2} }}{6} $$
(18)

Upon substituting Eq. (18) into (16), we obtain

$$ \frac{{{\text{d}}^{2} R\left( r \right)}}{{{\text{d}}r^{2} }} + \left[ \begin{aligned} \left( {E_{nl}^{2} - M^{2} } \right) + \frac{{2A_{0} }}{r}\left( {E_{nl} + M} \right) - 2\alpha A_{0} \left( {E_{nl} + M} \right) + A_{0} \alpha^{2} r\left( {E_{nl} + M} \right) \hfill \\ - \frac{{A_{0} \alpha^{3} r^{2} }}{3}\left( {E_{nl} + M} \right) - \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{{4r^{2} }} \hfill \\ \end{aligned} \right]R(r) = 0 $$
(19)

In order to transform the coordinate from r to s in Eq. (19), we set

$$ s = \frac{1}{r} $$
(20)

This implies that the second derivative in Eq. (19) becomes;

$$ \frac{{d^{2} R(r)}}{{dr^{2} }} = 2s^{3} \frac{dR(s)}{ds} + s^{4} \frac{{d^{2} R(s)}}{{ds^{2} }} $$
(21)

Substituting Eqs. (20) and (21) into (19) we obtain

$$ \frac{{{\text{d}}^{2} R(s)}}{{{\text{d}}s^{2} }} + \frac{2s}{{s^{2} }}\frac{{{\text{d}}R(s)}}{{{\text{d}}s}} + \frac{1}{{s^{4} }}\left[ {\xi + \beta_{0} s + \frac{{\beta_{1} }}{s} - \frac{{\beta_{2} }}{{s^{2} }} - \gamma s^{2} } \right]R(s) = 0, $$
(22)

where

$$ \left. {\begin{array}{*{20}l} {\xi = \left( {E_{nl}^{2} - M^{2} } \right) - 2\alpha A_{0} \left( {E_{nl} + M} \right)} \hfill \\ {\beta_{0} = 2A_{0} \left( {E_{nl} + M} \right), \, \beta_{1} = A_{0} \alpha^{2} \left( {E_{nl} + M} \right)} \hfill \\ {\beta_{2} = \frac{{A_{0} \alpha^{3} }}{3}\left( {E_{nl} + M} \right), \, \gamma = \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{4}} \hfill \\ \end{array} } \right\} $$
(23)

Next, we propose the following approximation scheme on the term \( \frac{{\beta_{1} }}{s} \) and \( \frac{{\beta_{2} }}{{s^{2} }} \).

Let us assume that there is a characteristic radius \( r_{0} \) of the meson. Then the scheme is based on the expansion of \( \frac{{\beta_{1} }}{s} \) and \( \frac{{\beta_{2} }}{{s^{2} }} \) in a power series around \( r_{0} \); i.e., around \( \delta \equiv \frac{1}{{r_{0} }} \), in the x-space up to the second order. This is similar to Pekeris approximation, which helps to deform the centrifugal term such that the potential can be solved by NU method [1].

Setting \( y = s - \delta \) and around \( y = 0 \), it can be expanded into a series of powers as;

$$ \frac{{\beta_{1} }}{s} = \frac{{\beta_{1} }}{y + \delta } = \frac{{\beta_{1} }}{{\delta \left( {1 + \frac{y}{\delta }} \right)}} = \frac{{\beta_{1} }}{\delta }\left( {1 + \frac{y}{\delta }} \right)^{ - 1} $$
(24)

which yields

$$ \frac{{\beta_{1} }}{s} = \beta_{1} \left( {\frac{3}{\delta } - \frac{3s}{{\delta^{2} }} + \frac{{s^{2} }}{{\delta^{3} }}} \right) $$
(25)

Similarly,

$$ \frac{{\beta_{2} }}{{s^{2} }} = \beta_{2} \left( {\frac{6}{{\delta^{2} }} - \frac{8s}{{\delta^{3} }} + \frac{{3s^{2} }}{{\delta^{4} }}} \right) $$
(26)

By substituting Eqs. (25) and (26) into (22), we obtain

$$ \frac{{{\text{d}}^{2} R(s)}}{{{\text{d}}s^{2} }} + \frac{2s}{{s^{2} }}\frac{{{\text{d}}R(s)}}{{{\text{d}}s}} + \frac{1}{{s^{4} }}\left[ { - \varepsilon + \alpha_{1} s - \beta s^{2} } \right]R(s) = 0 $$
(27)

where

$$ \left. \begin{aligned} - \varepsilon = \left( {\xi + \frac{{3\beta_{1} }}{\delta } - \frac{{6\beta_{2} }}{{\delta^{2} }}} \right) \hfill \\ \alpha_{1} = \left( {\beta_{0} - \frac{{3\beta_{1} }}{{\delta^{2} }} + \frac{{8\beta_{2} }}{{\delta^{3} }}} \right) \hfill \\ \beta = \left( {\gamma - \frac{{\beta_{1} }}{{\delta^{3} }} + \frac{{3\beta_{2} }}{{\delta^{4} }}} \right) \hfill \\ \end{aligned} \right\} $$
(28)

Comparing Eqs. (27) and (2) we obtain

$$ \left. \begin{aligned} \tilde{\tau }(s) = 2s \hfill \\ \sigma (s) = s^{2} \hfill \\ \tilde{\sigma }(s) = - \varepsilon + \alpha_{1} s - \beta s^{2} \hfill \\ \sigma^{\prime}(s) = 2s \hfill \\ \sigma^{\prime\prime}(s) = 2 \hfill \\ \end{aligned} \right\} $$
(29)

We substitute Eq. (29) into (10) and obtain

$$ \pi (s) = \pm \sqrt {\varepsilon - \alpha_{1} s + \left( {\beta + k} \right)s^{2} } $$
(30)

To determine k, we take the discriminant of the function under the square root, which yields

$$ k = \frac{{\alpha_{1}^{2} - 4\beta \varepsilon }}{4\varepsilon } $$
(31)

We substitute Eq. (31) into (30) and have

$$ \pi (s) = \pm \left( {\frac{{\alpha_{1} s}}{2\sqrt \varepsilon } - \frac{\varepsilon }{\sqrt \varepsilon }} \right) $$
(32)

We take the negative part of Eq. (32) and differentiate, which yields

$$ \pi^{\prime}_{ - } (s) = - \frac{{\alpha_{1} }}{2\sqrt \varepsilon } $$
(33)

By substituting Eqs. (29) and (33) into (8) we have

$$ \tau (s) = 2s - \frac{{\alpha_{1} s}}{\sqrt \varepsilon } + \frac{2\varepsilon }{\sqrt \varepsilon } $$
(34)

Differentiating Eq. (34) we have

$$ \tau^{\prime}(s) = 2 - \frac{{\alpha_{1} }}{\sqrt \varepsilon } $$
(35)

By using Eq. (11), we obtain

$$ \lambda = \frac{{\alpha_{1}^{2} - 4\beta \varepsilon }}{4\varepsilon } - \frac{{\alpha_{1} }}{2\sqrt \varepsilon } $$
(36)

And using Eq. (12), we obtain

$$ \lambda_{n} = \frac{{n\alpha_{1} }}{\sqrt \varepsilon } - n^{2} - n $$
(37)

Equating Eqs. (36) and (37), and substituting Eqs. (23) and (28), yields the energy eigenvalue equation of the Yukawa potential in the relativistic limit as

$$ \begin{aligned} & M^{2} - E_{nl}^{2} = - 2\alpha A_{0} \left( {E_{nl} + M} \right) + \frac{{3A_{0} \alpha^{2} }}{\delta }\left( {E_{nl} + M} \right) - \frac{{2A_{0} \alpha^{3} }}{{\delta^{2} }}\left( {E_{nl} + M} \right) \\ & \quad + \frac{1}{4}\left[ {\frac{{2A_{0} \left( {E_{nl} + M} \right) - \frac{{3A_{0} \alpha^{2} \left( {E_{nl} + M} \right)}}{{\delta^{2} }} + \frac{{8A_{0} \alpha^{3} \left( {E_{nl} + M} \right)}}{{3\delta^{3} }}}}{{n + \frac{1}{2} + \sqrt {\frac{1}{4} + \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{4} - \frac{{A_{0} \alpha^{3} \left( {E_{nl} + M} \right)}}{{\delta^{3} }} + \frac{{A_{0} \alpha^{3} \left( {E_{nl} + M} \right)}}{{\delta^{4} }}} }}} \right]^{2} . \\ \end{aligned} $$
(38)

2.2 Non-relativistic limit

In this section, we consider the non-relativistic limit of Eq. (38). Considering a transformation of the form: \( M + E_{nl} \to \frac{2\mu }{{\hbar^{2} }} \) and \( M - E_{nl} \to - E_{nl} \), where \( \mu \) is the reduced mass, and substituting it into Eq. (38), we have the non-relativistic energy eigenvalue equation as

$$ \begin{aligned} E_{nl} = 2\alpha A_{0} - \frac{{3A_{0} \alpha^{2} }}{\delta } + \frac{{2A_{0} \alpha^{3} }}{{\delta^{2} }} \hfill \\ - \frac{{\hbar^{2} }}{8\mu }\left[ {\frac{{\frac{{4A_{0} \mu }}{{\hbar^{2} }} - \frac{{6A_{0} \alpha^{2} \mu }}{{\delta^{2} \hbar^{2} }} + \frac{{16A_{0} \alpha^{3} \mu }}{{3\delta^{3} \hbar^{2} }}}}{{n + \frac{1}{2} + \sqrt {\frac{1}{4} + \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{4} - \frac{{2A_{0} \alpha^{3} \mu }}{{\delta^{3} \hbar^{2} }} + \frac{{2A_{0} \alpha^{3} \mu }}{{\delta^{4} \hbar^{2} }}} }}} \right]^{2} \hfill \\ \end{aligned} $$
(39)

We take a special case of Eq. (1) by setting \( \alpha = 0 \) to obtain the energy eigenvalue of Coulomb potential as

$$ E_{nl} = - \frac{{\hbar^{2} }}{8\mu }\left[ {\frac{{\frac{{4A_{0} \mu }}{{\hbar^{2} }}}}{{n + \frac{1}{2} + \sqrt {\frac{1}{4} + \frac{{\left( {D + 2l - 1} \right)\left( {D + 2l - 3} \right)}}{4}} }}} \right]^{2} $$
(40)

The result of Eq. (40) is consistent with the result obtained in Eq. (36) of Ref. [5] when \( D = 3. \)

To obtain the corresponding wavefunction, we consider Eq. (5) and upon substituting Eqs. (29) and (32) and integrating, we get

$$ \frac{d\phi }{\phi } = \left( {\frac{\varepsilon }{{s^{2} \sqrt \varepsilon }} - \frac{{\alpha_{1} }}{2s\sqrt \varepsilon }} \right)ds $$
(41)

Integrating Eq. (41),we obtain

$$ \phi (s) = s^{{ - \frac{{\alpha_{1} }}{2\sqrt \varepsilon }}} e^{{ - \frac{\varepsilon }{s\sqrt \varepsilon }}} $$
(42)

By substituting Eqs. (29) and (34) into (7) and integrating, thereafter simplifying, we obtain

$$ \rho (s) = s^{{ - \frac{{\alpha_{1} }}{\sqrt \varepsilon }}} e^{{ - \frac{2\varepsilon }{s\sqrt \varepsilon }}} $$
(43)

Substituting Eqs. (29) and (43) into (13) we have

$$ y_{n} (s) = B_{nl} e^{{\frac{2\varepsilon }{s\sqrt \varepsilon }}} s^{{\frac{{\alpha_{1} }}{\sqrt \varepsilon }}} \frac{{d^{n} }}{{ds^{n} }}\left[ {e^{{ - \frac{2\varepsilon }{s\sqrt \varepsilon }}} s^{{2n - \frac{{\alpha_{1} }}{\sqrt \varepsilon }}} } \right] $$
(44)

The Rodrigues’ formula of the associated Laguerre polynomials is

$$ L_{n}^{{\frac{{\alpha_{1} }}{\sqrt \varepsilon }}} \left( {\frac{2\varepsilon }{s\sqrt \varepsilon }} \right) = \frac{1}{n!}e^{{\frac{2\varepsilon }{s\sqrt \varepsilon }}} s^{{\frac{{\alpha_{1} }}{\sqrt \varepsilon }}} \frac{{d^{n} }}{{ds^{n} }}\left( {e^{{ - \frac{2\varepsilon }{s\sqrt \varepsilon }}} s^{{2n - \frac{{\alpha_{1} }}{\sqrt \varepsilon }}} } \right), $$
(45)

where

$$ \frac{1}{n!} = B_{nl} $$
(46)

Hence,

$$ y_{n} (s) \equiv L_{n}^{{\frac{{\alpha_{1} }}{\sqrt \varepsilon }}} \left( {\frac{2\varepsilon }{s\sqrt \varepsilon }} \right) $$
(47)

Substituting Eqs. (42) and (47) into (3), we obtain the wavefunction in terms of Laguerre polynomial as

$$ \psi (s) = B_{nl} s^{{ - \frac{{\alpha_{1} }}{2\sqrt \varepsilon }}} e^{{ - \frac{\varepsilon }{s\sqrt \varepsilon }}} L_{n}^{{\frac{{\alpha_{1} }}{\sqrt \varepsilon }}} \left( {\frac{2\varepsilon }{s\sqrt \varepsilon }} \right), $$
(48)

where \( B_{nl} \) is normalization constant, which can be obtain from

$$ \int\limits_{0}^{\infty } {|B_{nl} (r)|^{2} } {\text{d}}r = 1. $$
(49)

3 Results and discussion

3.1 Results

We calculate mass spectra of the heavy quarkonium system such as charmonium and bottomonium in 3-dimensional space (\( D = 3 \)) that have the quark and antiquark flavor, and apply the following relation [33, 34]

$$ M = 2m + E_{nl}^{D = 3} , $$
(50)

where \( m \) is quarkonium bare mass, and \( E_{nl}^{D = 3} \) is energy eigenvalues. By substituting Eq. (39) into (50) we obtain the mass spectra for Yukawa potential as:

$$ M = 2m + 2\alpha A_{0} - \frac{{3A_{0} \alpha^{2} }}{\delta } + \frac{{2A_{0} \alpha^{3} }}{{\delta^{2} }} - \frac{{\hbar^{2} }}{8\mu }\left[ {\frac{{\frac{{4A_{0} \mu }}{{\hbar^{2} }} - \frac{{6A_{0} \alpha^{2} \mu }}{{\delta^{2} \hbar^{2} }} + \frac{{16A_{0} \alpha^{3} \mu }}{{3\delta^{3} \hbar^{2} }}}}{{n + \frac{1}{2} + \sqrt {\frac{1}{4} + l\left( {l + 1} \right) - \frac{{2A_{0} \alpha^{3} \mu }}{{\delta^{3} \hbar^{2} }} + \frac{{2A_{0} \alpha^{3} \mu }}{{\delta^{4} \hbar^{2} }}} }}} \right]^{2} . $$
(51)

3.2 Discussion of results

We calculate mass spectra of charmonium and bottomonium for states from 1S to 1F by using Eq. (51). We adopt the numerical values of bottomonium \( (b\bar{b}) \) and charmonium \( (c\bar{c}) \) masses as 4.823 GeV and 1.209 GeV, respectively, Ref. [35]. Then, the corresponding reduced mass are \( \mu_{b} = \) 2.4115 GeV and \( \mu_{c} = 0.6045 \) GeV. The free parameters of Eq. (51) were then gotten by solving two algebraic equations by inserting experimental data of mass spectra for 2S, 2P in the case of charmonium. In the case of bottomonium the values of the free parameters in Eq. (51) are calculated by solving two algebraic equations, which were obtained by inserting experimental data of mass spectra for 1S, 2S. Experimental data is taken from Ref. [36].

We note that calculation of mass spectra of charmonium and bottomonium are in good agreement with experimental data and other theoretical calculations with different potential and method. The values obtained are in a good agreement with the works of other researchers like in Ref [6]. and Ref [26], as shown in Tables 1 and 2. In Ref [6]. The author investigated the N-radial SE analytically by employing Cornell potential, which was extended to finite temperature. In Ref [26], the SE is solved by using asymptotic iteration method (AIM). The energy eigenvalues and mass of heavy quark-antiquark system (quarkonium) are obtained, in which the quarks are considered as spinless for easiness and are bounded by Cornell’s potential.

Table 1 Mass spectra of charmonium in (GeV) (\( m_{c} = 1.209 \) GeV, \( \mu = 0.6045 \) GeV \( \alpha = 0.01,\,\delta = 0.0129\,{\text{GeV}},\,\hbar = 1 \) and \( A_{0} = 17255.65 \) GeV)
Table 2 Mass spectra of bottomonium in (GeV) (\( m_{b} = 4.823 \) GeV, \( \mu = 2.4115 \) GeV,\( \alpha = 0.01,\,\delta = 0.0129\,{\text{GeV}},\,\hbar = 1 \) and \( A_{0} = 61992.44 \) GeV)

We also plot the graphs of mass spectra energy with respect to potential strength \( \left( {A_{0} } \right) \), reduced mass \( \left( \mu \right) \) and screening parameter \( \left( \alpha \right) \) respectively. In Fig. 2, the mass spectra energy converges at the beginning but spread out, and there is a monotonic decrease with an increase in potential strength \( (A_{0} ) \). Figures 3 and 4 show the convergence of the mass spectra energy as the screening parameter \( \left( \alpha \right) \) and reduce mass \( \left( \mu \right) \) increases for various angular quantum numbers.

Fig. 2
figure 2

Variation of mass spectra with potential strength \( (A_{0} ) \) for different quantum numbers

Fig. 3
figure 3

Variation of mass spectra with reduced mass \( \mu \) for different quantum numbers

Fig. 4
figure 4

Variation of mass spectra with screening parameter \( (\alpha ) \) for different quantum numbers

4 Conclusion

In this work, we have obtained the bound state solutions of the Klein–Gordon equation for the Yukawa potential using the Nikiforov–Uvarov method. The energy eigenvalues are obtained both in a relativistic and non-relativistic regime. The corresponding eigenfunction was achieved in terms of Laguerre polynomial. We also obtain a particular case of Coulomb potential, which is in agreement with Ref. [5]. We applied the present results to calculate heavy-meson masses such as charmonium and bottomonium. The energy eigenvalues of charmonium \( \left( {c\bar{c}} \right) \), and bottomonium \( \left( {b\bar{b}} \right) \) for states 1S to 1F were obtained and compared with experimental data and other theoretical works, which are in good agreement. The novelty in this work is that we have successfully applied the Yukawa potential model to obtain the heavy quarkonium systems mass spectra. The analytical solutions can be used to describe the mass spectrum of the quark-antiquark system and other characteristics like thermodynamic properties.