# Integrate error function related expression

I have some problem to integrate the expression given below:

hN = 5; γ = 30; ρ = 1200; cp = 1200; k = 0.2;
w0 = 150*10^-6; α = k/(ρ*cp); τ = 0;
ab = hN/(hN - γ*k)*Exp[hN^2/k*α (t - τ)]* Erfc[hN/k*Sqrt[α (t - τ)]];
ac = (γ*k)/(hN - γ*k)* Exp[γ^2*α (t - τ)]* Erfc[γ*Sqrt[α (t - τ)]];
cd = (ab - ac);

Integrate[
Exp[-2*r^2/8*α*(t - τ) + w0^2]/(8*α*(t - τ) + w0^2)*cd,
{t, 0, .001}
]

• You haven't set a value for r. Are you trying to get the integral as a function of r? Setting r = 1 and using NIntegrate (Integrate can't cope, so do it numerically) seems to evaluate fine. – aardvark2012 Aug 21 '17 at 12:01
• Yes ,I want to integral in term of r. – Gopal Verma Aug 21 '17 at 12:42
• So, why was there a period in the title, Gopal? – J. M. will be back soon Aug 21 '17 at 14:59
• This is an almost constant function of r. Here are some values obtained by numerical integration:$0.5 \to 43360.85509867566,\, 0. \to 43360.85509886233,\, 20 \to 43360.85480019366.$ – user64494 Aug 21 '17 at 16:56
• @user64494 Not really. You just didn't span a large enough value of $r$ to see an appreciable change. – MarcoB Aug 21 '17 at 20:28

   Finally, I got our results that I want.
hN = 5; \[Gamma] = 30; \[Rho] = 1200; cp = 1200; k = 0.2;
w0 = 150*10^-6; \[Alpha] = k/(\[Rho]*cp); \[Tau] = 0;
ab = hN/(hN - \[Gamma]*k)*Exp[hN^2/k*\[Alpha] (t - \[Tau])]*
Erfc[hN/k*Sqrt[\[Alpha] (t - \[Tau])]];
ac = (\[Gamma]*k)/(hN - \[Gamma]*k)*
Exp[\[Gamma]^2*\[Alpha] (t - \[Tau])]*
Erfc[\[Gamma]*Sqrt[\[Alpha] (t - \[Tau])]];
cd = (ab - ac);
int[r_?NumericQ, u_?NumericQ] :=
NIntegrate[
Exp[-2*r^2/8*\[Alpha]*(t - \[Tau]) +
w0^2]/(8*\[Alpha]*(t - \[Tau]) + w0^2) cd, {t, 0, u}]
Plot[Evaluate[Table[int[r, u], {u, 0.04, 1, .2}]], {r, -10^5, 10^5},
PlotRange -> All] Symbolic integration seems to take forever, and a solution is not guaranteed. If you can make do with numerical values, however, numerical integration is very fast:

Clear[int]
int[r_?NumericQ] := NIntegrate[
Exp[-2*r^2/8*α*(t - τ) + w0^2]/(8*α*(t - τ) + w0^2)*cd, {t, 0, .001}]

Plot[int[x], {x, -10^6, 10^6}] • Thanks, Actually I want to make a table of graph ( e.g. t=(0,.001,.002,..) in same graph and x-axis range. – Gopal Verma Aug 21 '17 at 22:17
• @GopalVerma I'm not sure I understand. You want to plot the value of the integral as you change the limits of integration? For a constant value of $r$? Or you want a 3D plot, as a function of $t_{max}$ and $r$? – MarcoB Aug 21 '17 at 22:51
• Yes, I want to plot the value of integral by changing the limit, but in same graph,I want to plot it for compaion. – Gopal Verma Aug 22 '17 at 8:16