# Fourier Series of exp(x) and its integral

I have to find the Fourier-coefficients of $$f(x)=\text{exp}(x)$$ for $$-1 < x <1$$ and evaluate the value of this series at $$x=2$$.

(EDIT: with period 2)

I have calculated the coefficients to $$a_n = \frac{(e^2-1)}{e\pi^2 n^2 +e} (-1)^n$$ for the cosine-termes and $$b_n = \frac{(1-e^2)\pi n}{e\pi^2 n^2 +e}(-1)^n$$ for the sine-termes.

My first question would be, if these are correct?

Assuming they are correct, I get the following series

$$f(x)=\frac{a_0}{2}+\sum_{n\geq1}\frac{(-1)^n}{e\pi^2 n^2 +e} \left((e^2-1)\cos(\pi n x)+(1-e^2)\pi n \sin(\pi n x)\right)$$

Now, how can I calculate its value for $$x=2$$? In this case the series gets a little bit easier but still, I dont know how to calculate its value.

And last but not least, when I integrate the series term by term, I dont really get the old series again.

I am very grateful for any kind of help!

Thank you!

• You can only define Fourier series for periodic functions. Are we to assume that the period is 2? Apr 28, 2019 at 9:18
• Yes, sorry! I forgot to write that Apr 28, 2019 at 9:26

Your formulas for $$a_n$$ and $$b_n$$ are correct. To calculate $$f(2)= \frac{e^2-1}{2e} + \frac{e^2-1}{e} \sum_{n=1}^\infty \frac{(-1)^n}{1+ \pi^2 n^2}$$ you just notice that it is the same sum as for $$f(0)=1$$. It may be possible to calculate this sum independently, but I doubt you're supposed to do that.
The reason why you're not obtaining the previous series because when you integrate term $$a_0$$ you get a non-constant function, which causes the difference. For $$|x|<1$$ we have: \begin{align} e^x &= 1 + \int_0^x f(y)dy = 1 + \int_0^x \Big(\frac{e^2-1}{2e} + \frac{e^2-1}{e} \sum_{n=1}^\infty \frac{(-1)^n\big(\cos (\pi n y) - \pi n \sin(\pi n y)\big)}{1+\pi^2n^2}\Big) dy = \\ &= 1 + \frac{e^2-1}{2e} x + \frac{e^2-1}{e}\sum_{n=1}^\infty \frac{(-1)^n}{1+\pi^2n^2}\big(\frac{\sin (\pi n x) + \pi n (\cos(\pi n x) - 1)}{\pi n}\big) = \\ &= 1 - \frac{e^2-1}{e}\sum_{n=1}^\infty\frac{(-1)^n}{1+\pi^2 n^2} + \frac{e^2-1}{2e} x + \frac{e^2-1}{e}\sum_{n=1}^\infty \frac{(-1)^n}{1+\pi^2n^2}\big(\cos(\pi n x) + \frac{1}{\pi n}\sin (\pi n x)\big) = \\ &= \frac{e^2-1}{2e} + \frac{e^2-1}{2e} x + \frac{e^2-1}{e}\sum_{n=1}^\infty \frac{(-1)^n}{1+\pi^2n^2}\big(\cos(\pi n x) + \frac{1}{\pi n}\sin (\pi n x)\big)\end{align} It is equivalent with the original formula $$e^x = \frac{e^2-1}{2e} + \frac{e^2-1}{e} \sum_{n=1}^\infty \frac{(-1)^n}{1+\pi^2n^2}\big(\cos (\pi n x) - \pi n \sin(\pi n x)\big)$$ because (for $$|x|<1$$): $$x = 2\sum_{n=1}^\infty \frac{(-1)^{n+1}}{\pi n}\sin(\pi n x) = 2\sum_{n=1}^\infty \frac{(-1)^n}{1+\pi^2 n^2} \big(-\pi n - \frac{1}{\pi n}\big)\sin(\pi n x)$$
• But I still have another question: Why is it not possible to show that $\frac{\text{dexp}(x)}{\text{d}x}=\text{exp}(x)$ by differentiating term by term? Apr 28, 2019 at 10:43
• Because if you try, you get a sum $\sum_{n=1}^\infty \frac{(-1)^n \pi^2n^2 }{1+\pi^2n^2}\cos(\pi n x)$ which is not convergent for any $x$. Apr 28, 2019 at 11:26