besselj(nu, x)

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


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)

    This example calculates J₂(3.5).

  2. Evaluate Bessel function for non-integer order:

    julia> besselj(0.5, 2.5)

    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}:

    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.

See Also

besselh, besseli, besselix, besselj, besselj0, besselj1, besseljx, besselk, besselkx, bessely, bessely0, bessely1, besselyx, hankelh1, hankelh1x, hankelh2, hankelh2x,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field

Checking you are not a robot: