## Linear Algebra and Its Applications, Exercise 3.4.23

Exercise 3.4.23. Given the step function $y$ with $y(x) = 1$ for $0 \le x \le \pi$ and $y(x) = 0$ for $\pi < x < 2\pi$, find the following Fourier coefficients: $a_0 = \frac{(y, 1)}{(1, 1)} \qquad a_1 = \frac{(y, \cos x)}{(\cos x, \cos x)} \qquad b_1 = \frac{(y, \sin x)}{(\sin x, \sin x)}$

Answer: For $a_0$ the numerator is $(y, 1) = \int_0^{2\pi} y(x) \cdot 1 \;\mathrm{d}x = \int_0^{\pi} 1 \;\mathrm{d}x + \int_{\pi}^{2\pi} 0 \;\mathrm{d}x = \pi$

and the denominator is $(1, 1) = \int_0^{2\pi} 1^2 \;\mathrm{d}x = 2\pi$

so that $a_0 = \frac{\pi}{2\pi} = \frac{1}{2}$.

For $a_1$ the numerator is $(y, \cos x) = \int_0^{2\pi} y(x) \cos x \;\mathrm{d}x = \int_0^{\pi} 1 \cdot \cos x \;\mathrm{d}x + \int_{\pi}^{2\pi} 0 \cdot \cos x \;\mathrm{d}x$ $= \int_0^{\pi} \cos x = \sin x \;\big|_0^{\pi} = 0 - 0 = 0$

so that $a_1 = 0$.

For $b_1$ the numerator is $(y, \sin x) = \int_0^{2\pi} y(x) \sin x \;\mathrm{d}x = \int_0^{\pi} 1 \cdot \sin x \;\mathrm{d}x + \int_{\pi}^{2\pi} 0 \cdot \sin x \;\mathrm{d}x$ $= \int_0^{\pi} \sin x = (-\cos x) \;\big|_0^{\pi} = -(-1) - (-1) = 1 + 1 = 2$

and the denominator is $(\sin x, \sin x) = \int_0^{2\pi} \sin^2 x \;\mathrm{d}x = \left[ \frac{1}{2}x - \frac{1}{4} \sin 2x \right] \;\big|_0^{2\pi}$ $= \left[ \frac{1}{2}\cdot(2\pi) - \frac{1}{4} \sin 2\pi \right] - \left[ \frac{1}{2} \cdot 0 - \frac{1}{4} \sin 2 \cdot 0 \right] = \pi - \frac{1}{4} \cdot 0 - 0 + \frac{1}{4} \cdot 0 = \pi$

so that $b_1 = \frac{2}{\pi}$.

So we have $a_0 = \frac{1}{2}$, $a_1 = 0$, and $b_1 = \frac{2}{\pi}$.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition , Dr Strang’s introductory textbook Introduction to Linear Algebra, Fifth Edition and the accompanying free online course, and Dr Strang’s other books .

This entry was posted in linear algebra and tagged , . Bookmark the permalink.