Wolfram alpha gives two different answers for $\int^{\infty}_{-\infty} x \frac{1}{\pi} e^{-(\ln(x) - 0.3)^2} | \frac{1}{x}|dx$

167 Views Asked by At

So, I'm trying to calculate $$\int^{\infty}_{-\infty} x \frac{1}{\pi} e^{-(\ln(x) - 0.3)^2} \left| \frac{1}{x}\right|dx$$

When I input that into WA, it loads for a bit, then shows this result: Result 1

Just to almost instantly change to this other result: Result 2

And I can't make sense of why. Why does this calculation give two results for the same input?

Thanks!

In case someone wants to replicate it, the natural language is: Integrate[1/πxExp[-Power[(ln(x)-0.3),2]]* Abs[1/x],{x,-∞,∞}]

1

There are 1 best solutions below

1
On BEST ANSWER

As I alluded to in the comments section, you did not define how the integrand $$f(x) = \frac{x}{\pi |x|} e^{-\left(\log x - \frac{3}{10}\right)^2}$$ is defined for $x \le 0$. On this interval, you would have the principal branch $$\log x = \log |x| + \pi i,$$ hence $$\left( \log x - \frac{3}{10} \right)^2 = \left( \log^2 |x| - \frac{3}{5} \log |x| - \pi^2 + \frac{9}{100} \right) + \left( 2\pi \log |x| - \frac{3\pi}{5} \right)i.$$ When integrated, the real part converges, but the imaginary part does not.

Alternatively, if you define

$$g(x) = \frac{x}{\pi|x|} e^{-\left(\log |x| - \frac{3}{10}\right)^2},$$ then this function is real and well-defined (except for a removable singularity at $x = 0$); but it is also clearly an odd function satisfying $g(-x) = -g(x)$, thus $$\int_{x=-\infty}^\infty g(x) \, dx = 0.$$

If the interval of integration is instead $(0, \infty)$, then

$$\int_{x=0}^\infty f(x) \, dx = \frac{e^{11/20}}{\sqrt{\pi}} \approx 0.977883.$$

Twice this value is the other result you obtained, approximately $1.95577$.

What this shows is that ill-defined inputs can yield unreliable or nonsensical outputs.