# Integrating exp(mod(x))

1. Nov 10, 2007

### Morto

Hello!

I need to calculate $$\int_{-\infty}^{\infty} x^{2} e^{-\frac{|x|}{b} dx$$ and I know the answer should involve $$\pi$$.
I've tried splitting the integral for x and -x with limits from 0 to infty and -infinty to 0, which gives me the answer of 2b. But I don't think this is correct. Does anyone have any hints or tips on what to do?

2. Nov 10, 2007

### neutrino

That's a correct way to approach this.

Oh, BTW, the answer does not involve pi, unless you want to write it as answer*pi/pi or something.

3. Nov 10, 2007

### arildno

Note that your integrand is even. Thus, you may simplify your problem as follows:
$$\int_{-\infty}^{\infty}x^{2}e^{-\frac{|x|}{b}}dx=2\int_{0}^{\infty}x^{2}e^{-\frac{x}{b}}$$
where I've omitted the absolute value sign about x, since for x>=0, we have |x|=x.

4. Nov 10, 2007

### Kummer

Here is a continuation of arildno post. Let $$t=-x/b$$ (assuming $$b>0$$) and preform substitution. Then do integration by parts twice.

5. Nov 10, 2007

### arildno

Wouldn't it just be simpler to let t=x/b so that we don't need to change our limits to 0 and and negative infinity?

6. Nov 10, 2007

### sennyk

Why do a normal substitution?

It looks like one should use integration by parts twice.

7. Nov 11, 2007

### sennyk

One more hint, there are two answers. The reason is that you don't know what the value of b is.

8. Nov 11, 2007

### Count Iblis

You don't need to do integration by parts. Just substitute b ---> 1/p
so that the exponential becomes exp(-p x) . Integrate exp(p x) and differentiate twice w.r.t. p to bring down a factor x^2 in the integrand.

The integral is thus 1/p. Differentiating twice w.r.t. p gives 2/p^3. Multiply by 2 and put back b to obtain the answer: 4 b^3.

9. Nov 11, 2007

### sennyk

I don't understand what method you are using. Is this some sort of DE trick? I would appreciate learning this method. Please post the full solution.

(Note: If b is negative, the integral diverges.)

Last edited: Nov 11, 2007
10. Nov 11, 2007

### Count Iblis

It is explained in detail here.

E.g.

$$\int_{0}^{\infty}\exp(-p x)dx=\frac{1}{p}$$

Differentiate both sides w.r.t. p:

$$\frac{d}{dp}\int_{0}^{\infty}\exp(-p x)dx=-\frac{1}{p^2}$$

Interchange the order of integration and differentiation to obtain:

$$\int_{0}^{\infty}x\exp(-p x)dx=\frac{1}{p^2}$$