Fourier series (cosine series expansion?)

In summary, the Fourier series of the 2Pi-periodic function is f(x)= 0, Abs(x) <= Pi/2{Abs(x)-Pi/2, Pi/2 < Abs(x) <= Pi}My attempt at a solution: I have sketched the function... It equals zero between -Pi/2 and Pi/2 and it equals Pi/2 at -Pi and Pi. Then the pattern is repeated with peaks at +/- Pi, 3Pi, 5Pi...
  • #1
wahoo2000
37
0
Find the Fourier series of the 2Pi-periodic function

f(x)=
{0 , Abs(x) <= Pi/2
{Abs(x)-Pi/2, Pi/2 < Abs(x) <= Pi


My attempt at a solution

I have sketched the function... It equals zero between -Pi/2 and Pi/2 and it equals Pi/2 at -Pi and Pi. Then the pattern is repeated with peaks at +/- Pi, 3Pi, 5Pi...

To find the Fourier series I have to identify a_0, a_n and b_n.
Here, b_n = 0 because the function is even, right?

a_0= (1/(2Pi))*AUC = Pi/8 (AUC=area under curve from -Pi to Pi (i.e. one period))

then a_n = (1/Pi)*integral_-Pi_Pi f(x)*cos(nx) dx= (2/Pi)*integral_0_Pi f(x)*cos(nx) dx (because even function)
= (2/Pi)integral_0_Pi (Abs(x)-Pi/2))*cos(nx) dx = (integration by parts) = (2/(nPi))[(Abs(x)-Pi/2)*sin(nx)] (evaluate for x=Pi minus for x=Pi/2, because the function is zero anyway between 0 and Pi/2 --> integral is zero) - (2/(nPi))*integral_Pi/2_Pi 1*sin(nx) dx

[(Abs(x)-Pi/2)*sin(nx)] (evaluate for x=Pi minus for x=Pi/2) I think is zero so just the last expression left, but I just can't figure it out.

Sorry for the format of this post, I can hardly figure out what I wrote myself so it's a miracle if somebody can help me out of this :) I now saw the "insert image" feature, which will be my choice for the maths next time I post :)
 
Physics news on Phys.org
  • #2
You do need to write it out more neatly, I can't wrap my head around it. At the very least insert some newlines now and then. I worked through the problem and it seemed to just involve some integration by parts and trigonometric integrations. Here are some of my steps:

[tex] f(x)=\frac{a_0}{2}+\Sigma^{\infty}_{n=1}a_{n}cos(nx) [/tex]

[tex] a_n = \frac{1}{\pi}\int^{\pi}_{-\pi}f(x)cos(nx)dx [/tex]

For n>0:

[tex] a_n = \frac{2}{\pi}\int^{\pi}_{\pi/2}(x-\frac{\pi}{2})cos(nx)dx [/tex]

Some terms canceled each other out, and to present the final answer concisely I considered the cases of values of n modulo 4.
 
  • #3
Hope it is easier to follow now with the attached image.
Did you get the same expression for a_n?

Indeed I have to express the a_n consisely...
I know cos(n*Pi) = (-1)^n
but what about the other, cos(n*Pi/2)? Let's call this "?" for now. I have figured out that
n=1 --> 0
n=2 --> -1
n=3 --> 0
n=4 --> 1
n=5--> 0
and so on...

Does this mean that the a_n are different depening on whether n is odd or even?

For odd n: a_n = (2/(Pi*n^2)) * (-1)^n

And for even n: a_n = (2/(Pi*n^2)) * ((-1)^n - "?"))

Then I could of course evaluate a_1, a_2, a_3, ... etc. one by one, but it feels like there is some trick to get the a_n general and good looking...

Edit: Evaluated and plotted the first few terms, it looks "ok" I think? So maybe the calculations are correct so far.
I attach an picture of the Fourier series with those evaluated terms.
I noted that a_4, a_8, a_12 etc == 0
 

Attachments

  • fourier.JPG
    fourier.JPG
    20.3 KB · Views: 1,826
  • series.JPG
    series.JPG
    7.5 KB · Views: 705
Last edited:
  • #4
I can't see your attachments yet because they're awaiting approval, but it looks like you're nearly there. The values of a_n are periodic in n with a period of 4, so essentially you need to find a_0, a_1, a_2 and a_3, and then they repeat. I'll post up my answer shortly.
 
  • #5
I got:

a_n =

0 when n=0 (mod 4)

[tex]-\frac{2}{\pi n^2}[/tex] when n=1,3 (mod 4)

[tex]\frac{4}{\pi n^2}[/tex] when n=2 (mod 4)
 
  • #6
Sweet :) Then I was right! But still, is there some tricky trick so that you can write it more beautiful as
[tex]
f(x)=\frac{a_0}{2}+\Sigma^{\infty}_{n=1}a_{n}cos(n x)
[/tex]
in one expression? Not "a_n ==, if n=1,3,5,7,9,11,13,15... if n=2,6,10,14,18...if n=0,4,8,12,16..."

Maybe the follow up question gives a clue?
It looks like this:

Use the result (from problem above) to calculate the sum
[tex]
\Sigma^{\infty}_{k=0}\frac{1}{(2k+1)^{2}}
[/tex]
 
  • #7
Yes, you could split it into two series for each case where the coefficients are non-zero:

[tex] f(x) = \frac{\pi}{4} + \Sigma^{\infty}_{k=0}(-\frac{2}{\pi(2k+1)^2})cos([2k+1]x) + \Sigma^{\infty}_{k=0}(\frac{4}{\pi(4k+2)^2})cos([4k+2]x)[/tex]

From this form, it should be evident how to solve the next question.
 
  • #8
Thanks a lot! I have kept struggling for a while now, it looks easy but I feel stupid :(

First, a_0/2 in your last answer is Pi/4, but I have Pi/8 in my calculations..

Then the sum... That way of expressing it made it much more clear; I think that the approach is to eliminate the "last" sum

[tex]
\Sigma^{\infty}_{k=0}(\frac{4}{\pi(4k+2)^2})cos([4k+2]x)
[/tex]
which means that cos([4k+2]x)=0, which corresponds to [4k+2]x=Pi/2 ==> x = Pi/4

So I take x = Pi/4
[tex]
f(\frac{\pi}{4})= 0[/tex]

but then I am just getting confused by the [tex]
cos([2k+1]*\frac{\pi}{4})}
[/tex] which is sqrt(1/2) or -sqrt(1/2) for different k's...
 
  • #9
You're making it more complicated than it has to be... notice that the coefficients of the second series are 1/(4k+2)^2 = 1 / 4(2k+1)^2. So you don't have to eliminate the second series. The coefficients inside the cosines are respectively odd multipliers of x and even multipliers of x. What value of x would give a constant value for each cosine, so that you could take the cosines outside the series?

Regarding a_0, you used the formula a_0= (1/(2Pi))*AUC. I believe that should be a_0= (1/(Pi))*AUC, which gives my answer.
 
  • #10
Thanks a lot! I thought of x=0 before, but I could not find that way of rewriting the second sum!
Back to a_0... I think that the "sum" should be pi^2/8 which goes together with "my" a_0...

Here is how I did it

[tex]
a_0 = \frac{1}{\pi}\int^{-\pi}_{\pi}f(x)dx =\frac{2}{\pi}\int^{\pi/2}_{\pi}(x-\frac{\pi}{2})dx =\frac{\pi}{4}
[/tex]
 
  • #11
You're right, the answer is [tex]\frac{\pi^2}{8}[/tex]. I forgot to divide a_0 by two :P
 

1. What is a Fourier series?

A Fourier series is a mathematical representation of a periodic function as a sum of sinusoidal functions. It is used to approximate a function by decomposing it into simpler trigonometric functions.

2. What are the applications of Fourier series?

Fourier series are widely used in signal processing, image and sound compression, and solving differential equations. They also have applications in physics, engineering, and other fields where periodic phenomena occur.

3. How is a Fourier series calculated?

The coefficients of a Fourier series can be calculated using integration or using a series of trigonometric identities. The series can also be approximated using numerical methods.

4. What is the difference between a cosine series and a Fourier series?

A cosine series is a type of Fourier series where only cosine functions are used in the decomposition. A Fourier series can include both sine and cosine functions in its representation.

5. What is the significance of the Fourier series expansion?

The Fourier series expansion allows us to represent a wide range of periodic functions using a finite set of simpler functions. This simplifies the analysis and manipulation of periodic functions in various applications.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
283
  • Calculus and Beyond Homework Help
Replies
1
Views
214
  • Calculus and Beyond Homework Help
Replies
1
Views
285
  • Calculus and Beyond Homework Help
Replies
1
Views
341
  • Calculus and Beyond Homework Help
Replies
16
Views
561
  • Calculus and Beyond Homework Help
Replies
3
Views
414
  • Calculus and Beyond Homework Help
Replies
1
Views
535
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
Back
Top