derivative of bessel function of the first kind !!

142 views (last 30 days)
Ano
Ano on 3 Apr 2017
Commented: Feruza on 15 Jun 2023
Hello! I would like to check if my implementation of the derivative of bessel function of the first kind is working properly or not , how can I check?! this is the code that I have implemented, please correct me if it is wrong!
c = sqrt(pi./(2.x));
D_bessel = c.*besselj(n-0.5,x)-c.*besselj(n+0.5,x).*(n+1)./(x);

Answers (2)

Morgan
Morgan on 6 Nov 2022
I've found a slightly easier implementation of the derivative for you based on this link. It essentially says that
In MATLAB, this would look like
function dJndx = dbesselj(n,x)
% DBESSELJ A function that will generically calculate the
% the derivative of a Bessel function of the first
% kind of order n for all values of x.
%
% Example usage: dJndx = dbesselj(n,x);
%
% INPUT ARGUMENTS
% ================
% n Order of the Bessel function of the first kind
% x Input variable to Bessel function
%
% OUTPUT ARGUMENTS
% ================
% dJndx Derivative of nth order Bessel function of the first
% kind at all values of x
dJndx = n*besselj(n,x)./x - besselj(n+1,x);
end
Hopefully this answers your question, let me know if this helps!

Feruza
Feruza on 14 Jun 2023
Is there way to compute third order derivatives of Bessel functions? I could find second order derivative from bessel equation but how to proceed with the third order derivative
  2 Comments
Morgan
Morgan on 14 Jun 2023
Should be able to do
d3Jndx = dbesselj(n,dbesselj(n,dbesselj(n,x)));
For third order derivatives with the function I wrote above.
Feruza
Feruza on 15 Jun 2023
Thanks, I also used MATLAB Symbolics to get analytical formulars for derivatives:
syms nu z
b = besselj(nu,z);
db = diff(b)
bj = besselj(nu,z);
ddbj = diff(bj,z,2)
dddbj = diff(bj,z,3)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!