Find Fourier Series for Piecewise Function

  • MHB
  • Thread starter Dustinsfl
  • Start date
  • Tags
    Fourier
In summary, the Fourier series for a function $g(\theta)$ is$$\frac{\pi}{2} - 2\sum_{n = 1}^{\infty}\frac{1}{2n}\sin(2n)\theta.
  • #1
Dustinsfl
2,281
5
Find the Fourier series for
$$
f(\theta) = \begin{cases}
\theta, & 0\leq \theta \leq\pi\\
\pi + \theta, & -\pi\leq \theta < 0
\end{cases}.
$$

$$
a_0 = \frac{1}{\pi}\int_0^{\pi}\theta d\theta + \frac{1}{\pi}\int_{-\pi}^0\theta d\theta + \int_{-\pi}^0 d\theta
$$
The first and second integral together are 0 so the $a_0 = \pi$
$$
a_n = \frac{1}{\pi}\int_0^{\pi}\theta\cos n\theta d\theta + \frac{1}{\pi}\int_{-\pi}^0\theta\cos n\theta d\theta + \int_{-\pi}^0 \cos n\theta d\theta
$$
The first and second integral together are 0 so the $a_n = 0$
$$
b_n = \frac{1}{\pi}\int_0^{\pi}\theta\sin n\theta d\theta + \frac{1}{\pi}\int_{-\pi}^0\theta\sin n\theta d\theta + \int_{-\pi}^0\sin n\theta d\theta
$$
The first and second integral together are 0 so the $b_n = \begin{cases}\frac{-2}{n}, & \text{if n is odd}\\0, & \text{if n is even}\end{cases}$

So
$$
\frac{\pi}{2} - 2\sum_{n = 1}^{\infty}\frac{1}{2n-1}\sin(2n - 1)\theta
$$

Correct?
 
Physics news on Phys.org
  • #2
dwsmith said:
$$
b_n = \frac{1}{\pi}\int_0^{\pi}\theta\sin n\theta d\theta + \frac{1}{\pi}\int_{-\pi}^0\theta\sin n\theta d\theta + \int_{-\pi}^0\sin n\theta d\theta
$$
The first and second integral together are 0 so the $b_n = \begin{cases}\frac{-2}{n}, & \text{if n is odd}\\0, & \text{if n is even}\end{cases}$

So
$$
\frac{\pi}{2} - 2\sum_{n = 1}^{\infty}\frac{1}{2n-1}\sin(2n - 1)\theta
$$

Correct?

Hi dwsmith, :)

I think you have made a little error. As you can see \(g(\theta)=\theta\sin n\theta=g(-\theta)\). Therefore \(g\) is an even function. Hence,

\[b_n = \frac{1}{\pi}\int_0^{\pi}\theta\sin n\theta d\theta + \frac{1}{\pi}\int_{-\pi}^0\theta\sin n\theta d\theta + \int_{-\pi}^0\sin n\theta d\theta= \frac{2}{\pi}\int_0^{\pi}\theta\sin n\theta d\theta + \int_{-\pi}^0\sin n\theta d\theta\]

Kind Regards,
Sudharaka.
 
  • #3
So the Fourier series is
$$
\frac{\pi}{2} - 2\sum_{n = 1}^{\infty}\frac{1}{2n}\sin(2n)\theta.
$$
 
  • #4
dwsmith said:
So the Fourier series is
$$
\frac{\pi}{2} - 2\sum_{n = 1}^{\infty}\frac{1}{2n}\sin(2n)\theta.
$$
Correct! You can check that this formula works by using the excellent Desmos graphing application that now comes for free with MathHelpBoards. See the graph below. In fact, click on the graph and you will see the formula used to generate it. Use the slider to see the sum of up to 20 terms of this Fourier series, and notice how it converges to the midpoint of each jump in the graph.

[graph]ymrd1ovgce[/graph]
 
  • #5


Yes, your calculations for the Fourier coefficients are correct. The final expression for the Fourier series is also correct. Great job!
 

FAQ: Find Fourier Series for Piecewise Function

What is a Fourier Series for a piecewise function?

A Fourier Series is a way to represent a periodic function as an infinite sum of sine and cosine functions. A piecewise function is a function that is defined differently for different intervals. Therefore, a Fourier Series for a piecewise function is an infinite sum of sine and cosine functions that represents the different intervals of the piecewise function separately.

How is a Fourier Series calculated for a piecewise function?

To calculate a Fourier Series for a piecewise function, the function must first be broken down into its separate intervals. Then, for each interval, the coefficients of the sine and cosine functions can be calculated using integration. Finally, the coefficients are used to construct the Fourier Series for the entire piecewise function.

Can a Fourier Series be found for any piecewise function?

Yes, a Fourier Series can be found for any piecewise function as long as the function is periodic. However, the calculation process may be more complicated for more complex piecewise functions.

What is the purpose of finding a Fourier Series for a piecewise function?

The main purpose of finding a Fourier Series for a piecewise function is to simplify the representation of the function. Instead of dealing with a complex piecewise function, we can use a simpler Fourier Series to analyze and manipulate the function.

Are there any limitations to using a Fourier Series for a piecewise function?

One limitation of using a Fourier Series for a piecewise function is that it may not be an accurate representation of the function at points where the function is discontinuous. Additionally, the convergence of the Fourier Series may be affected by the complexity of the piecewise function.

Similar threads

Replies
4
Views
1K
Replies
4
Views
2K
Replies
4
Views
2K
Replies
8
Views
2K
Replies
29
Views
2K
Replies
1
Views
2K
Back
Top