The vector space of all polynomials of degree at most \(n\) is denoted \(\mathbf{P}_{n}\), and it was established in Section [sec:6_3] that \(\mathbf{P}_{n}\) has dimension \(n + 1\); in fact, \(\{1, x, x^{2}, \dots, x^{n}\}\) is a basis. More generally, any \(n + 1\) polynomials of distinct degrees form a basis, by Theorem [thm:019633] (they are independent by Example [exa:018606]). This proves
019992 Let \(p_{0}(x), p_{1}(x), p_{2}(x), \dots, p_{n}(x)\) be polynomials in \(\mathbf{P}_{n}\) of degrees \(0, 1, 2, \dots, n\), respectively. Then \(\{p_{0}(x), \dots, p_{n}(x)\}\) is a basis of \(\mathbf{P}_{n}\).
An immediate consequence is that \(\{1, (x - a), (x - a)^{2}, \dots, (x - a)^{n}\}\) is a basis of \(\mathbf{P}_{n}\) for any number \(a\). Hence we have the following:
020007 If \(a\) is any number, every polynomial \(f(x)\) of degree at most \(n\) has an expansion in powers of \((x - a)\):
\[\label{eq:cor6_5_1} f(x) = a_0 + a_1(x - a) + a_2(x - a)^2 + \dots + a_n(x - a)^n \]
If \(f(x)\) is evaluated at \(x = a\), then equation ([eq:cor6_5_1]) becomes
\[f(x) = a_0 + a_1(a - a) + \dots + a_n(a - a)^n = a_0 \nonumber \]
Hence \(a_{0} = f(a)\), and equation ([eq:cor6_5_1]) can be written \(f(x) = f(a) + (x - a)g(x)\), where \(g(x)\) is a polynomial of degree \(n - 1\) (this assumes that \(n \geq 1\)). If it happens that \(f(a) = 0\), then it is clear that \(f(x)\) has the form \(f(x) = (x - a)g(x)\). Conversely, every such polynomial certainly satisfies \(f(a) = 0\), and we obtain:
020015 Let \(f(x)\) be a polynomial of degree \(n \geq 1\) and let \(a\) be any number. Then:
Remainder Theorem
- \(f(x) = f(a) + (x - a)g(x)\) for some polynomial \(g(x)\) of degree \(n - 1\).
Factor Theorem
- \(f(a) = 0\) if and only if \(f(x) = (x - a)g(x)\) for some polynomial \(g(x)\).
The polynomial \(g(x)\) can be computed easily by using “long division” to divide \(f(x)\) by \((x - a)\)—see Appendix [chap:appdpolynomials].
All the coefficients in the expansion ([eq:cor6_5_1]) of \(f(x)\) in powers of \((x - a)\) can be determined in terms of the derivatives of \(f(x)\).1 These will be familiar to students of calculus. Let \(f^{(n)}(x)\) denote the \(n\)th derivative of the polynomial \(f(x)\), and write \(f^{(0)}(x) = f(x)\). Then, if
\[f(x) = a_0 + a_1(x - a) + a_2(x - a)^2 + \dots + a_n(x - a)^n \nonumber \]
it is clear that \(a_{0} = f(a) = f^{(0)}(a)\). Differentiation gives
\[f^{(1)}(x) = a_1 + 2a_2(x - a) + 3a_3(x - a)^2 + \dots + na_n(x - a)^{n - 1} \nonumber \]
and substituting \(x = a\) yields \(a_{1} = f^{(1)}(a)\). This continues to give \(a_2 = \frac{f^{(2)}(a)}{2!}, a_3 = \frac{f^{(3)}(a)}{3!}, \dots, a_k = \frac{f^{(k)}(a)}{k!}\), where \(k!\) is defined as \(k! = k(k - 1) \cdots 2 \cdot 1\). Hence we obtain the following:
Taylor’s Theorem020039 If \(f(x)\) is a polynomial of degree \(n\), then
\[f(x) = f(a) + \frac{f^{(1)}(a)}{1!}(x - a) + \frac{f^{(2)}(a)}{2!}(x - a)^2 + \dots + \frac{f^{(n)}(a)}{n!}(x - a)^n \nonumber \]
020044 Expand \(f(x) = 5x^{3} + 10x + 2\) as a polynomial in powers of \(x - 1\).
The derivatives are \(f^{(1)}(x) = 15x^{2} + 10\), \(f^{(2)}(x) = 30x\), and \(f^{(3)}(x) = 30\). Hence the Taylor expansion is
\[\begin{aligned} f(x) &= f(1) + \frac{f^{(1)}(1)}{1!}(x - 1) + \frac{f^{(2)}(1)}{2!}(x - 1)^2 + \frac{f^{(3)}(1)}{3!}(x - 1)^3 \\ &= 17 + 25(x - 1) + 15(x - 1)^2 +5(x - 1)^3\end{aligned} \nonumber \]
Taylor’s theorem is useful in that it provides a formula for the coefficients in the expansion. It is dealt with in calculus texts and will not be pursued here.
Theorem [thm:019992] produces bases of \(\mathbf{P}_{n}\) consisting of polynomials of distinct degrees. A different criterion is involved in the next theorem.
020059 Let \(f_{0}(x), f_{1}(x), \dots, f_{n}(x)\) be nonzero polynomials in \(\mathbf{P}_{n}\). Assume that numbers \(a_{0}, a_{1}, \dots, a_{n}\) exist such that
\[\begin{aligned} f_i(a_i) &\neq 0 \quad \mbox{ for each } i \\ f_i(a_j) &= 0 \quad \mbox{ if } i \neq j\end{aligned} \nonumber \]
Then
- \(\{f_{0}(x), \dots, f_{n}(x)\}\) is a basis of \(\mathbf{P}_{n}\).
- If \(f(x)\) is any polynomial in \(\mathbf{P}_{n}\), its expansion as a linear combination of these basis vectors is
\[f(x) = \frac{f(a_0)}{f_0(a_0)} f_0(x) + \frac{f(a_1)}{f_1(a_1)} f_1(x) + \dots + \frac{f(a_n)}{f_n(a_n)} f_n(x) \nonumber \]
- It suffices (by Theorem [thm:019633]) to show that \(\{f_{0}(x), \dots, f_{n}(x)\}\) is linearly independent (because \(dim \;\|{P}_{n} = n + 1\)). Suppose that
\[r_0f_0(x) + r_1f_1(x) + \dots + r_nf_n(x) = 0, r_i \in \mathbb{R} \nonumber \]
- By (1), \(f(x) = r_{0}f_{0}(x) + \dots + r_{n}f_{n}(x)\) for some numbers \(r_{i}\). Once again, evaluating at \(a_{0}\) gives \(f(a_{0}) = r_{0}f_{0}(a_{0})\), so \(r_{0} = f(a_{0}) / f_{0}(a_{0})\). Similarly, \(r_{i} = f(a_{i}) / f_{i}(a_{i})\) for each \(i\).
020121 Show that \(\{x^{2} - x, x^{2} - 2x, x^{2} - 3x + 2\}\) is a basis of \(\mathbf{P}_{2}\).
Write \(f_{0}(x) = x^{2} - x = x(x - 1)\), \(f_{1}(x) = x^{2} - 2x = x(x - 2)\), and \(f_{2}(x) = x^{2} - 3x + 2 = (x - 1)(x - 2)\). Then the conditions of Theorem [thm:020059] are satisfied with \(a_{0} = 2\), \(a_{1} = 1\), and \(a_{2} = 0\).
We investigate one natural choice of the polynomials \(f_{i}(x)\) in Theorem [thm:020059]. To illustrate, let \(a_{0}\), \(a_{1}\), and \(a_{2}\) be distinct numbers and write
\[f_0(x) = \frac{(x - a_1)(x - a_2)}{(a_0 - a_1)(a_0 - a_2)}\quad f_1(x) = \frac{(x - a_0)(x - a_2)}{(a_1 - a_0)(a_1 - a_2)}\quad f_2(x) = \frac{(x - a_0)(x - a_1)}{(a_2 - a_0)(a_2 - a_1)} \nonumber \]
Then \(f_{0}(a_{0}) = f_{1}(a_{1}) = f_{2}(a_{2}) = 1\), and \(f_{i}(a_{j}) = 0\) for \(i \neq j\). Hence Theorem [thm:020059] applies, and because \(f_{i}(a_{i}) = 1\) for each \(i\), the formula for expanding any polynomial is simplified.
In fact, this can be generalized with no extra effort. If \(a_{0}, a_{1}, \dots, a_{n}\) are distinct numbers, define the Lagrange polynomials \(\delta_{0}(x), \delta_{1}(x), \dots, \delta_{n}(x)\) relative to these numbers as follows:
\[\delta_k(x) = \frac{\prod_{i \neq k}(x - a_i)}{\prod_{i \neq k}(a_k - a_i)}\quad k = 0, 1, 2, \dots, n \nonumber \]
Here the numerator is the product of all the terms \((x - a_{0}), (x - a_{1}), \dots, (x - a_{n})\) with \((x - a_{k})\) omitted, and a similar remark applies to the denominator. If \(n = 2\), these are just the polynomials in the preceding paragraph. For another example, if \(n = 3\), the polynomial \(\delta_{1}(x)\) takes the form
\[\delta_1(x) = \frac{(x - a_0)(x - a_2)(x - a_3)}{(a_1 - a_0)(a_1 - a_2)(a_1 - a_3)} \nonumber \]
In the general case, it is clear that \(\delta_{i}(a_{i}) = 1\) for each \(i\) and that \(\delta_{i}(a_{j}) = 0\) if \(i \neq j\). Hence Theorem [thm:020059] specializes as Theorem [thm:020177].
Lagrange Interpolation Expansion020177 Let \(a_{0}, a_{1}, \dots, a_{n}\) be distinct numbers. The corresponding set
\[\{\delta_0(x), \delta_1(x), \dots, \delta_n(x) \} \nonumber \]
of Lagrange polynomials is a basis of \(\mathbf{P}_{n}\), and any polynomial \(f(x)\) in \(\mathbf{P}_{n}\) has the following unique expansion as a linear combination of these polynomials.
\[f(x) = f(a_0)\delta_0(x) + f(a_1)\delta_1(x) + \dots + f(a_n)\delta_n(x) \nonumber \]
020189 Find the Lagrange interpolation expansion for \(f(x) = x^{2} - 2x + 1\) relative to \(a_{0} = -1\), \(a_{1} = 0\), and \(a_{2} = 1\).
The Lagrange polynomials are
\[\begin{aligned} \delta_0 & = \frac{(x - 0)(x - 1)}{(-1 - 0)(-1 - 1)} = \frac{1}{2}(x^2 - x) \\ \delta_1 & = \frac{(x + 1)(x - 1)}{( 0 + 1)( 0 - 1)} = -(x^2 - 1) \\ \delta_2 & = \frac{(x + 1)(x - 0)}{( 1 + 1)( 1 - 0)} = \frac{1}{2}(x^2 + x)\end{aligned} \nonumber \]
Because \(f(-1) = 4\), \(f(0) = 1\), and \(f(1) = 0\), the expansion is
\[f(x) = 2(x^2 - x) - (x^2 - 1) \nonumber \]
The Lagrange interpolation expansion gives an easy proof of the following important fact.
020203 Let \(f(x)\) be a polynomial in \(\mathbf{P}_{n}\), and let \(a_{0}, a_{1}, \dots, a_{n}\) denote distinct numbers. If \(f(a_{i}) = 0\) for all \(i\), then \(f(x)\) is the zero polynomial (that is, all coefficients are zero).
All the coefficients in the Lagrange expansion of \(f(x)\) are zero.