Fourier series (cosine series expansion?)

Click For Summary

Homework Help Overview

The discussion revolves around finding the Fourier series of a specific 2Pi-periodic function defined piecewise. The function is zero between -Pi/2 and Pi/2, and takes the form of Abs(x) - Pi/2 for values between Pi/2 and Pi. Participants are exploring the coefficients a_0, a_n, and b_n, particularly focusing on the even nature of the function and implications for the Fourier series expansion.

Discussion Character

  • Exploratory, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Participants discuss the calculation of Fourier coefficients, particularly a_0 and a_n, and the implications of the function's evenness on b_n. There are attempts to simplify expressions for a_n based on periodicity and modular arithmetic. Questions arise regarding the behavior of cosine terms for different values of n, and whether there are more elegant ways to express the series.

Discussion Status

Several participants have shared their calculations and insights, leading to a variety of expressions for a_n based on different cases. There is recognition of periodicity in the coefficients, and some participants are working towards a more concise representation of the Fourier series. While there is no explicit consensus, productive dialogue is ongoing regarding the evaluation of coefficients and the implications for further calculations.

Contextual Notes

Participants note discrepancies in their calculations of a_0 and the area under the curve, leading to discussions about the correct application of formulas. There is also mention of attachments that may provide visual clarification, pending approval.

wahoo2000
Messages
37
Reaction score
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
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.
 
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,912
  • series.JPG
    series.JPG
    7.5 KB · Views: 764
Last edited:
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.
 
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)
 
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]
 
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.
 
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...
 
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
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K