# Why doesn't this integral return a symbolic result, but when evaluted in Plot returns the correct function?

I have the intgeral $$f(z_{0}) = \int_{z_{0}}^{\infty} |z| \exp(- a z^{2}) \, \mathrm{d}z$$

Which I compute with

Integrate[Abs[z] Exp[- a z^2], {z, z0, Infinity}]


which returns

\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$z0$$, $$\[Infinity]$$]$$\( \*SuperscriptBox[\(E$$, $$\(-a$$\
\*SuperscriptBox[$$z$$, $$2$$]\)]\ Abs[z]\) \[DifferentialD]z\)\)


which is simply the symbolic form of my input. However if I now turn my integral into a function with Èvaluate with

IntegralFunction[a_, z0_] := Evaluate[Integrate[Abs[z] Exp[- a z^2], {z, z0, Infinity}]]


And then plot with some values

Plot[IntegralFunction[1, z0], {z0, -1, 1}]


You can see we can a result.

Why does this integral not return a symbolic result? Is this integral simply ill defined? Why does Plot return something, is it basically calling NIntegrate to do the plot?

• That explains that bit! I guess Mathematica can't solve the Abs[z] bit, I suppose the solution is to use piecewise? Commented Mar 24, 2020 at 23:10
• Plot works because IntegralFunction returns numbers, which can be plotted. For example, IntegralFunction[1, -1] is a number. Indeed, Integrate[Abs[z] Exp[-a z^2], {z, -1, Infinity}] returns a conditional expression based on the sign of the real part of a. Commented Mar 24, 2020 at 23:30
• NIntegrate it is then! Commented Mar 24, 2020 at 23:59
• For real z, Abs[z] == Sqrt[z^2] then Integrate[Sqrt[z^2] Exp[-a z^2], {z, z0, Infinity}] Commented Mar 25, 2020 at 3:18

It's because when you give numbers for the parameters, Integrate need not assume they are complex numbers of unknown value. You can use assumptions to tell it enough to do the integral symbolically:
Assuming[ a > 0 && Element[z0, Reals],

Piecewise[{{1/(E^(a*z0^2)*(2*a)), z0 >= 0}},