Solving a Differential Equation with a Fourier Series

Click For Summary

Homework Help Overview

The discussion revolves around finding the Fourier series for a piecewise function defined on the interval from -π to π, specifically focusing on the calculation of the coefficients a₀, aₙ, and bₙ. Participants are exploring the correctness of their calculations and interpretations related to Fourier series representation.

Discussion Character

  • Mathematical reasoning, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants share their calculations for the Fourier coefficients and question the correctness of their results. There are discussions on the derivation of a₀, aₙ, and bₙ, with some participants suggesting alternative methods and questioning signs in the expressions.

Discussion Status

The discussion is active, with participants providing feedback on each other's calculations. Some have offered corrections regarding signs and terms in the coefficients, while others are confirming their understanding of the Fourier series components. There is no explicit consensus yet on the final forms of the coefficients.

Contextual Notes

Participants are working under the constraints of a homework assignment, which may limit the information they can share or the methods they can use. There are indications of uncertainty regarding the behavior of sine and cosine functions in the context of the Fourier series.

VinnyCee
Messages
486
Reaction score
0
I am not sure I am doing this correctly, so here it is.

Problem:

Find the Fourier Series

f(s)\,=\,\left\{\begin{array}{ccc}x^2&-\pi\,<\,x\,<\,0\\0 &0\,<x\,<\,\pi \\}\end{array}\right

Answer(supposedly):

a_0\,=\,\frac{\pi^3}{3}

a_n\,=\,-\frac{2}{n^2}

b_n\,=\,\frac{4\,-\,n^2\,\pi^2}{n^3\,\pi}

Does that look right? If so, where do I gofrom here?

f(s)\,\approx\,\frac{\pi^3}{3}\,+\,\sum_{n\,=\,1}^{\infty}\,\left[-\frac{2}{n^2}\,cos(n\,x)\,+\,\frac{4\,-\,n^2\,\pi^2}{n^3\,\pi}\,sin(n\,x)\right]

Is this the final answer?
 
Physics news on Phys.org
Can anyone type this into mathematica?

Please double check :biggrin:
 
Here is how I got the a0, an and bn factors

a_0\,=\,\frac{1}{\pi}\,\int_{-\pi}^{0}\,x^2\,dx\,=\,\frac{\pi^2}{3}

a_n\,=\,\frac{1}{\pi}\,\int_{-\pi}^{0}\,x^2\,cos\,(n\,x)\,dx

a_n\,=\,\frac{1}{\pi}\,\left[\frac{x^2\,sin\,(n\,x)}{n}\,+\,\frac{2\,x\,cos\,(n\,x)}{n^2}\,-\,\frac{2\,sin\,(n\,x)}{n^3}\right]_{-\pi}^{0}

Right? Then:

a_n\,=\,-\frac{2}{n^2}

Am I on the right track here? or am i completely missing something?
 
Last edited:
Or is this how to solve a_n?

a_n\,=\,\frac{1}{\pi}\,\int_{-\pi}^{0}\,x^2\,cos\,(n\,x)\,dx\,=\,\frac{1}{\pi}\,\left[\frac{n^2\,x^2\,sin\,(n\,x)\,-\,2\,sin\,(n\,x)\,+\,2\,n\,x\,cos\,(n\,x)}{n^3}\right]_{-\pi}^{0}

a_n\,=\,\frac{1}{\pi}\,\left[\frac{(-\pi)^2\,n^2\,sin\,(-\pi\,n)\,-\,2\,sin\,(-\pi\,n)\,-\,2\,\pi\,n\,cos\,(-\pi\,n)}{n^3}\right]\,=\,\frac{1}{\pi}\,\left[\frac{2\,\pi\,n\,cos\,(-\pi\,n)}{n^3}\right]

a_n\,=\,\frac{1}{\pi}\,\left[\frac{-2\,\pi\,n\,(-1)^n}{n^3}\right]\,=\,\frac{-2\,n\,(-1)^n}{n^3}

Which one is correct?
 
I think I see several sign mistakes, with the last sign being wrong. Why not reduce the last expression n/n^3??
 
You need to revisit your bn with your newly refound knowledge of the behavior of sine and cosine.

The sign of your an term is indeed incorrect.

Why do I let myself get dragged into other people's problems? *sighs* Back to finals! Work, damn me!

--J
 
Is this the correct an then?

Is the term below right for an?

a_n\,=\,\frac{1}{\pi}\,\left[\frac{-2\,\pi\,n\,(-1)^n}{n^3}\right]\,=\,\frac{-2\,n\,(-1)^n}{n^3}\,=\,-\frac{2\,(-1)^n}{n^2}

Thanks again!
 
You got an extra negative. \cos{n\pi} = (-1)^n, which we can verify by noting that when n = 0, n\pi = 0, so \cos{n\pi} = 1. Additionally, when n = 1, we just have cosine of pi, which is -1. So we must have (-1)n instead of (-1)n-1.

--J
 
So, the an is:

a_n\,=\,\frac{2\,(-1)^n}{n^2}

Right?
 
  • #10
Looks good. Now go have another look at those b coefficients.

--J

Just one final left... Yay me!
 
  • #11
Now for the bn!

b_n\,=\,\frac{1}{\pi}\,\int_{-\pi}^{0}\,x^2\,sin\,(n\,x)\,dx\,=\,\frac{1}{\pi}\,\left[\frac{-n^2\,x^2\,cos\,(n\,x)\,+\,2\,cos\,(n\,x)\,2\,n\,x\,sin\,(n\,x)}{n^3}\right]_{-\pi}^{0}

b_n\,=\,\frac{1}{\pi}\,\left[\frac{2}{n^3}\,+\,\frac{\pi^2\,(-1)^n}{n}\,-\,\frac{2\,(-1)^n}{n^3}\right]

b_n\,=\,\frac{2}{\pi\,n^3}\,+\,\frac{\pi\,(-1)^n}{n}\,-\,\frac{2\,(-1)^n}{\pi\,n^3}

Does that look right also?

Good luck on the final! I feel for you man.
 
  • #12
Looks like you got it.

And just in case you were interested, here's some plots of the Fourier series truncated to 5, 15, 50, and 500 terms. Can't even tell it's not the function itself in the 500 one, can ya'?

Good job.

--J
 

Attachments

  • Fourier.JPG
    Fourier.JPG
    12.8 KB · Views: 527
  • #13
Awesome plots.

Thanks a lot for the help.
 

Similar threads

Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
2
Views
1K
Replies
3
Views
1K
Replies
28
Views
2K
Replies
8
Views
1K
  • · Replies 7 ·
Replies
7
Views
840
  • · Replies 12 ·
Replies
12
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K