# A never ending integral?

1. Sep 13, 2009

### Susanne217

A never ending integral?(last post hopefully the solution

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

I am trying to solve the integral

$$\frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx$$

but it freaking never ends :(

2. Relevant equations

This should have been to be solve by integration by parts but I can never get the v in

$$uv - \int v du$$ to get small enough to end the integral

3. The attempt at a solution

I take the orignal integral

$$\frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx$$

let u = cos(x) and $$du = -sin(x) dx$$

then $$v = \frac{i \cdot e^{-inx}}{n}$$ since $$dv = e^{-inx} dx$$

thus $$\frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx = \frac{-sin(n\pi)}{n}+ (\frac{-cos(n\pi)}{n} - \frac{1}{n}) \cdot i - \int_{0}^{\pi} \frac{i \cdot e^{-inx}}{n} \cdot -sin(x) dx$$

If I do integration by parts a second time I get

$$u = -sin(x), du = -cos(x) dx$$ and $$dv = \frac{i \cdot e^{-inx}}{n}$$ and thus $$v = \frac{i \cdot e^{-inx}}{n^2}$$

Which gives me

$$-sin(x) \cdot \frac{i \cdot e^{-inx}}{n^2}|_{0}^{\pi} - \int_{0}_{\pi} \frac{i \cdot e^{-inx}}{n^2} \cdot -cos(x) dx$$

and I then end up with an expression which looks like this

$$I = \frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx = \frac{-sin(n\pi)}{n}+ (\frac{-cos(n\pi)}{n} - \frac{1}{n}) \cdot i - \int_{0}^{\pi} \frac{i \cdot e^{-inx}}{n^2} \cdot -cos(x) dx$$

Dick, by solving it you mean

$$I = \frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx + \int_{0}^{\pi} \frac{i \cdot e^{-inx}}{n^2} \cdot cos(x) dx = \frac{-sin(n\pi)}{n}+ (\frac{-cos(n\pi)}{n} - \frac{1}{n}) \cdot i$$?

Sincerely

Susanne.

Last edited: Sep 14, 2009
2. Sep 13, 2009

### snipez90

Have you tried doing the integral from the integration by parts and then solving an equation for the original integral?

3. Sep 13, 2009

### gabbagabbahey

If that;s not enough of a hint for you, just do integration by pats twice , then make the substitution

$$I=\frac{1}{2\pi} \int_{0}^{\pi} e^{-inx}\cos x dx$$

And solve the resulting equation for $I$.

4. Sep 13, 2009

### Dick

As snipez90 said, if you let I=the original integral, then if you do integration by parts once more (so the sin turns back into a cos), you should get (a bunch of stuff)-I. So I=(a bunch of stuff)-I. Solve for I.

5. Sep 13, 2009

### Susanne217

made some changes to my original post.

Is that what you are refering too?

Am I not ment to get rid of the final integral???

Sincerely

Susanne.

6. Sep 13, 2009

### Dick

I didn't check the details of the integration, but yes, that's the general idea. Now call I the integral of cos(x)*exp(-inx). It occurs on both sides of your equation. Solve for it.

7. Sep 13, 2009

### Susanne217

changed my post again,

If my integration and if my rearranging of the equation is what you are refering too. Do I then as a final step covert the sum of the two integrals into one sum which then results in the right-hand side of the equation?

8. Sep 13, 2009

### Dick

I'm not quite sure what you mean there, but what I meant is to write 'I' for the integral. So the left side of your equation is I/(2pi)+I*i/n^2. Factor the I out, like I*(1/(2pi)+i/n^2). Now solve for I.

9. Sep 13, 2009

### Susanne217

Silly me I found out that maybe I had to much to drink at the party

anyway after using a lot of paper I found that the antiderivative of

$$I = \frac{1}{2\pi} \cdot \int_{0}^{\pi} e^{-i \cdot n \cdot x} \cdot cos(x) dx$$

Has the antiderivative

$$\frac{1}{2\pi} \cdot \frac{e^{-i \cdot n \cdot x} \cdot (sin(x) - \cdot i \cdot n \cdot cos(x))}{i^2 \cdot n^2 +1}|_ {0}^{\pi}$$

Which gives me

$$c_n = \frac{-n \cdot sin(\pi \cdot n)}{2(n^2-1)\cdot \pi} + (\frac{-n \cdot cos(n \pi)}{2(n^2-1)\cdot \pi} - \frac{n}{2(n^2-1)\cdot \pi}) \cdot i$$

where $$c_n = \frac{1}{2\pi} \cdot \int_{-\pi}^{\pi} f(x) \cdot e^{-inx} dx$$

What I am suppose to show is that

if the function f defined on the interval $$]-\pi,\pi[$$

where $$f(x) = \left( \begin{array}{ccc}0 & -\pi < x \leq 0 \\ cos(x) & 0 < x < \pi \end{array}$$

has a corresponding fourier series.

on the form

$$\sum_{-\infty}^{\infty} c_n \cdot e^{inx} }$$

I am new to Fourier series so I would like be sure have I covered all aspect of showing what the corresponding fourier series for f(x) is?

Sincerely
Susanne.

Last edited: Sep 13, 2009
10. Sep 13, 2009

### gabbagabbahey

Your result for $c_n$ is correct, but the work you've shown on the integration leads me to believe you might still be a little lost.... If so ,first redo your integration by parts without forgetting the factor of 1/2pi...you should get:

\begin{aligned}\frac{1}{2\pi} \int_{0}^{\pi} e^{-inx}\cos x \operator{d}x & =\frac{1}{2\pi} \left. \left[\frac{i}{n}e^{-inx}\cos x-\frac{1}{n^2}e^{-inx}\sin x\right]\right|_0^{\pi}+\frac{1}{2\pi n^2}\int_{0}^{\pi} e^{-inx}\cos x dx \\ & =-\frac{i(1+e^{-in\pi})}{2n\pi}+\frac{1}{2\pi n^2}\int_{0}^{\pi} e^{-inx}\cos x dx\end{aligned}

Do you have any trouble getting to this point?

From here, just make the substitution $I\equiv \frac{1}{2\pi}\int_{0}^{\pi} e^{-inx}\cos x dx$ giving you:

$$I=-\frac{i(1+e^{-in\pi})}{2n\pi}+\frac{1}{n^2}I$$

Then just solve for $I$

You can also simplify your final result for $c_n$, by noting that for integer values of $n$, you have $\sin(n\pi)=0$ and $\cos(n\pi)=(-1)^n$

11. Sep 13, 2009

### Susanne217

If I solve for I i get

$$I - \frac{I}{n^2} = \frac{i(1+e^{-inx})}{2n\pi} <-> I - I = n^2\frac{i(1+e^{-inx})}{2n\pi}$$

am I then to understand that the above result with respect I is the same as my C_n in the previous post?

Sincerely
Susanne.

Last edited: Sep 13, 2009
12. Sep 13, 2009

### gabbagabbahey

Huh?!

Is this just a problem you are having with typing in $\LaTeX$ (i.e. a typo), or do you really mean this nonsensical gibberish?

$$I - \frac{I}{n^2}=\left(1-\frac{1}{n^2}\right)I = \frac{i(1+e^{-inx})}{2n\pi}\implies I= \frac{i(1+e^{-inx})}{2n\pi\left(1-\frac{1}{n^2}\right)}$$

13. Sep 13, 2009

### Susanne217

Latex typoo Sir

Anyway to isolate I insert the old integral in place of I

$$I=-\frac{i(1+e^{-in\pi})}{2n\pi}+\frac{1}{n^2}I$$

and get

$$\frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx=-\frac{i(1+e^{-in\pi})}{2n\pi}+\frac{1}{n^2} \cdot \frac{1}{2\pi} \int_{0}^{\pi} e^{-inx} \cdot cos(x) dx$$

and this equals my C_n. Isn't that you are saying?
Sincerely
Susanne

p.s. if x = $$x = \pi p$$ where $$p \in \mathbb{Z}$$

then find the sum of the series

don't I just inserting any n+1 p into C_n and find the convergence sum?

Last edited: Sep 13, 2009
14. Sep 13, 2009

### gabbagabbahey

No, what good would that do?!

To isolate $I$ just use some basic algebra. Start with

$$I=-\frac{i(1+e^{-in\pi})}{2n\pi}+\frac{1}{n^2}I$$

Subtract $\frac{1}{n^2}I$ from both sides of the equation. Then factor out $I$ on the LHS, and finally divide both sides of the equation by $(1-\frac{1}{n^2})$.

You have studied basic algebra right?

15. Sep 13, 2009

### Susanne217

Then if

$$c_n = \frac{i(1+e^{-inx})}{2n\pi\left(1-\frac{1}{n^2}\right)}$$

then $$cos(x) = \frac{i(1+e^{-inx})}{2n\pi\left(1-\frac{1}{n^2}\right)} \cdot e^{inx}$$

next find the sum if $$x = \pi \cdot p$$ where $$p \in \mathbb{Z}$$

$$f(p\pi) = 1 = \sum_{n=1}^{\infty} (\frac{i(1+e^{-inx})}{2n\pi\left(1-\frac{1}{n^2}\right)} \cdot e^{in\pi})$$

this can be expanded $$\frac{1}{2\pi}\cdot i \cdot \sum_{n=1}^{N} (\frac{n(cos(n\pi)+1}{(n^2+1)}) = \sum_{n=1}^{N} \frac{\frac{n(cos(n\pi)+1}{(n-1)} = 2$$

This means that by sum expansion that the sum of the series is $$\frac{1}{2\pi} \cdot \mathrm{i}$$

Is that would the sum should be?

Sincerely
Susanne.

Last edited: Sep 14, 2009