
- Calculus, Volume 2: Multi-Variable Calculus and Linear Algebra with Applications to Differential Equations and Probability
- Tom M. Apostol
- Second Edition
- 1991
- 978-1-119-49676-2
1.17 Exercises
- In the real linear space $C(-1, 1)$ with inner product $(f, g) = \int_{-1}^1 f(x) g(x) \, dx,$ let $f(x) = e^x$ and find the linear polynomial $g$ nearest to $f.$ Compute $\|g - f\|^2$ for this $g.$
- Recall from Theorem 1.16 that in a finite-dimensional subspace $S$ of a Euclidean space $V,$ for any element $x$ in $V,$ the projection of $x$ on $S$ is nearer to $x$ than any other element of $S.$
$\quad$ Let $S$ be the subspace of $C(-1, 1)$ spanned by $\{1, x\},$ or, the subspace of real linear polynomials continuous on the interval $[-1, 1].$ Then, if $x_1 = 1$ and $x_2 = x,$ we use the Gram-Schmidt process to construct an orthogonal set that spans $S:$ \begin{align*} y_1 &= x_1 = 1, \\ y_2 &= x_2 - \frac{(x_2, y_1)}{(y_1, y_1)}y_1 \\ &= x - \frac{\int_{-1}^1 x \,dx}{\int_{-1}^1 1 \,dx} \\ &= x \end{align*} To construct an orthonormal basis for $S,$ we divide each element in the orthogonal set by its norm: \begin{align*} e_1 &= \frac{y_1}{\|y_1\|} \\ &= \frac{1}{\left[\int_{-1}^1 1 \,dx\right]^{1/2}} \\ &= \frac{1}{\sqrt{2}} \\ e_2 &= \frac{y_2}{\|y_2\|} \\ &= \frac{x}{\left[\int_{-1}^1 x^2 \,dx\right]^{1/2}} \\ &= \frac{\sqrt{3}}{\sqrt{2}}x \end{align*} Now, to find the linear polynomial $g$ closest to $f(x) = e^x,$ we find the projection of $f$ on $S:$ \begin{align*} g &= (f, e_1)e_1 + (f, e_2)e_2 \\ &= \frac{1}{2}\int_{-1}^1 e^x\,dx + \left[\frac{3}{2}\int_{-1}^1 xe^x\,dx\right](x) \\ &= \frac{1}{2}\left(e - \frac{1}{e}\right) + \frac{3}{2}x\left[xe^x\biggr|_{-1}^1 - \int_{-1}^1 e^x \,dx\right] \\ &= \frac{1}{2}\left(e - \frac{1}{e}\right) + \frac{3}{2}x\left[\left(e + \frac{1}{e}\right) - \left(e - \frac{1}{e}\right) \right] \\ &= \frac{1}{2}\left(e - e^{-1}\right) + \frac{3}{e}x \quad \blacksquare \end{align*}
To find $\|g - f\|^2,$ we compute $(g - f, g - f):$ \begin{align*} \|g - f\|^2 &= (g - f, g - f) \\ &= (g, g) - 2(g, f) + (f, f) \\ &= \int_{-1}^1 \left[\frac{1}{2}(e - e^{-1}) + \frac{3}{e}x\right]^2\,dx \\ &- 2\int_{-1}^1\left[\frac{1}{2}(e - e^{-1}) + \frac{3}{e}x\right]e^x\,dx \\ &+ \int_{-1}^1 e^{2x}\,dx \\ &= \int_{-1}^1 \left[\frac{1}{4}(e - e^{-1})^2 + \frac{3}{2e}(e - e^{-1})x + \frac{9}{e^2}x^2\right]\,dx \\ &- 2\int_{-1}^1\left[\frac{1}{2}(e - e^{-1}) + \frac{3}{e}x\right]e^x\,dx \\ &+ \int_{-1}^1 e^{2x}\,dx \end{align*}
In evaluating the first integral, $(g, g),$ we note that $\int_{-1}^1 cx\,dx = 0$ for all real $c,$ giving us: \begin{align*} (g, g) &= \int_{-1}^1 \left[\frac{1}{4}(e - e^{-1})^2 + \frac{9}{e^2}x^2\right]\,dx \\ &= \left[\frac{1}{4}(e - e^{-1})^2x + \frac{3}{e^2}x^3\right]_{-1}^1 \\ &= \frac{1}{2}(e - e^{-1})^2 + \frac{6}{e^2} \\ &= \frac{1}{2}(e^2 + e^{-2}) - 1 + \frac{6}{e^2} \end{align*}
To evaluate the second integral, $-2(g, f),$ we use integration by parts with $u = g$ and $dv = f(x)\,dx$ to give us: \begin{align*} -2(g, f) &= -2uv\biggr|_{-1}^1 + 2\int_{-1}^1v\,du \\ &= 2\int_{-1}^1 \frac{3}{e}e^x\,dx -2\left[\frac{1}{2}(e - e^{-1}) + \frac{3}{e}x\right]e^x\biggr|_{-1}^1 \\ &= \frac{6}{e}(e - e^{-1}) - \left[(e - e^{-1})^2 + \frac{6}{e}(e + e^{-1})\right] \\ &= -\frac{12}{e^2} - (e - e^{-1})^2 \\ &= -\frac{12}{e^2} - \left(e^2 - 2 + e^{-2}\right) \\ &= 2 - e^2 - \frac{13}{e^2} \end{align*}
The third integral, $(f, f),$ is a simple evaluation: \begin{align*} (f, f) &= \int_{-1}^1 e^{2x}\,dx \\ &= \frac{1}{2}e^{2x}\biggr|_{-1}^1 \\ &= \frac{1}{2}\left(e^{2} - e^{-2}\right) \end{align*}
Combining terms and simplifying, we get the following: \begin{align*} \\ \|g - f\|^2 &= (g, g) - 2(g, f) + (f, f) \\ &= \frac{1}{2}(e^2 + e^{-2}) - 1 + \frac{6}{e^2} \\ &+ 2 - e^2 - \frac{13}{e^2} \\ &+ \frac{1}{2}\left(e^{2} - e^{-2}\right) \\ &= 1 - \frac{7}{e^2} \quad \blacksquare \end{align*}