# Improper Integrals

1. Oct 30, 2008

### kingwinner

1. The problem statement, all variables and given/known data
Evaluate

∫ [1/sqrt(2 pi)] x e-x2/2 dx
-∞

∫ [1/sqrt(2 pi)] x2 e-x2/2 dx
-∞

2. Relevant concepts
Improper integrals

3. The attempt at a solution
In my notes, it says the the first integral is 0 since

∫ odd function =0
-∞
But I am having a lot of trouble understanding this.
Code (Text):

∫ f(x)dx
-∞
by definition is equal to
0                b
lim    ∫ f(x)dx + lim    ∫ f(x)dx
a->-∞  a          b->∞  0
a and b are different, so how can it be true that

∫ odd function =0 ?????? Is this even correct?
-∞
What is the correct way to evalaute the integral?

Also, how can I compute the second integral?

Thanks for any help!

2. Oct 30, 2008

$$\int_{=\infty}^\infty \frac 1 {1 + x^2} \, dx$$

Your quoted definition, applied literally, would result in work I would organize this way.

Step 1.
$$\int_a^b \frac 1 {1+x^2} \, dx = \int_a^0 \frac 1 {1+x^2} \, dx + \int_0^b \frac 1 {1+x^2} \, dx$$

You would then integrate each one of these, getting one expression involving $$a$$, another $$b$$. Calculating the two limits (as $$a \to -\infty$$ and
as $$b \to \infty$$) would give the first improper integral.

The item you quoted is more of a definition than a guide for calculating integrals. It is meant to provide a distinction between the Cauchy value of an integral, which is defined as

$$\int_{-\infty}^\infty f(x) \, dx = \lim_{a \to \infty} \int_{-a}^a f(x) \, dx$$

- this type of integral can exist when the one you asked about does not.

try integration by substitution on
$$\frac{1}{\sqrt{2 \pi}} \int_{-\infty}^\infty x e^{{-x^2}/2} \, dx$$

and integration by parts on

$$\frac 1 {\sqrt{2 \pi}} \int_{-\infty}^\infty x^2 e^{{-x^2}/2} \, dx$$

In the second case you will encounter an integral that has no closed form but whose value can be found in many books.

I don' know what your statistics background is, but both of these integrals relate to the normal distribution.

Last edited: Oct 30, 2008
3. Oct 30, 2008

### HallsofIvy

Staff Emeritus
LaTex error? Those integrals should be
$$\frac{1}{\sqrt{2}\pi}\int_{-\infty}^\infty xe^{-x^2}dx$$
and
$$\frac{1}{\sqrt{2}\pi}\int_{-\infty}^\infty x^2e^{-x^2}dx$$

Last edited: Oct 30, 2008
4. Oct 30, 2008

I think the OP had $$\pi$$ inside the square roots in his integrals?

5. Oct 30, 2008

### kingwinner

For the first integral, I was asked to prove that the expected value E(Z) of the standard normal is 0
So by definition, the expcted value is

∫ [1/sqrt(2 pi)] x e-x2/2 dx
-∞
The definition doesn't even use the Cauchy value, it is about the usual definition of (improper) integrals...I believe. Does this integral converge in the usual sense?
I am not totally convinced by the argument

∫ odd function = 0 thus E(Z)=0
-∞
How can I prove more rigorously that E(Z)=0 ?

=======================

For the second integral, what should u and dv be when you do integration by parts? I tried it and ran into some trouble...

Thanks a lot!

6. Oct 30, 2008

### kingwinner

Yes, you are right! It's the standard normal density

7. Oct 30, 2008

"Yes, you are right! It's the standard normal density"

I know that. My comment was made out of confusion, as Halls seemed to be saying that I'd screwed up my latex. It's happened to me before, but I knew the $$\pi$$ should be there.

I realize your original question does not require the second definition for the integral - I gave in an attempt to explain why the definition you gave is the way it is.

Concerning why

$$\int_{-\infty}^\infty f(x) \, dx = 0$$

when the integrand is odd. First, do this:

$$\int_{-\infty}^{\infty} f(x) \, dx = \int_{-\infty}^0 f(x) \, dx + \int_0^\infty f(x) \,dx$$

Make the following substitution in the first integral.

$$w = -x \Rightarrow dw = -dx \Rightarrow dx = -dw$$

Further, when $$x = 0$$ we have $$w = 0$$, and as $$x \to -\infty$$ we have $$w \to \infty$$ (note the sign change).
The first integral looks like this.

$$\int_{\infty}^0 f(-w) \, (-1) dw = \int_{\infty}^0 f(w) dw$$

(I used the fact that $$f(-w) = -f(w)$$.)
Here is the final step: use the fact that reversing the limits of integration on an integral changes the sign of the integral.

$$\int_{\infty}^0 f(w) \, dw = - \int_0^{\infty} f(w) \,dw$$

Since the variable of integration is arbitrary, the final integral above could be written with $$x$$ as well as $$w$$. Going back to the start of this,

$$\int_{-\infty}^\infty f(x) \, dx = -\int_0^{\infty} f(x) \, dx + \int_0^{\infty} f(x) \, dx = 0$$

Appealing to the fact that the integrand in E[Z] is an odd function is a rigorous proof of the fact that the expectation is zero. If you want to carry out the integration, think about this question: What is the anti-derivative of this function?

$$x e^{{-x^2}/2}$$

For the second integral, write the integrand as

$$x \cdot \left(x e^{{-x^2}/2}\right)$$

this, with my suggestion for the first integral, should guide you to appropriate choices for the integration by parts.

8. Oct 30, 2008

### kingwinner

Looking back to my calculus textbook, it says that it is entirely possible that

∫ odd function will diverge so it's not always equal to zero.
-∞
The book also provided many counterexamples.

So back to our integral,

∫ [1/sqrt(2 pi)] x e-x2/2 dx
-∞
Saying that the integrand is an odd function, and thus the integral is 0 doesn't look quite right to me. The integral might not even converge. How can I prove that the integral converges in the first place? Secondly, is it true in general that IF the integral of an odd function converges, it must equal 0?

And the antiderivative of $$x e^{{-x^2}/2}$$ is $$-e^{{-x^2}/2} + C$$

For the second integral, after letting u=x, dv=xe-x2/2 and integrating by parts, I have to end up integrating $$e^{{-x^2}/2}$$, how can I do so?

Thank you!

9. Oct 30, 2008

It is true that the fact a function is odd does not, by itself, mean an integral of the type
you are working with will converge. Consider $$g(x) = x$$. This is an odd function, and

$$\int_{-\infty}^\infty x \, dx$$

does not exist. It is true that if the function $$f$$ is odd, and
the integral converges, the value of the integral is zero. The demonstration is the one I gave you.
How do you prove the integral exists? At this level begin to evaluate it. If, when you work through the limits you find they exist, the integral converges. If the limits don't exist, the integral doesn't converge.
So now use this to compute

$$\int_a^0 x e^{{-x^2}/2} \, dx + \int_0^b x e^{{-x^2}/2} \, dx$$
using your antiderivative, then take limits as $$a \to -\infty$$ and $$b \to \infty$$ to finish the calculation of the improper integral.

You've already stated that part of the integrand is the standard normal density, so you know that

$$\frac 1 {\sqrt{2 \pi}} \int_{-\infty}^\infty e^{{-x^2}/2} \, dx = 1$$

correct? That should allow you to finish the integration.

10. Oct 31, 2008

On more comment about showing why this integral

$$\int_{-\infty}^\infty x e^{{-x^2}/2} \, dx$$

converges. I think my comment in my previous post was a little terse.

There are comparison tests for integrals, and their use is similar to the use of comparison tests for infinite series. From what I said in my previous post, if we can show that

$$\int_0^\infty x e^{{-x^2}/2} \, dx$$

converges, we'll be done.

Break this integral into these portions.

$$\int_0^\infty x e^{{-x^2}/2} \, dx = \int_0^3 x e^{{-x^2}/2} \, dx + \int_3^\infty x e^{{-x^2}/2} \, dx$$

The first integral is finite since the region of integration is finite and the integrand is continuous. Since the second integral covers the region $$x \ge 3$$ we know

$$xe^{{-x^2}/2} \le e^{-x}$$

on it. Since (easy to verify)

$$\int_3^\infty e^{-x} \, dx < \infty$$

we conclude that

$$\int_3^\infty x e^{{-x^2}/2} \, dx < \infty$$

and we're done.

Similar ideas work for any integral of the form

$$\int_{-\infty}^\infty x^n e^{{-x^2}/2} \, dx$$

for any positive integer $$n$$, which shows the normal distribution has finite moments of every order (hence the moment generating function exists)

Last edited: Oct 31, 2008