MHB Sine fourier series with period 1

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

I want to find the Fourier series of $f(x)=x, 0 \leq x<1$. It is a series with period $1$.

In our case, the function is odd. So in order to find the Fourier series, we would find the odd extension of $f$ and then use the following formulas:

$a_n=0 , \ \ \forall n \geq 0$

$b_n=\frac{2}{L} \int_0^L f(x) \sin{\frac{n \pi x}{L}} dx$And then the Fourier series is this: $f(x)=\sum_{n=1}^{\infty} b_n \sin{\frac{n \pi x}{L}}$.

But in our case , the period should be $1$ and so $L$ is equal to $\frac{1}{2}$.

But how can we then define the extension of $f$ ? (Thinking)
 
Physics news on Phys.org
Hey evinda! (Smile)

We can only make it odd with period 1 if we subtract $\frac 12$.
That is:
$$g(x)=\begin{cases} x-\frac 12, & 0 < x < \frac 12 \\ x + \frac 12, & -\frac 12 \le x < 0\end{cases}$$

It would still be the same function, just shifted.
 
I like Serena said:
Hey evinda! (Smile)

We can only make it odd with period 1 if we subtract $\frac 12$.
That is:
$$g(x)=\begin{cases} x-\frac 12, & 0 < x < \frac 12 \\ x + \frac 12, & -\frac 12 \le x < 0\end{cases}$$

It would still be the same function, just shifted.

And then if we add $\frac{1}{2}$ to the Fourier series that we will get, will we get the Fourier series for $f$ ? If so, why does this hold? (Thinking)
 
evinda said:
And then if we add $\frac{1}{2}$ to the Fourier series that we will get, will we get the Fourier series for $f$ ? If so, why does this hold? (Thinking)

Let's take a look at the graphs:

\begin{tikzpicture}[scale=2]
\draw[help lines] (-2,-1) grid (4,1);
\draw[<->] (-2.4,0) -- (4.4,0) node[above] {$x$-axis};
\draw[<->] (0,-1.2) -- (0,1.2) node
{$y$-axis};
\draw foreach \i in {-2,...,4} { (\i,0.1) -- (\i,-0.1) node[below] {$\i$} };
\draw foreach \i in {-1,...,1} { (0.1,\i) -- (-0.1,\i) node
{$\i$} };
\draw[blue, ultra thick] foreach \i in {-1,...,3} { (\i,0) -- ({\i+1},1) } node
{$f(x)$};
\end{tikzpicture}
\begin{tikzpicture}[scale=2]
\draw[help lines] (-2,-1) grid (4,1);
\draw[<->] (-2.4,0) -- (4.4,0) node[above] {$x$-axis};
\draw[<->] (0,-1.2) -- (0,1.2) node
{$y$-axis};
\draw foreach \i in {-2,...,4} { (\i,0.1) -- (\i,-0.1) node[below] {$\i$} };
\draw foreach \i in {-1,...,1} { (0.1,\i) -- (-0.1,\i) node
{$\i$} };
\draw[red, ultra thick] foreach \i in {-1,...,3} { (\i,-0.5) -- ({\i+1},0.5) } node
{$f(x)-\frac 12$};
\end{tikzpicture}
We can actually also pick this one:
\begin{tikzpicture}[scale=2]
\draw[help lines] (-2,-1) grid (4,1);
\draw[<->] (-2.4,0) -- (4.4,0) node[above] {$x$-axis};
\draw[<->] (0,-1.2) -- (0,1.2) node
{$y$-axis};
\draw foreach \i in {-2,...,4} { (\i,0.1) -- (\i,-0.1) node[below] {$\i$} };
\draw foreach \i in {-1,...,1} { (0.1,\i) -- (-0.1,\i) node
{$\i$} };
\draw[green!70!black, ultra thick] foreach \i in {-1.5,...,2.5} { (\i,-0.5) -- ({\i+1},0.5) } node
{$f(x+\frac 12)-\frac 12$};
\end{tikzpicture}

Don't they really all look the same?
Both the red and the green ones are odd with period 1, so that we can make odd Fourier series for them.
Shift them a bit, and they are identical to the blue one.​
 
I see... I found that $a_n=0 \forall n \geq 0$ and $b_n=\frac{\cos{n \pi}-8 \pi \cos{n \pi}-1}{4 n \pi}$.

Am I right? The solution should be $\frac{1}{2}-\frac{1}{\pi} \sum_{n=1}^{\infty} \frac{\sin{2 n \pi x}}{n}$... (Worried)
 
evinda said:
I see... I found that $a_n=0 \forall n \geq 0$ and $b_n=\frac{\cos{n \pi}-8 \pi \cos{n \pi}-1}{4 n \pi}$.

Am I right? The solution should be $\frac{1}{2}-\frac{1}{\pi} \sum_{n=1}^{\infty} \frac{\sin{2 n \pi x}}{n}$... (Worried)

Let's see...

\begin{aligned}b_n &= \frac 2L \int_0^L \Big(f(x)-\frac 12\Big)\sin\left(\frac{n \pi x}{L}\right)\,dx \\
&= 4 \int_0^{1/2} \Big(x-\frac 12\Big)\sin(2n \pi x)\,dx \\
&= \int_0^{1/2} 4x\sin(2n \pi x)\,dx - \int_0^{1/2} 2\sin(2n \pi x)\,dx \\
&= \int_0^{1/2} \frac{-4x}{2n\pi}\,d(\cos(2n \pi x)) - \frac{-2\cos(2n\pi x)}{2\pi n} \Big|_0^{1/2}\\
&= \frac{-4x}{2n\pi}\cos(2n \pi x) \Big|_0^{1/2} - \int_0^{1/2} \frac{-4}{2n\pi}\cos(2n \pi x)\,dx + \frac{\cos(2n\pi x)}{\pi n}\Big|_0^{1/2} \\
&= \frac{-2x}{n\pi}\cos(2n \pi x) \Big|_0^{1/2} + \frac{\sin(2n \pi x)}{n^2\pi^2}\Big|_0^{1/2} + \frac{\cos(2n\pi x)}{\pi n}\Big|_0^{1/2} \\
&= \frac{(1-2x)\cos(2n \pi x)}{n\pi}\Big|_0^{1/2} + \frac{\sin(2n \pi x)}{n^2\pi^2}\Big|_0^{1/2} \\
&= (0-\frac{1}{n\pi}) + (0-0) \\
&= -\frac{1}{n\pi}
\end{aligned}

So:
$$f(x)-\frac 12 = \sum_{n=1}^\infty -\frac{1}{n\pi} \sin(2n\pi x)$$
(Thinking)
 
I like Serena said:
Let's see...

\begin{aligned}b_n &= \frac 2L \int_0^L \Big(f(x)-\frac 12\Big)\sin\left(\frac{n \pi x}{L}\right)\,dx \\
&= 4 \int_0^{1/2} \Big(x-\frac 12\Big)\sin(2n \pi x)\,dx \\
&= \int_0^{1/2} 4x\sin(2n \pi x)\,dx - \int_0^{1/2} 2\sin(2n \pi x)\,dx \\
&= \int_0^{1/2} \frac{-4x}{2n\pi}\,d(\cos(2n \pi x)) - \frac{-2\cos(2n\pi x)}{2\pi n} \Big|_0^{1/2}\\
&= \frac{-4x}{2n\pi}\cos(2n \pi x) \Big|_0^{1/2} - \int_0^{1/2} \frac{-4}{2n\pi}\cos(2n \pi x)\,dx + \frac{\cos(2n\pi x)}{\pi n}\Big|_0^{1/2} \\
&= \frac{-2x}{n\pi}\cos(2n \pi x) \Big|_0^{1/2} + \frac{\sin(2n \pi x)}{n^2\pi^2}\Big|_0^{1/2} + \frac{\cos(2n\pi x)}{\pi n}\Big|_0^{1/2} \\
&= \frac{(1-2x)\cos(2n \pi x)}{n\pi}\Big|_0^{1/2} + \frac{\sin(2n \pi x)}{n^2\pi^2}\Big|_0^{1/2} \\
&= (0-\frac{1}{n\pi}) + (0-0) \\
&= -\frac{1}{n\pi}
\end{aligned}

So:
$$f(x)-\frac 12 = \sum_{n=1}^\infty -\frac{1}{n\pi} \sin(2n\pi x)$$
(Thinking)

Nice... Thank you! (Yes)
 
Back
Top