Example 6.3.1.
Use the normal equations in (6.3.1) to find \(P_{2}(x)\) that interpolates \(f(x)=e^{x}\) on \([0,1]\text{.}\)
Solution.
The equations form the linear equations:
\begin{equation*}
\begin{aligned}a_{0} + \frac{1}{2}a_{1} + \frac{1}{3}a_{2}\amp = \int_{0}^{1} e^{x} \,dx = e-1\\ \frac{1}{2}a_{0} + \frac{1}{3}a_{1} + \frac{1}{4}a_{2}\amp = \int_{0}^{1} x e^{x} \, dx = 1\\ \frac{1}{3}a_{0} + \frac{1}{4}a_{1} + \frac{1}{5}a_{2}\amp = \int_{0}^{1} x^{2} e^{x} \, dx = e-2\\\end{aligned}
\end{equation*}
the solution to this (using exact precision is),
\begin{equation*}
\begin{aligned} a_{0}\amp = -105+39e,\amp a_{1}\amp = 588-216e,\amp a_{2}\amp = -570+210e.
\end{aligned}
\end{equation*}
A plot of this polynomial,
\begin{equation*}
P_{2}(x) = -105+39e + (588-216e) x +(-570+210e) x^{2}
\end{equation*}
and \(f(x)=e^{x}\) is
