Suppose I have a periodic function defined on a period as:
$$x(t) = t$$ $$ 0 < t < T_0$$
I wish to find the fourier expansion of this. So:
$$x_n = \frac{1}{T_0}\int_{0}^{T_0}te^{-i\frac{2\pi}{T_0}nt}dt$$
If I allow $$-i\frac{2\pi}{T_0}n = \phi$$ then:
$$x_n = \frac{1}{T_0}\int_{0}^{T_0}te^{\phi t}dt$$ and the result is straightforward through integration by parts (work omitted):
$$x_n = \frac{1}{T_0}(\frac{te^{\phi t}}{\phi} - \frac{e^{\phi t}}{\phi^2})$$ $$ 0 < t < T_0$$
Replace phi:
$$x_n = \frac{1}{T_0}(\frac{-te^{-i\frac{2\pi}{T_0}nt}}{i\frac{2\pi}{T_0} n} + \frac{e^{-i\frac{2\pi}{T_0}nt}}{4\frac{\pi^2}{T_0^2} n^2})$$
On the given interval. So I plug in T nought and 0, and I get an expression that I cannot figure out how to simplify. Here is my final answer:
$$x_n = \frac{-T_0e^{-i2\pi n}}{i2\pi n} + \frac{e^{-i2\pi n}}{4\frac{\pi^2}{T_0} n^2} - \frac{1}{4\frac{\pi^2}{T_0} n^2}$$
But this does not seem correct to me. I considered ways to simplify the solution, but none were obvious to me. I could convert the exponentials to their sine/cosine form, but I don't see any likely results that are any more useful than what I already have.
I'm pretty sure I've made an error somewhere.
Your work and the resulting answer for $x_n$ were correct.
Simply note that $e^{i2n\pi}=1$.
So, the second and third terms cancel each other and we have
$$x_n=-\frac{T_0}{i2n\pi}$$
which is the result you have after recognizing that $e^{i2n\pi}=1$.