How to calculate the Fourier coefficients for $f(x) = 6x+2$ for $-\pi < x < \pi$.

134 Views Asked by At

Consider the function $f \in C_{st}$ which satisfies that $$ f(x) = 6x+2 $$ for $-\pi < x < \pi$ Then I have to calculate the Fourier coefficients $c_n$.

MY ATTEMPT:

For $n=0$ we have that $$ 2\pi c_0 = \int_{-\pi}^\pi (6x+2)e^0 dx = \int_{-\pi}^\pi (6x+2) dx = \left[3x^2 + 2x\right]_{-\pi}^\pi = 4\pi $$ Thus $c_0 = 2$. Is this alright? Furthermore, for $n \neq 0$ we notice that $$ 2\int_{-\pi}^\pi e^{-inx}dx = 0 $$ Thus we only need to calculate \begin{align*} 2\pi c_n & = 6\int_{-\pi}^\pi xe^{-inx}dx \\ & = 6 \left( \frac{1}{-in} \left[xe^{-inx}\right]_{-\pi}^\pi + \frac{1}{in} \int_{-\pi}^\pi e^{-inx} dx \right)\\ & = 6 \left( \frac{1}{-in} \left( \pi e^{-in\pi} - (-\pi e^{in\pi} \right) \right) \\ & = \frac{12\pi}{in} \end{align*} Thus $c_n = \frac{6}{in}$. Is this correct? I tried to type the integral in Wolframalpha and it gave something completely different.

Thanks for your help.

1

There are 1 best solutions below

10
On BEST ANSWER

Let's redo the computation, taking into account that $\;\mathrm e^{in\pi}=\mathrm e^{-in\pi}=(-1)^n$: \begin{align} 2\pi c_n & = 6 \biggl( \frac{1}{-in} \Bigl[xe^{-inx}\Bigr]_{-\pi}^\pi + \frac{1}{in} \int_{-\pi}^\pi e^{-inx} dx \biggr)\\ & = 6 \biggl(\frac{i}{n} \bigl(\pi\mathrm e^{-in\pi}+\pi\mathrm e^{in\pi}\bigr) + \frac{1}{n^2}e^{-inx}\Bigr|_{\pi}^\pi \biggr)\\ &=(-1)^n\frac{12i\pi}{n}. \end{align}