Fourier series example solution
|

Fourier series example solution

Let’s work through an example of finding the Fourier series for a specific function. We’ll use a simple function to illustrate the process: ( f(x) = x ) over the interval ([- \pi, \pi]).

Step-by-Step Solution

1. Function and Interval:

We want to find the Fourier series for ( f(x) = x ) in the interval ([- \pi, \pi]).

2. Fourier Series Formula:

The Fourier series of a function ( f(x) ) with period ( 2\pi ) is given by:

[ f(x) = a_0 + \sum_{n=1}^\infty \left[ a_n \cos(nx) + b_n \sin(nx) \right] ]

where the Fourier coefficients are calculated as follows:

  • Average (DC Component) ( a_0 ): [ a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \, dx ]
  • Cosine Coefficients ( a_n ): [ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos(nx) \, dx ]
  • Sine Coefficients ( b_n ): [ b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin(nx) \, dx ]

3. Compute ( a_0 ):

[a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi} x \, dx]

Since ( x ) is an odd function and the interval is symmetric about the origin, the integral of an odd function over a symmetric interval is zero:

[a_0 = \frac{1}{\pi} \left[ \frac{x^2}{2} \right]_{-\pi}^{\pi} = \frac{1}{\pi} \left( \frac{\pi^2}{2} - \frac{\pi^2}{2} \right) = 0]

4. Compute ( a_n):

[a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} x \cos(nx) \, dx]

To solve this integral, use integration by parts. Let ( u = x ) and ( dv = \cos(nx) \, dx ). Then ( du = dx ) and ( v = \frac{\sin(nx)}{n} ):

[\int x \cos(nx) \, dx = x \cdot \frac{\sin(nx)}{n} - \int \frac{\sin(nx)}{n} \, dx]

[= \frac{x \sin(nx)}{n} + \frac{1}{n^2} \cos(nx)]

Evaluating from (-\pi) to (\pi):

[\left[ \frac{x \sin(nx)}{n} \right]<em>{-\pi}^{\pi} + \frac{1}{n^2} \left[ \sin(nx) \right]</em>{-\pi}^{\pi}]

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

Since (\sin(n\pi) = 0), this simplifies to:

[a_n = \frac{2(-1)^{n+1}}{n}]

5. Compute ( b_n ):

[b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} x \sin(nx) \, dx]

Again, using integration by parts. Let ( u = x ) and ( dv = \sin(nx) \, dx ). Then ( du = dx ) and ( v = -\frac{\cos(nx)}{n} ):

[\int x \sin(nx) \, dx = -\frac{x \cos(nx)}{n} - \int -\frac{\cos(nx)}{n} \, dx]

[= -\frac{x \cos(nx)}{n} + \frac{1}{n^2} \sin(nx)]

Evaluating from (-\pi) to (\pi):

[\left[ -\frac{x \cos(nx)}{n} \right]<em>{-\pi}^{\pi} + \frac{1}{n^2} \left[ \sin(nx) \right]</em>{-\pi}^{\pi}]

Since (\sin(n\pi) = 0) and (\cos(n\pi) = (-1)^n), this simplifies to:

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

6. Construct the Fourier Series:

Putting it all together, the Fourier series for ( f(x) = x ) is:

[f(x) = \sum_{n=1}^\infty \frac{2 (-1)^{n+1}}{n} \sin(nx)]

This series represents the function ( f(x) = x ) in terms of its sine components.


Discover more from Science blog by awjunaid

Subscribe to get the latest posts sent to your email.

Leave a Reply