# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# besselj

Bessel function of first kind

## Syntax

`J = besselj(nu,Z)J = besselj(nu,Z,1)`

## Description

`J = besselj(nu,Z)` computes the Bessel function of the first kind, Jν(z), for each element of the array `Z`. The order `nu` need not be an integer, but must be real. The argument `Z` can be complex. The result is real where `Z` is positive.

If `nu` and `Z` are arrays of the same size, the result is also that size. If either input is a scalar, it is expanded to the other input's size.

`J = besselj(nu,Z,1)` computes `besselj(nu,Z).*exp(-abs(imag(Z)))`.

## Examples

collapse all

Create a column vector of domain values.

`z = (0:0.2:1)';`

Calculate the function values using `besselj` with `nu = 1`.

`besselj(1,z)`
```ans = 0 0.0995 0.1960 0.2867 0.3688 0.4401 ```

Define the domain.

`X = 0:0.1:20;`

Calculate the first five Bessel functions of the first kind.

```J = zeros(5,201); for i = 0:4 J(i+1,:) = besselj(i,X); end```

Plot the results.

```plot(X,J,'LineWidth',1.5) axis([0 20 -.5 1]) grid on legend('J_0','J_1','J_2','J_3','J_4','Location','Best') title('Bessel Functions of the First Kind for v = 0,1,2,3,4') xlabel('X') ylabel('J_v(X)')```

collapse all

### Bessel's Equation

The differential equation

`${z}^{2}\frac{{d}^{2}y}{d{z}^{2}}+z\frac{dy}{dz}+\left({z}^{2}-{\nu }^{2}\right)y=0,$`

where ν is a real constant, is called Bessel's equation, and its solutions are known as Bessel functions.

Jν(z) and Jν(z) form a fundamental set of solutions of Bessel's equation for noninteger ν. Jν(z) is defined by

`${J}_{\nu }\left(z\right)={\left(\frac{z}{2}\right)}^{\nu }\sum _{\left(k=0\right)}^{\infty }\frac{{\left(\frac{-{z}^{2}}{4}\right)}^{k}}{k!\Gamma \left(\nu +k+1\right)}$`

where Γ(a) is the gamma function.

Yν(z) is a second solution of Bessel's equation that is linearly independent of Jν(z). It can be computed using `bessely`.

## Tips

The Bessel functions are related to the Hankel functions, also called Bessel functions of the third kind, by the formula

`$\begin{array}{l}{H}_{\nu }^{\left(1\right)}\left(z\right)={J}_{\nu }\left(z\right)+i{Y}_{\nu }\left(z\right)\\ {H}_{\nu }^{\left(2\right)}\left(z\right)={J}_{\nu }\left(z\right)-i{Y}_{\nu }\left(z\right)\end{array}$`

where ${H}_{\nu }^{\left(K\right)}\left(z\right)$is `besselh`, Jν(z) is `besselj`, and Yν(z) is `bessely`. The Hankel functions also form a fundamental set of solutions to Bessel's equation (see `besselh`).