# Thread: Fourier Serries - Integration Help

1. ## Fourier Serries - Integration Help

Ok, just attempted another Fourier serries for the half range sine extension of x(l-x) over the range 0<x<l. I havent finished the question yet but before i go any futher i would like to get someone else to have a look over my working if anyone has the time.

The problem and my solution to finding the coeficient bn, are attached and was hopeing someone could take a look at my integration and make sure i didn't make a mistake somewhere. Also, is there a simple way to test to see if i have the right expression for bn?

Thanks
Elbarto

2. Here is how you should extend the function.

The thin red line is the actual function.

The dotted line is the extension to make it ODD.

The bold red lines are just the periodical repeats.

3. Yes the sketch i did looks pretty much the same, tho i left my graph in terms of l and said the maximum occurs at y=l^2/4.

4. $\displaystyle \frac{a_0}{2}+\sum_{n=1}^{\infty} a_n \cos \frac{\pi n x}{L} + b_n \sin \frac{\pi n x}{L}$
---

You made the function odd, so this is a half-range sine Fourier expansion.

We can ignore the constant term $\displaystyle a_0$ and the cosine terms $\displaystyle a_n = 0 \mbox {for }n\geq 1$.

That means we simply need to find,
$\displaystyle b_n = \frac{1}{L} \int_{-L}^L f(x) \sin \frac{\pi n x}{L} dx = b_n = \frac{2}{L} \int_0^L f(x) \sin \frac{\pi n}{L}$.

We know that $\displaystyle f(x) = x(L-x)$ on $\displaystyle [0,L]$.

$\displaystyle b_n = \frac{2}{L} \int_0^L xL\sin \frac{\pi n x}{L} - x^2\sin \frac{\pi n x}{L}dx$

So now you need to boringly compute each summand.
The first,

$\displaystyle \int_0^L xL\sin \frac{\pi n x}{L} dx = - \frac{L^2}{\pi n}\cos \pi n$

I did not do the second one. And I have to leave now.

5. Theperfecthacker,
My first integral was the same as the integral you found so I looked for a problem in working out the second part. Sure enough, I found a problem in evaluating the limits at the end of the problem. I fixed this and my answer came out as

$\displaystyle b_n=\frac{4L^2} {n^3\pi^3}[1-(-1)^n]$

I graphed this in Mircosoft Excel for just one term in the serries and it looks pretty good. Tho i can see that the first term of the serries slightly over estimates the curve x(l-x) so i guess it makes sense that the next term should be subtracted but my serries for bn makes every odd term a possitive so can i expect the estimation of the curve x(l-x) to get worste as n approaches infinity?

I am looking at part C and it looks alot like my series apart from the alternating integers.

Thanks For the help.
Elbarto

6. I check the first one again and it was correct.
Let me just do the second one.

$\displaystyle \int_0^L x^2 \sin \frac{\pi n x}{L}dx$

$\displaystyle -\frac{L}{\pi n}\cdot x^2 \cos \frac{\pi n x}{L} \big|_0^L + \frac{2L}{\pi n}\int_0^L x \cos \frac{\pi n x}{L}dx$

Look at second integral: $\displaystyle \int_0^L x \cos \frac{\pi n x}{L} dx$

$\displaystyle \frac{L}{\pi n}\cdot x\sin \frac{\pi n x}{L} \big|_0^L - \frac{L}{\pi n}\int_0^L \sin \frac{\pi n x}{L} dx = \frac{L}{\pi^2 n^2}\cos \frac{\pi n x}{L} \big|_0^L = (1-(-1)^n)\cdot \frac{L^2}{\pi^2 n^2}$

$\displaystyle (-1)^{n+1} \cdot \frac{L^3}{\pi n} + \frac{2L}{\pi n} \left( (1-(-1)^n)\cdot \frac{L^2}{\pi^2 n^2} \right) = (-1)^{n+1} \cdot \frac{L^3}{\pi n} +(1-(-1)^n) \cdot \frac{2L^3}{\pi^3 n^3} =$$\displaystyle \left\{ \begin{array}{c} -L^3/\pi n \mbox{ even } \\ L^3/\pi n + 4L^3/\pi^3n^3 \mbox{ odd} \end{array} \right\} So \displaystyle b_n terms are (do not forget the factor outside the integral): \displaystyle \frac{2(-1)^{n+1}L^2}{\pi n} - \frac{2}{L} \cdot c_n where \displaystyle c_n are desribed in that box. Now consider even and odd terms: \displaystyle \mbox{Even}: \frac{-2L^2}{\pi n} + \frac{2}{L} \cdot \frac{L^3}{\pi n} = 0 \displaystyle \mbox{Odd}: \frac{2L^2}{\pi n} - \frac{2}{L} \cdot \frac{L^3}{\pi n} - \frac{4L^3}{\pi^3 n^3} = - \frac{4L^3}{\pi^3 n^3} So the terms of this sequence are only odd and they are: \displaystyle - \frac{4L^3}{\pi^3 n^3} 7. The function periodically extended as a half-range sine expansion has the following sum: \displaystyle f(x) = -\frac{4L^3}{1^3\pi ^3} \sin \frac{\pi x}{L} - \frac{4L^3 }{3^3\pi ^3} \sin \frac{3\pi x}{L}$$\displaystyle - \frac{4L^3}{5^3\pi^3} \sin \frac{5\pi x}{L} - ... =$$\displaystyle -\frac{4L^3}{ \pi^3} \sum_{n=1}^{\infty} \frac{\sin\frac{(2n-1) \pi x}{L}}{(2n-1)^3} If \displaystyle L=2 we have, \displaystyle f(x) = - \frac{32}{\pi^3} \sum_{n=1}^{\infty} \frac{\sin \frac{(2n-1)\pi x}{2}}{(2n-1)^3} Now evaluate at \displaystyle x=1: \displaystyle -1=f(1) = - \frac{32}{\pi^3} \left( 1 - \frac{1}{3^3} + \frac{1}{5^3} - \frac{1}{7^3} + ... \right) Thus, \displaystyle 1 - \frac{1}{3^3} + \frac{1}{5^3} - \frac{1}{7^3} + ... = \frac{\pi^3}{32} 8. Thank you for your replies. I am just haveing a bit of trouble understanding your proceedure. when i have a look at your working, you get this. \displaystyle \frac{L}{\pi n}\cdot x\sin \frac{\pi n x}{L} \big|_0^L - \frac{L}{\pi n}\int_0^L \sin \frac{\pi n x}{L} dx = \frac{L}{\pi^2 n^2}\cos \frac{\pi n x}{L} \big|_0^L = (1-(-1)^n)\cdot \frac{L^2}{\pi^2 n^2} but when i attempt to solve the equation i get \displaystyle \frac{L}{\pi^2 n^2}\cos \frac{\pi n x}{L} \big|_0^L = ((-1)^n-1)\cdot \frac{L}{\pi^2 n^2} Then after multiplying through by the constants out the front i get \displaystyle \$$\displaystyle ((-1)^n-1)\cdot \frac{L}{\pi^2 n^2}\cdot -\frac{L}{\pi n}= (1-(-1)^n)\cdot \frac{L^2}{\pi^3 n^3}$

what step did you take from here to get the integral in that form??

Thank you
Elbarto

9. Originally Posted by elbarto
$\displaystyle \frac{L}{\pi n}\cdot x\sin \frac{\pi n x}{L} \big|_0^L - \frac{L}{\pi n}\int_0^L \sin \frac{\pi n x}{L} dx = \frac{L}{\pi^2 n^2}\cos \frac{\pi n x}{L} \big|_0^L = (1-(-1)^n)\cdot \frac{L^2}{\pi^2 n^2}$
Look at the first term,
$\displaystyle \frac{L}{\pi n}x\sin \frac{\pi n x}{L} \big|_0^L$
Evaluate,
$\displaystyle \frac{L}{\pi n}\cdot L \cdot\sin \frac{\pi n L}{L} - 0$
But,
$\displaystyle \frac{L}{\pi n}\cdot L \cdot\sin \frac \pi n = 0$
Because $\displaystyle \sin \pi n =0$.

Look at the second term,
$\displaystyle -\frac{L}{\pi n}\int_0^L \sin \frac{\pi n x}{L} dx = \frac{L}{\pi n} \frac{L}{\pi n} \cos \frac{\pi n x}{L}\big|_0^L = \frac{L^2}{\pi^2n^2} (-1)^n - \frac{L^2}{\pi^2 n^2}$

10. Once again thank you for your reply. I still couldn't find the same solution so i used my integral tables rather then useing integration by parts. This is what i keep getting

$\displaystyle$
$\displaystyle b_n=-\frac{4L^2} {n^3\pi^3}[(-1)^n-1]$

Is there a possibility that you missed a negative sign in your integrals? i graphed my solution and it appears to work.

I have attached a copy of my spread sheet if you could have a look at it?

Regards
Elbarto

11. I do not have Excel on the computer I am using. Nor have I ever used excel in my life. If you can do:
n=10,20,50,100
And post them as screenshots I would love to see that.
I think the animation of how a Fourier Series converges to the function is beautiful to watch.