<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[a4paper,12pt]{article}
\setlength\oddsidemargin{0pt} \setlength\evensidemargin{0pt}
\setlength\topmargin{0pt}
\begin{document}
\parindent=0pt
{\bf Exam Question

Topic: Fourier Series}

Find the Fourier Series for the function given by $$ f(x)=\left\{
\begin{array}{ll} 0 &amp; \mbox{if\ \ $-\pi&lt; x&lt;0$};\\ x &amp; \mbox{if\ \ $0\le
x\le\pi$}.\end{array} \right. $$

{\bf Solution}

$$a_0=\frac{1}{\pi}\int_{-\pi}{\pi}f(x)\,
dx=\frac{1}{\pi}\mathrm{area\ of\
triangle}=\frac{1}{\pi}\frac{\pi^2}{2}=\frac{\pi}{2}.$$

\begin{eqnarray*}
a_n&amp;=&amp;\frac{1}{\pi}\int_0^{\pi} x\cos nx\, dx
=\frac{1}{\pi}\left[x\frac{\sin
nx}{n}\right]_0^{\pi}-\frac{1}{\pi}\int_0^{\pi}\frac{\sin nx}{n}\,
dx\\ &amp;=&amp; \frac{1}{\pi}\left[\frac{\cos
nx}{n^2}\right]_0^{\pi}=\frac{1}{n^2\pi}\left[(-1)^n-1\right]
\end{eqnarray*}

\begin{eqnarray*}
b_n&amp;=&amp;\frac{1}{\pi}\int_0^{\pi} x\sin nx\, dx
=\frac{1}{\pi}\left[-x\frac{\cos
nx}{n}\right]_0^{\pi}+\frac{1}{\pi}\int_0^{\pi}\frac{\cos nx}{n}\,
dx\\ &amp;=&amp;
\frac{1}{\pi}\left[\frac{-\pi(-1)^n}{n}\right]+\frac{1}{\pi}\left[\frac{\sin
nx}{n^2} \right]_0^{\pi}=\frac{(-1)^{n+1}}{n}
\end{eqnarray*}

So the Fourier Series is

$$Frac{\pi}{4}+\sum_{n=1}^{\infty}\left[\frac{1}{\pi
n^2}\left((-1)^n-1\right)\cos nx+\frac{(-1)^{n+1}}{n}\sin
nx\right]$$

\end{document}
</pre></body></html>