Find the Fourier series representation of f (t) = 1=t, -π<t≤π, period 2π.
As usual we sketch f (t) first as this often provides insight into what follows (see Figure 23.15). Here T = 2π, ω = 2, and for convenience we shall consider the period of integration to be [-π, π]. Using Equation (23.3) we find
a_0=\frac{2}{T} \int_0^T f(t) \mathrm{d} t (23.3)
b_n=\frac{2}{T} \int_0^T f(t) \sin \frac{2 n \pi t}{T} \mathrm{~d} t \quad \text { for } n \text { a positive integer } (23.5)
Similarly, using Equation (23.4) we find
a_n=\frac{1}{\pi} \int_{-\pi}^\pi(1+t) \cos n t \mathrm{~d} tIntegrating by parts gives
\begin{aligned} a_n & =\frac{1}{\pi}\left(\left[(1+t) \frac{\sin n t}{n}\right]_{-\pi}^\pi-\int_{-\pi}^\pi \frac{\sin n t}{n} \mathrm{~d} t\right) \\ & =\frac{1}{\pi}\left(0+\left[\frac{\cos n t}{n^2}\right]_{-\pi}^\pi\right) \quad \text { since } \sin \pm n \pi=0 \\ & =\frac{1}{\pi n^2}(\cos n \pi-\cos (-n \pi)) \end{aligned}but cos(-nπ) = cos nπ and hence a_n = 0, for all positive integers n. Using Equation (23.5) we find
\begin{aligned} b_n & =\frac{1}{\pi} \int_{-\pi}^\pi(1+t) \sin n t \mathrm{~d} t \\ & =\frac{1}{\pi}\left(\left[-(1+t) \frac{\cos n t}{n}\right]_{-\pi}^\pi+\int_{-\pi}^\pi \frac{\cos n t}{n} \mathrm{~d} t\right) \\ & =\frac{1}{\pi}\left(-(1+\pi) \frac{\cos n \pi}{n}+(1-\pi) \frac{\cos (-n \pi)}{n}+\left[\frac{\sin n t}{n^2}\right]_{-\pi}^\pi\right) \\ & =\frac{1}{\pi n}(-2 \pi \cos n \pi) \end{aligned}since sin ±.nπ = 0. Hence,
b_n=-\frac{2}{n} \cos n \pi=-\frac{2}{n}(-1)^nWe find b_1=2, b_2=-1, b_3=\frac{2}{3}, \ldots Thus the Fourier series representation is given from Equation (23.2) as
f(t)=1+2 \sin t-\sin 2 t+\frac{2}{3} \sin 3 t+\cdotswhich we can write concisely as
f(t)=1-\sum_{n=1}^{\infty} \frac{2}{n}(-1)^n \sin n t