Solving a Differential Equation with a Fourier Series

In summary: You're a lifesaver.In summary, the problem was to find the Fourier Series for a function f(x) with a piecewise definition. The solution involved finding the a0, an, and bn coefficients using integration, and then using those coefficients to write out the Fourier series approximation for the function. The final answer for the series was given and confirmed, and plots were provided to show the accuracy of the approximation. Overall, the problem was solved successfully with the help of an expert.
  • #1
VinnyCee
489
0
I am not sure I am doing this correctly, so here it is.

Problem:

Find the Fourier Series

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

Answer(supposedly):

[tex]a_0\,=\,\frac{\pi^3}{3}[/tex]

[tex]a_n\,=\,-\frac{2}{n^2}[/tex]

[tex]b_n\,=\,\frac{4\,-\,n^2\,\pi^2}{n^3\,\pi}[/tex]

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

[tex]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][/tex]

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

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

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

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

[tex]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}[/tex]

Right? Then:

[tex]a_n\,=\,-\frac{2}{n^2}[/tex]

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

[tex]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}[/tex]

[tex]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][/tex]

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

Which one is correct?
 
  • #5
I think I see several sign mistakes, with the last sign being wrong. Why not reduce the last expression n/n^3??
 
  • #6
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
 
  • #7
Is this the correct an then?

Is the term below right for an?

[tex]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}[/tex]

Thanks again!
 
  • #8
You got an extra negative. [itex]\cos{n\pi} = (-1)^n[/itex], which we can verify by noting that when n = 0, [itex]n\pi = 0[/itex], so [itex]\cos{n\pi} = 1[/itex]. 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
 
  • #9
So, the an is:

[tex]a_n\,=\,\frac{2\,(-1)^n}{n^2}[/tex]

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!

[tex]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}[/tex]

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

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

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: 437
  • #13
Awesome plots.

Thanks a lot for the help.
 

1. What is a differential equation?

A differential equation is an equation that involves derivatives of an unknown function. It is used to model various physical phenomena and can be solved to find the function that satisfies the equation.

2. What is a Fourier series?

A Fourier series is a representation of a periodic function as a sum of sine and cosine functions with different frequencies and amplitudes. It can be used to approximate non-periodic functions as well.

3. How can a Fourier series be used to solve a differential equation?

A Fourier series can be used to solve a differential equation by representing the unknown function as a Fourier series and substituting it into the equation. This will result in an infinite series of equations, which can then be solved for the coefficients of the Fourier series.

4. What are the benefits of using a Fourier series to solve a differential equation?

Using a Fourier series to solve a differential equation can provide an exact solution for certain types of equations and can also provide a good approximation for other types of equations. It can also simplify the process of solving differential equations, as it involves solving a system of linear equations rather than a complicated differential equation.

5. Are there any limitations to using a Fourier series to solve a differential equation?

Yes, there are some limitations to using a Fourier series to solve a differential equation. It is only applicable for equations with constant coefficients and for certain types of boundary conditions. It may also not provide an accurate solution for highly nonlinear equations or for functions with discontinuities.

Similar threads

  • Introductory Physics Homework Help
Replies
8
Views
982
  • Introductory Physics Homework Help
Replies
3
Views
121
  • Introductory Physics Homework Help
Replies
28
Views
221
  • Calculus and Beyond Homework Help
Replies
1
Views
56
  • Calculus and Beyond Homework Help
Replies
1
Views
454
  • Introductory Physics Homework Help
Replies
7
Views
612
  • Introductory Physics Homework Help
Replies
5
Views
384
  • Introductory Physics Homework Help
Replies
6
Views
207
  • Topology and Analysis
Replies
4
Views
192
  • Calculus and Beyond Homework Help
Replies
16
Views
435
Back
Top