Question

# Suppose f has period 2 and f(x) = x for 0 \leq x&lt.2. Find the fourth-degree Fourier polynomial and graph it on 0 \leq x&lt.2.

Polynomial graphs

Suppose f has period 2 and f(x) = x for $$0\leq x<2$$. Find the fourth-degree Fourier polynomial and graph it on $$0\leq x<2$$

2021-08-10

Step 1
The given function
$$\displaystyle{f{{\left({x}\right)}}}={x},{0}\leq{x}{<}{2}$$
Since we know the general expression of Fourier series for f on $$\displaystyle{\left[-{\frac{{{b}}}{{{2}}}},{\frac{{{b}}}{{{2}}}}\right]}$$ is
$$\displaystyle{a}_{{{0}}}+{\sum_{{{k}={1}}}^{{\infty}}}{a}_{{{k}}}{\cos{{\left({\frac{{{2}\pi{k}{x}}}{{{b}}}}\right)}}}+{\sum_{{{k}={1}}}^{{\infty}}}{b}_{{{k}}}{\sin{{\left({\frac{{{2}\pi{k}{x}}}{{{b}}}}\right)}}}$$
Where constant expressed as
$$\displaystyle{a}_{{{0}}}={\frac{{{1}}}{{{b}}}}{\int_{{-{\frac{{{b}}}{{{2}}}}}}^{{{\frac{{{b}}}{{{2}}}}}}}{f{{\left({x}\right)}}}{\left.{d}{x}\right.},{a}_{{{k}}}={\frac{{{2}}}{{{b}}}}{\int_{{-{\frac{{{b}}}{{{2}}}}}}^{{{\frac{{{b}}}{{{2}}}}}}}{f{{\left({x}\right)}}}{\cos{{\left({k}{x}\right)}}}{\left.{d}{x}\right.}$$, for $$\displaystyle{k}{>}{0}$$
$$\displaystyle{b}_{{{k}}}={\frac{{{2}}}{{{b}}}}{\int_{{-{\frac{{{b}}}{{{2}}}}}}^{{{\frac{{{b}}}{{{2}}}}}}}{f{{\left({x}\right)}}}{\sin{{\left({k}{x}\right)}}}{\left.{d}{x}\right.}$$, for $$\displaystyle{k}{>}{0}$$
Now the value of constant
$$\displaystyle{a}_{{{0}}}={\frac{{{1}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\left.{d}{x}\right.}\right]}={\frac{{{1}}}{{{2}}}}{\left[{\frac{{{x}^{{{2}}}}}{{{2}}}}{{\mid}_{{{0}}}^{{{2}}}}\right]}={1}$$
Furthermore
$$\displaystyle{a}_{{{1}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\cos{\pi}}{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{{x}{\sin{\pi}}{x}}}{{\pi}}}+{\frac{{{\cos{\pi}}{x}}}{{\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}={0}$$
And
$$\displaystyle{b}_{{{1}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\sin{\pi}}{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{-{x}{\cos{\pi}}{x}}}{{\pi}}}+{\frac{{{\sin{\pi}}{x}}}{{\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}=-{\frac{{{4}}}{{\pi}}}$$
Therefore the fourier polynomial of degree 1 is given by
$$\displaystyle{f{{\left({x}\right)}}}\approx{1}-{\frac{{{4}}}{{\pi}}}{\sin{\pi}}{x}$$
Step 2
Now similarly other coefficients
$$\displaystyle{a}_{{{2}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\cos{{2}}}\pi{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{{x}{\sin{{2}}}\pi{x}}}{{{2}\pi}}}+{\frac{{{\cos{{2}}}\pi{x}}}{{{4}\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}={0}$$
And
$$\displaystyle{b}_{{{2}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\sin{{2}}}\pi{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{-{x}{\cos{{2}}}\pi{x}}}{{{2}\pi}}}+{\frac{{{\sin{{2}}}\pi{x}}}{{{4}\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}=-{\frac{{{2}}}{{\pi}}}$$
$$\displaystyle{a}_{{{3}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\cos{{3}}}\pi{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{{x}{\sin{{3}}}\pi{x}}}{{{3}\pi}}}+{\frac{{{\cos{{3}}}\pi{x}}}{{{9}\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}={0}$$
And
$$\displaystyle{b}_{{{3}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\sin{{3}}}\pi{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{-{x}{\cos{{3}}}\pi{x}}}{{{3}\pi}}}+{\frac{{{\sin{{3}}}\pi{x}}}{{{9}\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}=-{\frac{{{4}}}{{{3}\pi}}}$$
$$\displaystyle{a}_{{{4}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{2}}}}{x}{\cos{{4}}}\pi{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{{x}{\sin{{4}}}\pi{x}}}{{{4}\pi}}}+{\frac{{{\cos{{4}}}\pi{x}}}{{{16}\pi^{{{2}}}}}}\right)}{{\mid}_{{{0}}}^{{{2}}}}\right]}={0}$$
And
$$\displaystyle{b}_{{{4}}}={\frac{{{4}}}{{{2}}}}{\left[{\int_{{{0}}}^{{{1}}}}{x}{\sin{{4}}}\pi{x}{\left.{d}{x}\right.}\right]}={2}{\left[{\left({\frac{{-{x}{\cos{{4}}}\pi{x}}}{{{4}\pi}}}+{\frac{{{\sin{{4}}}\pi{x}}}{{{16}\pi^{{{2}}}}}}{{\mid}_{{{0}}}^{{{2}}}}\right]}=-{\frac{{{1}}}{{\pi}}}\right.}$$
Now the fFourier polynomial of degree 4 is
$$\displaystyle{f{{\left({x}\right)}}}\approx{1}-{\frac{{{4}}}{{\pi}}}{\sin{\pi}}{x}-{\frac{{{2}}}{{\pi}}}{\sin{\pi}}{x}-{\frac{{{4}}}{{{3}\pi}}}{\sin{{3}}}\pi{x}-{\frac{{{1}}}{{\pi}}}{\sin{{4}}}\pi{x}..$$
Step 3