# besselh

Bessel function of third kind (Hankel function) for symbolic expressions

## Syntax

``H = besselh(nu,K,z)``
``H = besselh(nu,z)``
``H = besselh(nu,K,z,1)``

## Description

example

````H = besselh(nu,K,z)` computes the Hankel function ${H}_{\nu }^{\left(K\right)}\left(z\right)$, where `K` = `1` or `2`, for each element of the complex array `z`. The output `H` has the symbolic data type if any input argument is symbolic. See Bessel’s Equation.```

example

````H = besselh(nu,z)` uses `K` = 1.```

example

````H = besselh(nu,K,z,1)` scales ${H}_{\nu }^{\left(K\right)}\left(z\right)$ by `exp(-i*z)` if `K` = 1, and by `exp(+i*z)` if `K` = 2.```

## Examples

collapse all

Specify the Hankel function for a symbolic variable.

```syms z H = besselh(3/2,1,z)```
```H =  $-\frac{\sqrt{2} {\mathrm{e}}^{z \mathrm{i}} \left(1+\frac{\mathrm{i}}{z}\right)}{\sqrt{z} \sqrt{\pi }}$```

Evaluate the function symbolically and numerically at the point `z = 1 + 2i`.

`Hval = subs(H,z,1+2i)`
```Hval =  $\frac{\sqrt{2} {\mathrm{e}}^{-2+\mathrm{i}} \left(-\frac{7}{5}-\frac{1}{5} \mathrm{i}\right)}{\sqrt{1+2 \mathrm{i}} \sqrt{\pi }}$```
`vpa(Hval)`
`ans = $-0.084953341280586443678471523210602-0.056674847869835575940327724800155 \mathrm{i}$`

Specify the function without the second argument, `K` = 1.

`H2 = besselh(3/2,z)`
```H2 =  $-\frac{\sqrt{2} {\mathrm{e}}^{z \mathrm{i}} \left(1+\frac{\mathrm{i}}{z}\right)}{\sqrt{z} \sqrt{\pi }}$```

Notice that the functions `H` and `H2` are identical.

Scale the function by ${e}^{-iz}$ by using the four-argument syntax.

`Hnew = besselh(3/2,1,z,1)`
```Hnew =  $-\frac{\sqrt{2} \left(1+\frac{\mathrm{i}}{z}\right)}{\sqrt{z} \sqrt{\pi }}$```

Find the derivative of H.

`diffH = diff(H)`
```diffH =  $\frac{\sqrt{2} {\mathrm{e}}^{z \mathrm{i}} \mathrm{i}}{{z}^{5/2} \sqrt{\pi }}-\frac{\sqrt{2} {\mathrm{e}}^{z \mathrm{i}} \left(1+\frac{\mathrm{i}}{z}\right) \mathrm{i}}{\sqrt{z} \sqrt{\pi }}+\frac{\sqrt{2} {\mathrm{e}}^{z \mathrm{i}} \left(1+\frac{\mathrm{i}}{z}\right)}{2 {z}^{3/2} \sqrt{\pi }}$```

## Input Arguments

collapse all

Hankel function order, specified as a symbolic array or double array. If `nu` and `z` are arrays of the same size, the result is also that size. If either input is a scalar, `besselh` expands it to the other input size.

Example: `nu = 3*sym(pi)/2`

Kind of Hankel function, specified as a symbolic or double 1 or 2. `K` identifies the sign of the added Bessel function Y:

`$\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}$`

Example: `K = sym(2)`

Hankel function argument, specified as a symbolic array or double array. If `nu` and `z` are arrays of the same size, the result is also that size. If either input is a scalar, `besselh` expands it to the other input size.

Example: `z = sym(1+1i)`

collapse all

### Bessel’s Equation

The differential equation

`${z}^{2}\frac{{d}^{2}w}{d{z}^{2}}+z\frac{dw}{dz}+\left({z}^{2}-{\nu }^{2}\right)w=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 ν. Yν(z) is a second solution of Bessel's equation—linearly independent of Jν(z)—defined by

`${Y}_{\nu }\left(z\right)=\frac{{J}_{\nu }\left(z\right)\mathrm{cos}\left(\nu \pi \right)-{J}_{-\nu }\left(z\right)}{\mathrm{sin}\left(\nu \pi \right)}.$`

The relationship between the Hankel and Bessel functions is

`$\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}$`

Here, Jν(z) is `besselj`, and Yν(z) is `bessely`.

 Abramowitz, M., and I. A. Stegun. Handbook of Mathematical Functions. National Bureau of Standards, Applied Math. Series #55, Dover Publications, 1965.