# Use fourier series to find sum of infinite series

1. May 4, 2014

### unscientific

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

Find the value of An and given that f(x) = 1 for 0 < x < L/2, find the sum of the infinite series.

2. Relevant equations

3. The attempt at a solution

The basis is chosen to be $c_n = \sqrt{\frac{2}{L}}cos (\frac{n\pi }{L}x)$ for cosine, and $s_n = \sqrt{\frac{2}{L}}sin (\frac{n\pi}{L}x)$ for sine.

$$|f\rangle = \sum_0^{\infty} \langle c_n|f\rangle |c_n\rangle + \sum_1^{\infty}\langle s_n|f\rangle|s_n\rangle$$

Compare this with:

$$f = \sum_0^{\infty}c_n' cos(\frac{n\pi }{L}x) + \sum_1^{\infty}A_n sin(\frac{n\pi}{L}x)$$

We are given that f(x) = 1 for 0 < x < L/2.

Therefore,
$$A_n = \sqrt{\frac{2}{L}}\langle s_n|f\rangle = \frac{2}{L}\int_0^{L/2}f_{(x)} sin(\frac{2\pi n}{L}x) dx$$
$$A_n = \frac{1}{n\pi}\left[1 - cos(n\pi)\right]$$
$$A_n = \frac{1}{n\pi}\left[1 - (-1)^n\right]$$

For odd n, $A_n = \frac{2}{(2n-1)\pi}$

Either the first series or the third series works for $A_n$:

For 0 < x < L/2, f(x) = 1:

$$1 = \sum_{n=1}^{\infty} \frac{2}{(2n-1)\pi}sin\left(\frac{2\pi n}{L}x\right)$$

Choosing x = L/4:
$$1 = \sum_{n=1}^{\infty} \frac{2}{(2n-1)\pi}sin\left(\frac{n\pi}{2}\right)$$
$$1 = \sum_{n=1}^{\infty} \frac{2}{(2n-1)\pi} (-1)^{n+1}$$
$$\frac{\pi}{2} = \sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{(2n-1)} = 1 - \frac{1}{3} + \frac{1}{5} - ...$$

Last edited: May 4, 2014
2. May 4, 2014

### BvU

The exercise asks for an expression for $k_n$

From your $s_n = \sqrt{\frac{2}{L}}sin (\frac{n\pi}{L}x)$ I get the impression that n = 1 is also allowed. But then the period definitely isn't L !

Furthermore, for periodic functions the integral isn't from $-\infty$ to $\infty$ or from $0$ to $\infty$ but from $0$ to $L$

3. May 4, 2014

### unscientific

Oops, the correct value for kn should be $k_n = \frac{2\pi n}{L}$.

And I've updated my answers above. Now I'm missing a factor of 1/2 on the LHS.

Last edited: May 4, 2014
4. May 4, 2014

### BvU

Missing 1/2 on the LHS of what, exactly?
Remind me of the relevant eqn for $A_n$...

5. May 4, 2014

### unscientific

$$f_{(x)} = \sum_{n=1}^{\infty} \frac{1}{(2n-1)\pi}sin\left(\frac{2\pi n}{L}x\right)$$

If I choose x = L/4 or L/8, LHS should be = 1, given f(x) = 1 for 0< x < L/2. But the RHS is different.

Last edited: May 4, 2014
6. May 6, 2014

### unscientific

So, if $A_n = \frac{1}{n\pi}\left[1 - (-1)^n\right]$, then for odd n: $A_n = \frac{1}{n\pi}\left[1 - (-1)^n\right]$.

Plugging this into the fourier series:

$$1 = \sum_{n=1}^{\infty} \frac{2}{(2n-1)\pi}sin\left(\frac{n\pi}{2}\right)$$

Still the LHS isn't $\frac{\pi}{4}$..

7. May 6, 2014

### xiavatar

What do you get when you do the following integration $A_n=\frac{2}{L/2}\int_0^{L/2}sin(\frac{n\pi x}{L/2})dx$? You just made a silly mistake in your calculation. Show your calculations step by step.

8. May 6, 2014

### Saitama

I have no idea about the fourier series but the problem doesn't state any restriction about using it to evaluate the given sum. I have two methods.

Method 1:
The given sum is:
\begin{aligned} \\ \sum_{r=0}^{\infty} \frac{(-1)^r}{2r+1} & =\sum_{r=0}^{\infty} (-1)^r\int_0^1 x^{2r}\,dx\\ & =\int_0^1 \frac{dx}{1+x^2}\\ & =\left(\arctan(x)\right|_0^{1}\\ &=\frac{\pi}{4} \end{aligned}

Method 2:
Use the series of $\ln(1+x)$ at $x=i$ where $i=\sqrt{-1}$ i.e
$$\ln(1+i)=\ln(\sqrt{2}e^{i \pi/4})=i-\frac{1}{2}-\frac{i}{3}+\frac{1}{4}+\frac{i}{5}-\cdots$$
Compare the imaginary parts on both the sides to get the sum.

Last edited: May 6, 2014
9. May 6, 2014

### xiavatar

I am guessing the OP is taking a class in Fourier Analysis, which is why he's posting this problem. Yes, there are other methods, but I think he needs to understand what he is doing wrong in his calculation of the Fourier series.

10. May 6, 2014

### unscientific

Ok, I think I got it. Fe or a sine series, we extend the function to be f(x) = -1 for L/2 < x < L. So that the integrand is an odd*odd = even function.

Thus,

$$A_n = \frac{2}{L} \int_0^L f_{(x)} sin \left(\frac{2\pi n}{L}x\right) dx = 2\left( \frac{2}{L} \right) \int_0^{\frac{L}{2}} sin \left(\frac{2\pi n}{L}x\right) dx$$

I have found my missing factor of 1/2!

Last edited: May 6, 2014
11. May 6, 2014

### unscientific

Honestly, that is brilliant! I couldn't have thought of that.