# Fortran Wiki Bessel function

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

${x}^{2}\frac{{d}^{2}y}{{\mathrm{dx}}^{2}}+x\frac{\mathrm{dy}}{\mathrm{dx}}+\left({x}^{2}-{\alpha }^{2}\right)y=0$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 $n$).

## Bessel Functions of the First Kind: ${J}_{\alpha }$

Bessel functions of the first kind, denoted ${J}_{\alpha }\left(x\right)$, are solutions of Bessel’s differential equation that are finite at the origin ($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=0$:

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

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

## Bessel Functions of the Second Kind: ${Y}_{\alpha }$

Bessel functions of the second kind, denoted by ${Y}_{\alpha }\left(x\right)$, are solutions of the Bessel differential equation. They are singular (infinite) at the origin ($x=0$).

For non-integer $\alpha$, it is related to ${J}_{\alpha }\left(x\right)$ by:

${Y}_{\alpha }\left(x\right)=\frac{{J}_{\alpha }\left(x\right)\mathrm{cos}\left(\alpha \pi \right)-{J}_{-\alpha }\left(x\right)}{\mathrm{sin}\left(\alpha \pi \right)}.$Y_\alpha(x) = \frac{J_\alpha(x) \cos(\alpha\pi) - J_{-\alpha}(x)}{\sin(\alpha\pi)}.

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

${Y}_{n}\left(x\right)=\underset{\alpha \to n}{\mathrm{lim}}{Y}_{\alpha }\left(x\right),$Y_n(x) = \lim_{\alpha \to n} Y_\alpha(x),

which has the result (in integral form)

${Y}_{n}\left(x\right)=\frac{1}{\pi }{\int }_{0}^{\pi }\mathrm{sin}\left(x\mathrm{sin}\theta -n\theta \right)d\theta -\frac{1}{\pi }{\int }_{0}^{\infty }\left[{e}^{nt}+\left(-1{\right)}^{n}{e}^{-nt}\right]{e}^{-x\mathrm{sinh}t}\mathrm{dt}.$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.