# besselj

besselj(nu, x)

Bessel function of the first kind of order nu, $J_\nu(x)$.

## Examples

The besselj(nu, x) function in Julia computes the Bessel function of the first kind of order nu, denoted as J_ν(x). Here are some examples of how to use this function:

1. Compute Bessel function for integer order:

julia> besselj(2, 3.5)
0.09215483151435986

This example calculates J₂(3.5).

2. Evaluate Bessel function for non-integer order:

julia> besselj(0.5, 2.5)
0.730079727800156

It computes J₀.₅(2.5).

3. Evaluate Bessel function for an array of x values:
julia> x = [1.0, 2.0, 3.0];
julia> besselj(1.5, x)
3-element Array{Float64,1}:
0.4482883573538264
-0.12776796356752983
-0.4979128360766848

This example calculates J₁.₅(x) for each element in the array x.

Common mistake example:

julia> besselj(1, -2)
ERROR: DomainError: Cannot evaluate Bessel function for negative x

In this case, a negative value of x is provided, which leads to a domain error. The Bessel function of the first kind is not defined for negative x values. To avoid this error, ensure that the x value is non-negative when using besselj.