how to calculate the integral int (sin(a*x))​^2*exp(-b*​x^2)/(x^2)

f=(sin(a*x))^2*exp(-b*x^2)/(x^2);
s=int(f,x,0,inf)
a>0,b>0
syms x;
syms a b positive;
f1=(sin(a*x))^2*exp(-b*x^2)/(x^2);
s1=int(f1,x,0,inf);
s2=simple(s1)
I have tried to caltulate with the function "int" but failed. The results were "Warning: Explicit integral could not be found. s2=inf"
Thanks!

8 Comments

Note that "int" is symbolic integral, not numeric.
The symbolic integral does exist; Maple says it is
(1/2)*Pi^(1/2)*(-b+exp(-a^2/b)*b+a*Pi^(1/2)*erf(a/b^(1/2))*b^(1/2))/b^(1/2)
Thanks! The results of Maple is really wonderful! But I want the derivation, can you help me?
I am not sure what you mean by "derivation" in this context?
Sorry for my poor English. I want the calculate course of the integral, in other words, the derivation step by step.
I am not sure I understand. I suspect you might be asking how to arrive at that particular solution to the integral ? Or perhaps you are asking how to get MATLAB to get the same result that Maple gets? Or are you asking for the derivative of the integral? The derivative of the integral would just be the original formula.
I am very appreciate for you kind reply. My question is "how to arrive at that particular solution to the integral ?".
In Maple, it is
simplify( int((sin(a*x))^2*exp(-b*x^2)/(x^2), x=0..infinity), size) assuming positive
I do not have the MATLAB Symbolic toolkit so I do not know if MATLAB can handle this particular integral.
Thanks! Now I know how to do the integral with the Maple software, However, I want to show the course of the integreal to others, so can you tell me how to arrive at that particular solution to the integral by hand, not by any software such as Maple?

Sign in to comment.

 Accepted Answer

>> fun = @(a,b)quadgk(@(x)sin(a.*x).^2.*exp(-b.*x.^2)./x.^2,0,inf);
>> fun(1,1)
ans =
0.76351

4 Comments

Thanks! Actually,I want to get the indefinite integral. I will be very appreciate for your further reply!
The indefinite integral? Not from 0 to infinity then? Or do you mean the symbolic form?
I have got symbolic form with the software Maple with the help of Walter Roberson. It is really kind of you and Walter Roberson. What's more, I want to show the course of the integreal to others, so can you tell me how to arrive at that particular solution to the integral by hand not by any software such as Maple?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!