I am trying to write the Fourier series for the following function
$$f(x) = \left\{\begin{aligned} &0 && -\pi<x<0\\ &e^{-x} && 0<x<\pi \end{aligned} \right.$$
I used all the same formulas I always use, but the coefficients I got look a bit strange to me
\begin{aligned} a_0 = \frac{1}{\pi}\int_0^\pi e^{-x}dx = \frac{1-e^{-\pi}}{\pi} \end{aligned}
\begin{aligned} a_n = \frac{1}{\pi}\int_0^\pi e^{-x} \cos(nx)dx = \frac{1}{\pi}\int_0^\pi e^{-x}\frac{e^{inx}+e^{-inx}}{2} = \frac{1-e^{-\pi}(-1)^n}{\pi(1+n^2)} \end{aligned}
\begin{aligned} b_n = \frac{1}{\pi}\int_0^\pi e^{-x} \sin(nx)dx = \frac{1}{\pi}\int_0^\pi e^{-x}\frac{e^{inx}-e^{-inx}}{2i} = \frac{n-ne^{-\pi}(-1)^n}{\pi(1+n^2)} \end{aligned}
...and my final solution for the series is
\begin{aligned} F(x) = \frac{1-e^{-\pi}}{2\pi} + \sum_{n=1}^\infty \frac{1-e^{-\pi}(-1)^n}{\pi(1+n^2)} \cos(nx) + \sum_{n=1}^\infty \frac{n-ne^{-\pi}(-1)^n}{\pi(1+n^2)} \sin(nx) \end{aligned}
I tried plotting $F(x)$ and it looked nothing like my function. My other method of checking the solution is to evaluate $F(x)$ at e.g. $x=0$ and see if I get the right sum, but I had no luck doing that either.
I'd be very grateful if anybody could tell me if there's something wrong with my math.

Since I cannot comment, here's the plot of your Fourier transform:
Your solution is correct. If you're interested this code was used to calculate the function(in Matlab):