bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / special / _basic / riccati_jn
function
scipy.special._basic:riccati_jn
source: build-install/usr/lib/python3.14/site-packages/scipy/special/_basic.py:1278
Signature
def riccati_jn(n, x)Summary
Compute Riccati-Bessel function of the first kind and its derivative.
Extended Summary
The Riccati-Bessel function of the first kind is defined as , where is the spherical Bessel function of the first kind of order .
This function computes the value and first derivative of the Riccati-Bessel function for all orders up to and including n.
Parameters
n: intMaximum order of function to compute
x: floatArgument at which to evaluate
Returns
jn: ndarrayValue of j0(x), ..., jn(x)
jnp: ndarrayFirst derivative j0'(x), ..., jn'(x)
Notes
The computation is carried out via backward recurrence, using the relation DLMF 10.51.1 [2].
Wrapper for a Fortran routine created by Shanjie Zhang and Jianming Jin [1].
Examples
In practical applications, frequently the logarithmic derivative of the Riccati-Bessel functions is needed. We determine the logarithmic derivative of the Riccati-Bessel function of the first kind for order 5 and argument 1.2. The logarithmic derivative is obtained by dividing the derivative of the Riccati-Bessel function by the Riccati-Bessel function itself.from scipy.special import riccati_jn n = 5 z = 1.2 psi_n, psi_n_p = riccati_jn(n, z)✓
psi_n psi_n_p✗
array([0.36236, 0.58675, 0.24132, 0.05827, 0.01 , 0.00133])
psi_n_p[5]/psi_n[5]
✓np.float64(4.9070016327063115)Alternatively, the logarithmic derivative of the Riccati-Bessel functions could be obtained from the corresponding spherical Bessel functions by making use of the definition of the Riccati-Bessel function in terms of the spherical Bessel function as given above.
from scipy.special import spherical_jn jn = spherical_jn(n, z) jnp = spherical_jn(n, z, derivative=True) jnp/jn + 1/z✓
np.float64(4.907001632706311)
Aliases
scipy.special.riccati_jn