1
$\begingroup$

I'm trying to do the following integral, but Mathematica won't evaluate it - it just spits out the actual symbolic integral.

$$\frac{e^{-\frac{(k-d)^2}{2 a^2}} \left | \frac{-d+\frac{c i}{2}+k-\frac{i b}{2}}{-d+\frac{b i}{2}+\frac{c i}{2}+k}+1 \right | ^2}{4 \sqrt{2 \pi } \sqrt{a^2}}, a = 1, b = 1, c = 0, d = 0.0001$$

a = 1;
b = 1;
c = 0;
d = 0.0001;

Integrate[((2*Pi*a^2)^(-1/4)*
     Exp[-(k - d)^2/(4*a^2)])^2 * (Abs[
      1 + ((k - d + (I*c/2) - (I*b/2))/ (k - d + (I*c/2) + (I*b/2)))]/
     2)^2, {k, 0, Infinity} ]

$$\int_0^{\infty } \frac{e^{-\frac{1}{2} (k-0.0001)^2} \left | \frac{(-0.0001-0.5 i)+k}{(-0.0001+0.5 i)+k}+1\right | ^2}{4 \sqrt{2 \pi }} \, dk$$

Can anyone tell me what I'm doing wrong?

$\endgroup$
  • $\begingroup$ First,use NIntegrate.second,it is bad idea that put Abs in Integrate. $\endgroup$ – Apple Mar 14 '14 at 4:17
  • $\begingroup$ Thanks. What's the problem with Abs and Integrate? $\endgroup$ – JuanMunoz Mar 14 '14 at 4:27
2
$\begingroup$

Use NIntegrate, it can do it

a = 1;
b = 1;
c = 0;
d = 1/10000;

int = ((2*Pi*a^2)^(-1/4)*Exp[-(k - d)^2/(4*a^2)])^2*
  (Abs[1 + ((k - d + (I*c/2) - (I*b/2))/(k - d + (I*c/2) + (I*b/2)))]/2)^2;
NIntegrate[int, {k, 0, Infinity}]
(* 0.280909 + 0. I *)

Integrate could not find closed form solution

$\endgroup$
  • $\begingroup$ OK, thanks, it works now :) $\endgroup$ – JuanMunoz Mar 14 '14 at 4:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.