I've been trying to make the following integral but I get no results :
Integrate[ (3/(16 + r^2)- 4/(6.25 + r^2)) E^(-2r^2) Sin[k r] r, {r, 0, Infinity}]
I am new in Mathematica and I have tried with the function Integrate
and NIntegrate
. Is there any command so that I can get a result of the above integral? Thanks :D
Answer
The exact integration fails in this case. One can do this numerically. As much as I understand, you need to have the result as a function of k
. If you do this numerically, the result may only be an approximate function. If this is what you agree to have, the following approach may be undertaken.
First, note that because of the factor Sin[k r]
your integral is highly oscillating at large values of k
. In this case, it can be easily circumvented by the replacement k r->R
. Let us introduce your expression staying under the integral as
Clear[expr];
expr[k_, R_] :=
Simplify /@ (((3/(16 + r^2) - 4/(6.25 + r^2)) Exp[(-2 r^2)] Sin[k r]*
r) /. r -> R/k // Expand)
The expression takes the following form:
Now let us integrate, not forgetting to multiply the expression by 1/k
coming from dr=dR/k
:
lst = Table[{k,
NIntegrate[expr[k, R]*1/k, {R, 0, \[Infinity]}]}, {k,
0.1, 10, 0.1}]
giving you a list of pairs with the structure {k, int[k]}
. You can plot it, if you wish.
Further, if you need to have an approximate analytical function, in the end, you can fit this result to some reasonable function:
model = -a*k*Exp[-c*k^2];
ff = FindFit[lst, model, {a, c}, k]
Show[{
ListPlot[lst, PlotStyle -> Blue,
AxesLabel -> {Style["k", Italic, 16], Style["J(k)", Italic, 16]}],
Plot[model /. ff, {k, 0.1, 10}, PlotStyle -> Red]
}]
(* {a -> 0.0619, c -> 0.114} *)
where the plot is drawn to control the fitting quality:
Here the blue points show the results of the numerical integration, while the red solid line that of the fitting.
However, I guess you may try to do the integral analytically, but by hand. To do this, integrate the terms of the expression above separately. Replace in each of them Sin[R]
by Exp[I R]
and then, observing that the both integrands are even, integrate them from -infinity to +infinity and divide by 2, rather than from 0 to +infinity. Further, use the method of residuals for calculating Fourier integrals. You may have a look here for the method description: V. I. Smirnov, A Course of Higher Mathematics., 16 ed. (Pergamon Pr., Oxford, 1964), Vol. 3 Chapter 3, or somewhere else. In the end take the imaginary part of the solution.
Have fun!
Comments
Post a Comment