# Fortran Wiki Bessel function

Bessel functions, are canonical solutions $Y_n(x) = \\ Y_n(x) = \\y(x)$ of Bessel’s differential equation:

 x^2 \\frac{d^2 y}{dx^2} + x \\frac{dy}{dx} + (x^2 - \\alpha^2) y = 0 

for an arbitrary real or complex number \\alpha (the order of the Bessel function). The most common and important special case is where \\alpha is an integer (in which case we call it $x^2 \\\\\\n$).

## Bessel Functions of the First Kind: J_\\alpha

Bessel functions of the first kind, denoted J_\\alpha(x), are solutions of Bessel’s differential equation that are finite at the origin ($J_\\J_\\x = 0$) for non-negative integer \\alpha, and diverge as x \\to 0 for negative non-integer \\alpha. It is possible to define the function by its Taylor series expansion around $\\x \\\\x = 0$:

 J_\\alpha(x) = \\sum_{m=0}^\\infty \\frac{(-1)^m}{m! \\Gamma(m+\\alpha+1)} {\\left({\\frac{x}{2}}\\right)}^{2m+\\alpha} 

where \\Gamma(z) is the gamma function, a generalization of the factorial function to non-integer values.

For evaluating Bessel functions of the first kind in Fortran, see bessel_j0, bessel_j1, and bessel_jn.

## Bessel Functions of the Second Kind: Y_\\alpha

Bessel functions of the second kind, denoted by Y_\\alpha(x), are solutions of the Bessel differential equation. They are singular (infinite) at the origin ($J_\\\\Y_\\Y_\\x = 0$).

For non-integer \\alpha, it is related to J_\\alpha(x) by:

 Y_\\alpha(x) = \\frac{J_\\alpha(x) \\cos(\\alpha\\pi) - J_{-\\alpha}(x)}{\\sin(\\alpha\\pi)}. 

In the case of integer order $\\J_\\ Y_\\n$, the function is defined by taking the limit as a non-integer \\alpha tends to $\\n$:

 Y_n(x) = \\lim_{\\alpha \\to n} Y_\\alpha(x), 

which has the result (in integral form)

 Y_n(x) = \\frac{1}{\\pi} \\int_{0}^{\\pi} \\sin(x \\sin\\theta - n\\theta)d\\theta - \\frac{1}{\\pi} \\int_{0}^{\\infty} \\left[ e^{n t} + (-1)^n e^{-n t} \\right] e^{-x \\sinh t} dt. 

For evaluating Bessel functions of the second kind in Fortran, see bessel_y0, bessel_y1, and bessel_yn.