determine the Fourier series for the following function

2.3k Views Asked by At

determine the Fourier series for the function up to n= 3

given that $$f(t) = \begin{cases}-2 & \text{ if }\quad-\pi < t < -\frac{\pi}{2}\\ 0 & \text{ if }\quad -\frac{\pi}{2} < t < 0\\ 3 & \text{ if }\quad \quad\ 0 < t < \pi\end{cases}$$

any help with this will be greatly appreciated

OP: Is this the intended function?

1

There are 1 best solutions below

0
On BEST ANSWER

The Fourier Series of the function $f$ is given by:

$$f(t) = \frac{1}{2}a_0 + \sum_{n=1}^\infty a_n \cos(n t) + \sum_{n=1}^\infty b_n \sin(n t)$$ where \begin{align*} a_0 &= \frac{1}{\pi} \int_{-\pi}^\pi f(t)\text{d}t\\ a_n &= \frac{1}{\pi} \int_{-\pi}^\pi f(t)\cos(nt)\text{d}t\\ b_n &= \frac{1}{\pi} \int_{-\pi}^\pi f(t)\sin(nt)\text{d}t \end{align*}

You can treat these simply as formulas to follow through on to compute the Fourier Series, but there is a bit more structure involved. Mathematically speaking, we can think of this as a decomposition of $f$ along an orthogonal basis of $L^1([-\pi,\pi])$, namely, the basis $\{1\} \cup \{\cos(nt)\, | \, n\in \mathbb{N}\} \cup \{\sin(nt)\, | \, n\in \mathbb{N}\}$. In other words, we project $f(t)$ onto the basis chosen basis element ($1$, $\cos(nt)$, $\sin(nt)$ for some $n$), and then summing over all basis elements (summing over all $n$), we get the desired Fourier Series, which is almost everywhere equal to the function.

I will show a couple sample calculations for $a_0$, $a_1$, $b_1$, and let you take it from there, for the function $$f(t) = \begin{cases}-2 & \text{ if }\quad-\pi < t < -\frac{\pi}{2}\\ 0 & \text{ if }\quad -\frac{\pi}{2} < t < 0\\ 3 & \text{ if }\quad \quad\ 0 < t < \pi\end{cases}$$

First, $a_0$:

\begin{align*} a_0 &= \frac{1}{\pi} \int_{-\pi}^\pi f(t)\text{d}t\\ &= \frac{1}{\pi} \left(\int_{-\pi}^{-\frac{\pi}{2}}(-2)\, \text{d}t + \int_{0}^\pi 3\,\text{d}t \right)\\ &= \frac{1}{\pi}\left(-2\frac{\pi}{2} + 3\pi \right)\\ &= 2 \end{align*}

Now, onto $a_1$:

\begin{align*} a_1 &= \frac{1}{\pi} \int_{-\pi}^\pi f(t)\cos(t)\text{d}t\\ &= \frac{1}{\pi} \left(\int_{-\pi}^{-\frac{\pi}{2}}(-2)\cos(t)\, \text{d}t + \int_{0}^\pi 3\cos(t)\,\text{d}t \right)\\ &= \frac{1}{\pi}\left(\left.-2\sin(t)\right|_{-\pi}^\frac{\pi}{2} + \left.3\sin(t)\right|_{0}^\pi \right)\\ &= \frac{1}{\pi}\left(2 + 0\right)\\ &= \frac{2}{\pi} \end{align*}

And now onto $b_1$:

\begin{align*} b_1 &= \frac{1}{\pi} \int_{-\pi}^\pi f(t)\sin(t)\text{d}t\\ &= \frac{1}{\pi} \left(\int_{-\pi}^{-\frac{\pi}{2}}(-2)\sin(t)\, \text{d}t + \int_{0}^\pi 3\sin(t)\,\text{d}t \right)\\ &= \frac{1}{\pi}\left(\left.2\cos(t)\right|_{-\pi}^\frac{\pi}{2} + \left.(-3)\cos(t)\right|_{0}^\pi \right)\\ &= \frac{1}{\pi}\left(2 + 6\right)\\ &= \frac{8}{\pi} \end{align*}

The other computations are going to go similarly. To do these more generally, you follow this same template. Namely, you split the integral up into integrals over intervals on which the piecewise function is defined by a specific function (so that we can compute the integrals separately, then add them up to compute each of the coefficients).

And once you have the coefficients $a_0$, $a_n$, $b_n$, plug them into the formula you are given to finish.


One quick remark about the $L$ question. $L$ is half the interval length (in this example, it is $\pi$), and with that in mind, if we are given a function $f$ defined piecewise on $[-L,L]$, then we can still write the Fourier Series: $$f(t) = \frac{1}{2}a_0 + \sum_{n=1}^\infty a_n \cos\left(\frac{n\pi t}{L}\right) + \sum_{n=1}^\infty b_n \sin\left(\frac{n\pi t}{L} \right)$$ where \begin{align*} a_0 &= \frac{1}{L} \int_{-L}^L f(t)\text{d}t\\ a_n &= \frac{1}{L} \int_{-L}^L f(t)\cos\left(\frac{n\pi t}{L}\right)\text{d}t\\ b_n &= \frac{1}{L} \int_{-L}^L f(t)\sin\left(\frac{n\pi t}{L}\right)\text{d}t \end{align*}

If the function was defined instead on $[a,b]$, we can translate the function to a function defined on $\left[-\frac{b-a}{2}, \frac{b-a}{2} \right]$ and repeat this process using $L = \frac{b-a}{2}$, before translating each term of the series back to $[a,b]$ (and hence translating the entire series, and hence the function, back to the original interval).


Look this over, take some time to make sure you understand what I did, and let me know if you have any other questions.