Fourier Series Representation $e^{ax}$ a) Compute the full Fourier series representation of $f(x) = e^{ax}, −π ≤ x &lt; π.$
  
  b) By using the result of a) or otherwise determine the full Fourier series expansion for the function $g(x)=\sinh(x), −π ≤ x &lt; π.$


For part a) this is what I did and I'm pretty sure it's all correct. (Please let me know if it isn't!)

$$\begin{align}
a_0\ &amp;=\frac{1}{π}\int_{-π}^{π} f(x)\cos(0x)\;dx\\
&amp;=\frac{1}{π}\int_{-π}^{π} e^{ax}\;dx=\frac{1}{π}\left[\frac{e^{ax}}{a}\right]^π_{-π}=\frac{e^{aπ}-e^{-aπ}}{aπ}\\
a_m\ &amp;=\frac{1}{π}\int_{-π}^{π} e^{ax}\cos(mx)\;dx\\
&amp;=\frac{1}{π}\left[\frac{e^{ax}\sin(mx)}{m}\right]^π_{-π}-\frac{1}{π}\int_{-π}^{π} \frac{ae^{ax}\sin(mx)}{m} dx\\
&amp;=\frac{1}{π}\left[\frac{e^{ax}\sin(mx)}{m}\right]^π_{-π}+\frac{1}{π}\left[\frac{ae^{ax}\cos(mx)}{m^2}\right]^π_{-π}-\frac{1}{π}\int_{-π}^{π} \frac{a^2e^{ax}\cos(mx)}{m^2} dx\\
&amp;=\frac{1}{π}\left[\frac{e^{ax}\sin(mx)}{m}+\frac{ae^{ax}\cos(mx)}{m^2}\right]^π_{-π}-\frac{a^2}{m^2}a_m\\
a_m\left(\frac{m^2+a^2}{m^2}\right)&amp;=\frac{ae^{aπ}(-1)^m-e^{-aπ}(-1)^m}{πm^2}\\
a_m&amp;=\frac{(-1)^m\left(ae^{aπ}-e^{-aπ}\right)}{π\left(m^2+a^2\right)}
\end{align}$$

Then
$$\begin{align}
b_m&amp;=\frac{1}{π}\int_{-π}^{π} e^{ax}sin(mx)\;dx\\
&amp;=\frac{1}{π}\left[\frac{-e^{ax}\cos(mx)}{m}\right]^π_{-π}+\frac{1}{π}\int_{-π}^{π} \frac{ae^{ax}\cos(mx)}{m}\;dx\\
&amp;=\frac{1}{π}\left[\frac{-e^{ax}\cos(mx)}{m}\right]^π_{-π}+\frac{1}{π}\left[\frac{ae^{ax}\sin(mx)}{m^2}\right]^π_{-π}-\frac{1}{π}\int_{-π}^{π} \frac{a^2e^{ax}\sin(mx)}{m^2}\;dx\\
&amp;=\frac{1}{π}\left[\frac{-e^{ax}\cos(mx)}{m}+\frac{ae^{ax}\sin(mx)}{m^2}\right]^π_{-π}-\frac{a^2}{m^2}b_m\\
b_m\left(\frac{m^2+a^2}{m^2}\right)&amp;=\frac{(-1)^{m+1}\left(e^{aπ}-e^{-aπ}\right)}{πm}\\
b_m&amp;=\frac{m(-1)^{m+1}\left(e^{aπ}-e^{-aπ}\right)}{π\left(m^2+a^2\right)}
\end{align}$$

so
$$\begin{align}
f(x)&amp;=\frac{1}{2}a_0+\sum_{n=1}^{\infty}a_n\cos(nx)+b_n\sin(nx)\\
e^{ax}&amp;=\frac{e^{aπ}-e^{-aπ}}{π}\left[\frac{1}{2a}+\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2+a^2}(\cos(nx)-n\sin(nx))\right]\\
e^{ax}&amp;=\frac{2}{π}\sinh(aπ)\left[\frac{1}{2a}+\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2+a^2}(\cos(nx)-n\sin(nx))\right]
\end{align}$$

but for part b) I wasn't sure of how to get the answer from part a) so instead I did this. I am also unsure if this is right.
How do you do part b) using part a) ?

$$\begin{align}
g(x)&amp;=\sinh(x)\\
a_0\ &amp;=\frac{1}{π}\int_{-π}^{π}\sinh(x)\cos(0x)\;dx\\
&amp;=\frac{1}{π}\left[\cosh(x)\right]^π_{-π}=0\\
a_m\ &amp;=\frac{1}{π}\int_{-π}^{π}\sinh(x)\cos(mx)\;dx\\
&amp;=\frac{1}{π}\left[\frac{\sinh(x)\sin(mx)}{m}\right]^π_{-π}-\frac{1}{π}\int_{-π}^{π}\frac{\cosh(x)\sin(mx)}{m}\;dx\\
&amp;=\frac{1}{π}\left[\frac{sinh(x)\sin(mx)}{m}\right]^π_{-π}+\frac{1}{π}\left[\frac{\cosh(x)\cos(mx)}{m^2}\right]^π_{-π}-\frac{1}{π}\int_{-π}^{π} \frac{\sinh(x)\cos(mx)}{m^2}\\
a_m\left(\frac{m^2+1}{m^2}\right)&amp;=\frac{1}{π}\left[\frac{\sinh(x)sin(mx)}{m}+\frac{\cosh(x)\cos(mx)}{m^2}\right]^π_{-π}=0
\end{align}$$

Then
$$\begin{align}
b_m&amp;=\frac{1}{π}\int_{-π}^{π}\sinh(x)\sin(mx)\;dx\\
b_m\left(\frac{m^2+a^2}{m^2}\right)&amp;=\left[\frac{-\sinh(x)(-1)^{m}}{πm}\right]^π_{-π}\\
b_m&amp;=\frac{-2m\sinh(π)(-1)^m}{π(m^2+1)}
\end{align}$$

so
$$\begin{align}
g(x)&amp;=\frac{1}{2}a_0+\sum_{n=1}^{\infty}a_n\cos(nx)+b_n\sin(nx)\\
\sinh(x)&amp;=\frac{-2\sinh(π)}{π}\sum_{n=1}^{\infty}\frac{(-1)^nn\sin(nx)}{n^2+1}
\end{align}$$
We have:
$$ \int_{-\pi}^{\pi}e^x \sin(nx)\,dx = \frac{2n}{1+n^2}(-1)^{n+1}\sinh \pi,$$
$$ \int_{-\pi}^{\pi}e^x \cos(nx)\,dx = \frac{2}{1+n^2}(-1)^{n}\sinh \pi,$$
hence:

$$ e^{x} = \frac{\sinh \pi}{\pi}+\frac{2\sinh \pi}{\pi}\sum_{n\geq 1}(-1)^n\frac{\cos(nx)-n\sin(nx)}{1+n^2}$$
and since $\sinh x$ is just the odd part of $e^x$ it follows that:
$$ \sinh x = \frac{2\sinh \pi}{\pi}\sum_{n\geq 1}(-1)^{n+1}\frac{n\sin(nx)}{1+n^2}.$$
For $e^{ax}$ we have:
$$ e^{ax} = \frac{\sinh(a\pi)}{a\pi}+\frac{2\sinh(a \pi)}{\pi}\sum_{n\geq 1}(-1)^n\frac{a\,\cos(nx)-n\sin(nx)}{a^2+n^2}.$$
I was looking up this result just the other day, and was confused by the original statement. It is corrected by the answer above, but from another line of reasoning.
So…  I just wanted to emphasize here again that there was a factor 'a' missing in the original result:
Starting from
$a_n = \frac{1}{π}\int_{-π}^{π} e^{ax}\cos(nx)~dx$
and then descending to the fifth line of your part a, I have :
$a_n = ~ 0 ~ + ~ \frac{a}{πn} \left[\frac{e^{ax}\cos(nx)}{n}\right]^π_{-π}
- \frac{a^2}{πn}\int_{-π}^{π} \frac{e^{ax}\cos(nx)}{n} dx$
$a_n =\frac{a}{πn}(-1)^n \left(\frac{e^{aπ}}n - \frac{e^{-aπ}}n \right) - \frac{a^2}{πn}\int_{-π}^{π} \frac{e^{ax}\cos(nx)}{n} dx$
recognising that the integral appears on both left and right hand side and simplifying from there, this gives
$a_n =\frac{a}{πn}(-1)^n \left(\frac{e^{aπ}}n - \frac{e^{-aπ}}n \right)  
\left(\frac{n^2}{n^2 + a^2} \right) $
$a_n =\frac{a}{π}(-1)^n \left(e^{aπ} - e^{-aπ} \right)  
\left(\frac{1}{n^2 + a^2} \right) $
and this in turn leads to the desired formula
$e^{ax}=\frac{e^{aπ}-e^{-aπ}}{π}\left[\frac{1}{2a}+\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2+a^2}(a\cos(nx)-n\sin(nx))\right]$