A week or so ago, a commenter requested that solutions to exercises 14 and 15 of Walter Rudin’s *Real and Complex Analysis*. The commenter failed to specify which chapter; but the comment was to a post for an exercise in chapter 4 of Baby Rudin, so I am guessing it’s chapter 4. It’s been an exhausting week at work, so I only have a solution to exercise 14. I’ll probably have exercise 14 ready later this weekend.

Underlying both exercises is the subject of orthogonal polynomials, which I encourage the reader to explore after solving the exercises; however, I will not discuss it here. We will make do with basic Hilbert space results and integral calculus.

The first result we need is on the orthogonal projection of an element onto a closed, convex set of a Hilbert space. Specifically, there is a unique element of which minimizes the distance between and . If is a subspace, then also satisfies . Moreover, this element can be computed using generalized Fourier series.

Lemma 1.Let be a Hilbert space, and let be an orthonormal set, possibly uncountable, in . Let be a finite subset of , and define a subspace . Thenwhere

Equality holds if and only if .

We can drop the finiteness condition imposed on with a bit more work, but we will not need the full result for our purposes. I leave generalizing Lemma 1 as an exercise to the reader.

*Proof. *Since is finite, we can enumerate the set by , for some positive integer . Observe that, for ,

It follows from the sesquilinearity of the inner product that . Since , it follows from the Pythagorean theorem that

It is evident that the inequality is strict unless .

Note that in the preceding lemma, is the unique solution to . But we can say more: is the unique element with the property that . To see this, observe that any such element , by the Pythaogorean theorem, satisfies

From our earlier work, we conclude that .

Consider the space of real polynomials with degree at most . Define polynomials , , and by

for all . We use the Gram-Schmidt algorithm to construct an orthonormal basis out of the basis for the space . We normalize to obtain . Then

Finally,

It’s worth mentioning that what we just did is essentially a truncated construction of the Legendre polynomials, one of the classical orthogonal polynomials. I use the word essentially because the Legendre polynomials are *orthogonal, not orthonormal*. Instead of normalizing in the Gram-Schmidt algorithm, they are standardized so that . Read about them!

Taking the orthogonal projection of onto the space , we see that the solution is

The second part of exercise 13 hints at the use of duality, the connection between a Hilbert space and its space of bounded linear functionals (dual space), in solving optimization problems. Needless to say, duality is a major theme in mathematics.

Let be a function that satisfies the constraints in the statement of the problem. Let denote the orthogonal projection of the polynomial onto the subspace of polynomials of degree at most . Since , we see that

From the Cauchy-Schwarz inequality, we obtain the upper bound

But the upper bound is attained when , which satisfies the constraints.