Let's talk about Bessel functions! First, who was Bessel?
Friedrich Bessel was a German astronomer and mathematician whose namesake was given to the
solutions used to solve a specific type of differential equation. The
differential equation in question is the following:
\begin{equation}x^2\frac{d^2y}{dx^2} + x\frac{dy}{dx} + (x^2-n^2)y =
0\label{eq:ode}\end{equation}
This is a second-order linear ordinary differential equation and is known as a
canonical ODE because its solutions are special types of functions. For those
unfamiliar with second-order linear ODEs let me explain ( I often forget so
it's helpful for me as well). The "second-order" just means the highest
derivative in the equation, in this case, its two. The ordinary is because
there is only a single independent variable $x$. Linear indicates that we
don't have terms like $y^2\frac{dy}{dx}$, in other words, the dependent
variable and its derivatives only appear to the first power and the
coefficients are not in terms of the dependent variable. There is also the
case that this equation is homogenous because $y$ is involved with every term.
The solutions to the Bessel equation are called Bessel functions. The
functions form a basis because they are linearly independent and there are two
flavors of functions called the "first-kind" and the "second-kind". The
first-kind, usually denoted as $J_n(x)$, has the form:
\begin{equation}J_n(x) = \frac{1}{\pi} \int_0^{\pi} \cos(n*t - x \sin(t))
dt\end{equation}
where $n$ is an integer. This is actually a special case known as Bessel
integrals. The solutions of the first kind can be multiplied by a scalar value
and remain solutions to the ODE. Given Bessel functions of the first kind are
written in terms of sine and cosine they are oscillatory functions. They are
linearly dependent and form an orthogonal basis, given that:
$$\int_0^x J_n(x) \cdot J_m(x) dx = 0 \; m \neq n $$
They also have
recurrence relations
whereby negative values for $n$ are the same as positive values for $n$. The
Bessel functions of the first kind are used to obtain solutions in cylindrical
coordinate representations because the solutions are the radial part. In
spherical coordinates, the radial part is given by the Bessel functions of the
second kind. So what do the Bessel functions of the first kind look like? Let
me show it with some Julia code that would compute the Bessel function
integral of the first kind for integer values of $n$.
"""
Jₙ(x;n=1,ν=1000)
First kind Bessel numerical (i.e., trapizodial) integrals for
integer values of n.
"""
function Jₙ(x,n=1;ν=1000)
∫f = 0.0
for i=0:ν
t = π/ν * i
f = cos(n * t - x * sin(t))
# trapezoidal weights
w = (i == 0 || i == ν) ? 0.5 : 1.0
∫f += w * f
end
return 1/ν * ∫f
end
The code simply calculates the integral form for the first kind of Bessel
function, which is possible when $n$ is an integer. I believe this is also a
valid function for non-integer values of $n$ but only when $x$ is real and
$\gt 0$. When we plot this function for different values of $n$ we get the
following solutions:
|
Bessel functions (integrals) of the first kind where $n$ is an
integer.
|
So what about Bessel functions of the second kind? When $n$ is not an
integer these take the form:
\begin{equation}Y_m(x) = J_m(x) * \cos(m\pi) -
\frac{J_{-m}(x)}{\sin(m\pi)}\label{eq:bessel1}\end{equation}
with $m$ being a non-integer value. As you can see, $Y_m(x)$ can be defined in
terms of Bessel functions of the first kind, $J_m(x)$ and $J_{-m}(x)$. The
functions in eq. (\ref{eq:bessel1}) are clear valid because they are linear
combinations of first-kind solutions. One thing of importance is that Bessel
functions of the second kind have a singularity at $x=0$ for all values of
$m$. Also, keep in mind that $J_m(x)$ is not the function $J_n(x)$ since
$m$ is a non-integer. If $m\to +n$, i.e., is an integer and non-negative, then
the solution [1] is given by:
\begin{multline}Y_n(x)
=-\frac{\left(\frac{x}{2}\right)^{-n}}{\pi}\sum_{k=0}^{n-1}
\frac{(n-k-1)!}{k!}\left(\frac{x^2}{4}\right)^k +\frac{2}{\pi} J_n(x) \ln
\frac{x}{2} \\ -\frac{\left(\frac{x}{2}\right)^n}{\pi}\sum_{k=0}^\infty
(\psi(k+1)+\psi(n+k+1))
\frac{\left(-\frac{x^2}{4}\right)^k}{k!(n+k)!}\label{eq:bessel2}\end{multline}
where $\psi(x)$ is the logarithmic derivative of the gamma function. You can
review the
Wikipedia entry for Bessel functions which provides more details on the derivation of this
solution. This solutions $Y_n(x)$ are linearly independent from $J_n(x)$ hence
why we have "second-kind" solutions Bessels equations. There is also an
integral form that exists when $x$ is positive and real-valued. So what
does the plot look like for eq. (\ref{eq:bessel2})? Below shows the plot for
the limiting case discussed.
|
Bessel functions of the second kind where $x>0$ and $n$ is an
integer.
|
If you want to look at the Julia implementation for the Bessel functions of
the second kind you can take a look at the
Pluto.jl notebook
here. You'll need to set up Julia+Pluto.jl to run the notebook locally. You can
also use the "run in cloud" but its not worth it. For Windows users who just
want to run the notebook without any setup, check out the
PlutoDesktop exe. For python users you can probably just copy the raw notebook file
content into an LLM and ask for it to rewrite the code in Python.
In general, the use of Bessel functions of the first kind vs the second kind
often depends on the specific problem at hand and the boundary conditions
involved. Both types of Bessel functions are solutions to eq.
(\ref{eq:ode}), but they behave differently and hence have different
applications. Here's a quick rundown:
-
First Kind ($J_n$): These functions are finite at the origin
($x=0$), and this makes them suitable for problems with boundary
conditions that require the solution to be finite at the origin. For
example, they often appear in problems of wave propagation and heat
conduction in cylindrical or spherical symmetry where the solution must
be finite at $r=0$.
-
Second Kind ($Y_n$): These functions, on the other hand, have a
singularity at the origin. They are often useful in problems where the
physical system has a singularity at the origin or where the boundary
conditions do not require the solution to be finite at the origin. They
are also used when the full set of linearly independent solutions to eq.
\ref{eq:ode} are needed.
The complete solution to eq. $\ref{eq:ode}$ is a linear combination of
Bessel functions, where the coefficients (i.e., amplitudes) are determined
by the boundary conditions. In the context of partial differential equations
such as
Laplace's equation
in cylindrical or spherical coordinates, the Bessel function provides
solutions to the radial part whereas the spherical harmonics represent the
angular parts.
References
[1] Y. L. Luke, Integrals of Bessel Functions (Courier Corporation,
2014).
Reuse and Attribution
No comments:
Post a Comment
Please refrain from using ad hominem attacks, profanity, slander, or any similar sentiment in your comments. Let's keep the discussion respectful and constructive.