
Commentary:
$\textbf{Exercise 7.}$
(a) Let $U = \left{p \in \mathcal{P}_4(\mathbb{R}) : \int_{-1}^1 p = 0\right}$
Find a basis of $U$.
(b) Extend the basis in (a) to a basis of $\mathcal{P}_4(\mathbb{R})$.
(c) Find a subspace $W$ of $\mathcal{P}_4(\mathbb{R})$ such that $\mathcal{P}_4(\mathbb{R}) = U \oplus W$.
$\textbf{Solution 7.}$
(a) A basis of $U$ is $x, x^2 - \frac{1}{3}, x^3, x^4 - \frac{1}{5}.$ Simple calculus shows that each polynomial in the list above is in $U$. To verify that the list above is indeed a basis of $U$, first note that the list above is linearly independent (using the same reasoning as was used in Example 2.41 to show that the list in that example is linearly independent).
Then note that the linearly independent list above has length four, and thus $\dim U \geq 4$. However, $\dim \mathcal{P}_4(\mathbb{R}) = 5$, which implies that $\dim U = 4$ or $\dim U = 5$. Because $U$ is a proper subspace of $\mathcal{P}_4(\mathbb{R})$, this implies that $\dim U = 4$. Hence the list above is a basis of $U$.
(b) The constant polynomial 1 clearly is not in $U$. Thus $x, x^2 - \frac{1}{3}, x^3, x^4 - \frac{1}{5}, 1$ is a linearly independent list in $\mathcal{P}_4(\mathbb{R})$ of length five. By 2.38, the list above is a basis of $\mathcal{P}_4(\mathbb{R})$.
(c) Using the idea of the proof of 2.33 and the answer above to (b), we see that taking $W$ to be the subspace of $\mathcal{P}_4(\mathbb{R})$ consisting of the constant polynomials gives a subspace $W$ such that $\mathcal{P}_4(\mathbb{R}) = U \oplus W$.
$\textit{Commentary:}$ This exercise deals with a subspace $U$ of $\mathcal{P}_4(\mathbb{R})$ defined by a condition involving an integral: $U$ consists of all polynomials in $\mathcal{P}_4(\mathbb{R})$ whose integral from -1 to 1 is zero.
In part (a), a basis for $U$ is found. The polynomials $x$, $x^2 - \frac{1}{3}$, $x^3$, and $x^4 - \frac{1}{5}$ are chosen. These polynomials are in $U$ because their integrals from -1 to 1 are zero, which can be verified by direct calculation. They are linearly independent for the same reasons as in previous exercises. The dimension of $U$ is argued to be 4 by considering the dimension of the whole space $\mathcal{P}_4(\mathbb{R})$.
In part (b), the basis of $U$ is extended to a basis of $\mathcal{P}_4(\mathbb{R})$ by adding the constant polynomial 1, which is not in $U$ because its integral from -1 to 1 is not zero.
In part (c), the subspace $W$ is chosen to be the span of the polynomial added in part (b), which is the space of constant polynomials. This ensures that $U$ and $W$ intersect only at the zero polynomial and that every polynomial in $\mathcal{P}_4(\mathbb{R})$ can be uniquely written as a sum of a polynomial in $U$ and a constant polynomial.
This exercise shows that the conditions defining a subspace can involve integrals of polynomials. The basis for the subspace is constructed using polynomials whose integrals over the specified interval are zero. The complementary subspace is spanned by a polynomial whose integral is not zero.
$\textit{Examples:}$
1. In $\mathcal{P}_5(\mathbb{R})$, let $U = \left{p \in \mathcal{P}_5(\mathbb{R}) : \int_0^1 p(x) dx = 0\right}$. A basis for $U$ is $x - \frac{1}{2}, x^2 - \frac{1}{3}, x^3 - \frac{1}{4}, x^4 - \frac{1}{5}, x^5 - \frac{1}{6}$. This can be extended to a basis of $\mathcal{P}_5(\mathbb{R})$ by adding 1. The subspace $W = \operatorname{span}(1)$ satisfies $\mathcal{P}_5(\mathbb{R}) = U \oplus W$.
2. In $\mathcal{P}_3(\mathbb{R})$, let $U = \left{p \in \mathcal{P}_3(\mathbb{R}) : \int_{-2}^2 p(x) dx = 0\right}$. A basis for $U$ is $x, x^2, x^3 - \frac{4}{5}$. This can be extended to a basis of $\mathcal{P}_3(\mathbb{R})$ by adding 1. The subspace $W = \operatorname{span}(1)$ satisfies $\mathcal{P}_3(\mathbb{R}) = U \oplus W$.
3. In $\mathcal{P}_4(\mathbb{R})$, let $U = \left{p \in \mathcal{P}_4(\mathbb{R}) : \int_{-1}^1 x^2p(x) dx = 0\right}$. A basis for $U$ is $1, x, x^3, x^4 - \frac{3}{7}$. This can be extended to a basis of $\mathcal{P}_4(\mathbb{R})$ by adding $x^2$. The subspace $W = \operatorname{span}(x^2)$ satisfies $\mathcal{P}_4(\mathbb{R}) = U \oplus W$.
These examples demonstrate the same principle, with subspaces defined by conditions involving integrals of polynomials over different intervals, and in the last example, with a polynomial weight function. The bases for the subspaces consist of polynomials whose specified integrals are zero, while the complementary subspaces are spanned by polynomials whose integrals are non-zero. The specific polynomials in the bases are chosen to make the integrals easy to compute