Answer
Using trig identities it can be proved that for a Fourier series the coefficient is given by
$$a_{m}=\frac{1}{\pi}\int_{-\pi}^\pi{f(x)\sin mx}dx $$
Work Step by Step
A finite Fourier series is given by the sum
$$f(x)= \sum_{n=1}^{N} a_{n} \sin nx $$
multiply both sides by $ \sin mx $
then
$$f(x)\sin mx= \sum_{n=1}^{N} a_{n} \sin nx \sin mx $$
then integrate both sides from $-\pi$ to $ \pi$
$$\int_{-\pi}^\pi{f(x)\sin mx}dx= \int_{-\pi}^\pi{\sum_{n=1}^{N} a_{n} \sin nx \sin mx}dx $$
we can move the integral under the summation
$$\int_{-\pi}^\pi{f(x)\sin mx}dx={\sum_{n=1}^{N} a_{n} \int_{-\pi}^\pi \sin nx \sin mx}dx $$
since
$$ \int_{-\pi}^\pi \sin nx \sin mxdx = 0$$ for every $m\ne n$
and equals $\pi$ for $m=n$
then the summation kills every term other than m=n hence
$$\int_{-\pi}^\pi{f(x)\sin mx}dx=\pi a_{m} $$
then
$$a_{m}=\frac{1}{\pi}\int_{-\pi}^\pi{f(x)\sin mx}dx $$