Find the Complex Fourier Series of $F(x) = \cos(2x) + \sin(x)$ on the interval $[-\pi, \pi]$
Here is my attempt:
The complex Fourier Series is in the form $\cos(2x) +\sin(x) = \sum_{n= -\infty}^{\infty} C_n e^{-\frac{in \pi x}{L}} \, dx$ $n = 0, \pm1, \pm2,\ldots$. The coefficients are defined by
$$C_n = \frac{1}{2 \pi} \int_{-\pi}^\pi (\cos(2x) +\sin(x)) e^{-inx} \, dx$$
I know I use integration by parts for this and I calculated the integrals via Wolfram Alpha and what I have is
$\dfrac{-i e^{inx} (n \cos(2x) -2i \sin(2x)}{n^{2} -4} + \dfrac{e^{inx} (\cos(x) -in \sin(x)}{n^{2} -1}$ evaluated at $x = -\pi$ to $x = \pi$. I am getting the coefficients being zero. Am I doing this right?
Thank you for all of your help.
You have $\cos(2x) = \dfrac12(e^{2ix}+e^{-2ix})$ and $\sin x = \dfrac1{2i}(e^{ix}-e^{-ix})$, so $$ \cos(2x)+\sin x = \frac12(e^{2ix}+e^{-2ix}) + \frac1{2i}(e^{ix}-e^{-ix}). $$
Later comment: Since the point is to write the function as a linear combination of $\{e^{inx}\}_{n=-\infty}^\infty$, once you've written the expression above, you're done. You wrote in a comment: "I have used these trig identities but I am still getting that the coefficients are zero." But you see the coefficients above: $1/2$ (for $e^{2ix}$ and $e^{-2ix}$) and $1/(2i)$ (for $e^{ix}$ and $e^{-ix}$). At that point there should be nothing more to do to find the coefficients.
If you go ahead seeking the coefficients by computing integrals, just as if you had not been handed the coefficients on a silver platter already, the you're looking at $$ \frac 1 {2\pi} \int_{-\pi}^\pi f(x) e^{-inx}\,dx. $$ Let's try this when $n=2$: \begin{align} & \frac 1 {2\pi} \int_{-\pi}^\pi f(x) e^{-inx}\,dx \\[8pt] = {} & \frac 1 {2\pi} \int_{-\pi}^\pi \left( \frac12(e^{2ix}+e^{-2ix}) + \frac1{2i}(e^{ix}-e^{-ix})\right) e^{-2ix}\, dx \\[8pt] = {} & \frac 1 {2\pi} \int_{-\pi}^\pi \frac 1 2 ( 1 + e^{-4ix}) + \frac 1 {2i} (e^{-ix} +e^{-3ix} ) \, dx. \end{align} So we have four terms under the integral sign, and $$ \int_{-\pi}^\pi e^{-4ix}\,dx = \int_{-\pi}^\pi e^{-ix}\,dx = \int_{-\pi}^\pi e^{-3ix}\,dx = 0. $$ It is only the first term that does not yield $0$: $$ \frac 1 {2\pi} \int_{-\pi}^\pi \frac 1 2 \cdot 1 \, dx\ne 0. $$