Symbolic differentiation of Bessel functions is incorrect

16 visualizzazioni (ultimi 30 giorni)
The output of the below code gives an incorrect equation for the derivative of the modified Bessel function of the second kind.
syms x n
y = besselk(n,x);
diff(y,x)
It says the derivative of is
but as I understand, the formula for the derivative of the K bessel functions is given by
.
What's going on?!?

Risposta accettata

David Goodmanson
David Goodmanson il 11 Mar 2021
Modificato: David Goodmanson il 11 Mar 2021
Hi Sam,
There is really nothing going on. Both of those identities are correct, as you can check numerically. There are several recurrence relations available for Bessel functions. Another one is
K'(n,x) = -nK(n,x)/x - K(n-1,x)

Più risposte (1)

Selçuk Sehitoglu
Selçuk Sehitoglu il 15 Mag 2022
Hello,
i am dealing with the same problem for besselj.
syms nu x
y=besselj(nu,x);
d_y=diff(y,x);
subs(d_y,x,0); % At this row i get "Division by zero." error, because derivative is defined as -nJ(n,x)/x - J(n-1,x) ans it is undefined at x=0.
However, the answer is available with the following expression:
-(J(n-1,x) - J(n+1,x))/2
Is there a way to use this expression?
Thanks in advance,
Ozi
  1 Commento
David Goodmanson
David Goodmanson il 16 Mag 2022
Hi Ozi,
Yes there is. The expression works as is. It looks like n = 0 might be an exception because you will need J(-1,x) but for real n the besselj function works for negative n.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by