0

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?

simon
  • 3
  • 2
    What is $f$? Is it supposed to read $$f(t) = \begin{cases}-2 & \text{ if }-\pi \leq t \leq \pi\ 0 & \text{ otherwise}\end{cases}$$ instead? What have you tried? – Nicholas Stull Apr 29 '14 at 15:07
  • 1
    Welcome to Math.SE! This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level. – Joe Tait Apr 29 '14 at 15:21
  • it would show me the full thing in editing but would not display it in the question not sure why – simon Apr 29 '14 at 17:19
  • Is the function currently appearing the intended one? Even so, it would be helpful if you let us know what exactly you had tried. – Nicholas Stull Apr 29 '14 at 17:24
  • the function appearing is the correct one, have tried to understand Fourier series online and just getting confused at the moment firstly I don't know where a value for L comes from cant see it in the question and cant yet wrap my head around how to do it, think I've either hit a mental block or I'm missing something else been a long time since I've been this stuck, also I'm doing engineering which has differences – simon Apr 29 '14 at 17:33

1 Answers1

0

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.