Fourier Serries - Integration Help

• May 26th 2007, 07:28 PM
elbarto
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
• May 26th 2007, 07:43 PM
ThePerfectHacker
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.
• May 26th 2007, 07:56 PM
elbarto
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.
• May 26th 2007, 07:59 PM
ThePerfectHacker
$\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 $a_0$ and the cosine terms $a_n = 0 \mbox {for }n\geq 1$.

That means we simply need to find,
$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 $f(x) = x(L-x)$ on $[0,L]$.

$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,

$\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.
• May 26th 2007, 09:24 PM
elbarto
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

$
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
• May 27th 2007, 07:11 AM
ThePerfectHacker
I check the first one again and it was correct.
Let me just do the second one.

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

$-\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: $\int_0^L x \cos \frac{\pi n x}{L} dx$

$\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}$

$(-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} =$ $\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 $b_n$ terms are (do not forget the factor outside the integral):

$\frac{2(-1)^{n+1}L^2}{\pi n} - \frac{2}{L} \cdot c_n$ where $c_n$ are desribed in that box.

Now consider even and odd terms:
$\mbox{Even}: \frac{-2L^2}{\pi n} + \frac{2}{L} \cdot \frac{L^3}{\pi n} = 0$
$\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:
$- \frac{4L^3}{\pi^3 n^3}$
• May 27th 2007, 07:39 AM
ThePerfectHacker
The function periodically extended as a half-range sine expansion has the following sum:

$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}$ $- \frac{4L^3}{5^3\pi^3} \sin \frac{5\pi x}{L} - ... =$ $-\frac{4L^3}{ \pi^3} \sum_{n=1}^{\infty} \frac{\sin\frac{(2n-1) \pi x}{L}}{(2n-1)^3}$

If $L=2$ we have,

$f(x) = - \frac{32}{\pi^3} \sum_{n=1}^{\infty} \frac{\sin \frac{(2n-1)\pi x}{2}}{(2n-1)^3}$

Now evaluate at $x=1$:

$-1=f(1) = - \frac{32}{\pi^3} \left( 1 - \frac{1}{3^3} + \frac{1}{5^3} - \frac{1}{7^3} + ... \right)$

Thus,

$1 - \frac{1}{3^3} + \frac{1}{5^3} - \frac{1}{7^3} + ... = \frac{\pi^3}{32}$
• May 27th 2007, 09:09 PM
elbarto
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.

$\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

$\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

$\$ $
((-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
• May 28th 2007, 07:24 AM
ThePerfectHacker
Quote:

Originally Posted by elbarto
$\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,
$\frac{L}{\pi n}x\sin \frac{\pi n x}{L} \big|_0^L$
Evaluate,
$\frac{L}{\pi n}\cdot L \cdot\sin \frac{\pi n L}{L} - 0$
But,
$\frac{L}{\pi n}\cdot L \cdot\sin \frac \pi n = 0$
Because $\sin \pi n =0$.

Look at the second term,
$-\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}$
• May 29th 2007, 01:15 AM
elbarto
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

$
$
$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
• May 30th 2007, 03:15 PM
ThePerfectHacker
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.