Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

To prove $\int_{-\infty}^\infty xe^{-x^2}dx = 0$, my solution is

  1. Let $y=x^2$, then $dy=2xdx$.
  2. $\begin{align} \int_{-\infty}^\infty xe^{-x^2}dx &= \frac{1}{2}\int_{-\infty}^\infty e^{-x^2}2xdx &\cdots (2.1) \\ &=\frac{1}{2}\int_{0}^{\infty}e^{-y}dy &\cdots (2.2) \\ &=\frac{1}{2} & \cdots (2.3) \end{align}$

I don't know which step I made a mistake on?


  • For the change of the limits of integration (2.2), I think $y=x^2 \in [0, \infty]$.
  • I know $xe^{-x^2}$ is odd. So I know to prove this equation by this property. But my puzzle is I think each step is correct but the result is incorrect.
share|improve this question
You might note that your function is odd. So it should be $0$ (if the integral converges absolutely). I believe I do see an error when you changed the limits of your integration: I don't see how you got that zero in the second equation. –  Bryan Feb 7 at 5:07
@Bryan I know it's odd. I just want to know which step is error. I've updated my question. –  Yantao Xie Feb 7 at 5:11

2 Answers 2

up vote 7 down vote accepted

Your mistake is right before you substitute. You have $y=x^2$ and $dy=2x \;dx$. So substituting carefully, $$ \int_{0}^{\infty} xe^{-x^2}\;dx=\int_0^{\infty} xe^{-y}\cdot \frac{1}{2x} \;dy=\int_0^\infty \frac{e^{-y}}{2}\;dy $$ But you need to be careful! Notice my integral only goes from $0$ to $\infty$. Why didn't I do $-\infty$ to $\infty$? Notice then you'd obtain $\infty$ as both your upper and lower bound. But that can't be correct! What's happening? Well, your substitution isn't one-to-one over the region you're integrating! One needs to be careful!

But there is an easy way to do this integral! Very easy indeed. So I'll leave you with a hint:

HINT. Let $f(x)=xe^{-x^2}$. What is $f(-x)$? What does that mean about $f(x)$ (is it even or odd or neither?), what does that mean for your integral?

EDIT. What is one-to-one? This means for any given output of a function, there could only have been one input that one could use to obtain that output. For example, take $f(x)=x$. What $x$ do we have to put in to obtain $3$? We let $x=3$ to obtain $3$. Are there any other $x$'s such that $f(x)=3$? No. Therefore, $f(x)=x$ is one-to-one, or as some would say, injective (another word for one-to-one).

That seems rather trivial, but let's contrast this with a different example. Take $f(x)=x^2$. What $x$ can we put into $f$ to obtain $4$? Well, $x=2$ will work as $f(2)=2^2=4$. Are there any others? Indeed, there are! Let $x=-2$ then $f(-2)=(-2)^2=4$. Therefore, $f(x)=x^2$ is not one-to-one. Why? Because if I asked you, for example, what $x$ you plugged in to obtain $4$, you couldn't tell me if it was $x=-2$ or $x=2$.

For functions $f(x)$ that can be plotted in the plane, determining if $f(x)$ is one-to-one is easy: $f(x)$ is one-to-one only if every horizontal line in the plane intersects $f(x)$ at most once. Notice every horizontal line intersects $f(x)=x$ at only one place. But for $f(x)=x^2$, every horizontal line $y=c$, with $c<0$, do not intersect $f(x)=x^2$. But that's not a problem. The line $y=0$ intersects $f(x)=x^2$ once but every horizontal line $y=c>0$ intersects the parabola twice. Therefore, $f(x)=x^2$ is not injective.

But why would we need a $u$-substitution to be one-to-one over the interval which we are integrating? The major problem is that we should be able to return to our original integral. I particularly like the example given here in this question.

Moreover, that question makes it clear what problems can arise when the substitution is not injective. I will not iterate their fine arguments. As one of the answers mentions in the comments, in some cases it doesn't matter if the substitution is injective or not. In fact, it can be hard to come up with examples when it does. Even in your problem, $$ \int_{-\infty}^\infty xe^{-x^2}\;dx=0 $$ and with the substitution $y=x^2$, we have $$ \int_\infty^\infty \cdots \;dy=0 $$ without even needing to know what $\cdots$ means.

Of course, the substations need also be continuous but for a different reason (to map the integration region 'the way we want'). These things won't often come into play in the introductory Calculus course beyond that you should know that these things should be checked for.

The biggest take away point, is that the $(-\infty,\infty)$ interval maps to $(\infty,\infty)$ in the substitution shows that this method for integrating your function is probably a bad method and that something else has been missed. Indeed, here the simple solution of seeing the integral as an odd function is probably the best way of doing this and was also probably the take away point.

share|improve this answer
Can you have a explanation about what a one-to-one substitution over the region is? Thanks. –  Yantao Xie Feb 7 at 5:29
@CookSchelling Of course, I shall add this as an edit. –  mathematics2x2life Feb 7 at 6:13

The change of variables $y=x^2$ makes sense only for $x\ge 0$ or only for $x\le 0$.

Basically $xe^{-x^2}$ is an odd function, i.e., $f(-x)=-f(x)$ , and thus its integral is equal to zero.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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