Taylor polynomial (source code)

= Taylor polynomial
{c}
{title2=$T_{n,a}(x)=\sum_{k=0}^n f^{(k)}(a)(x-a)^k/k!$}

A <Taylor polynomial> replaces a <function> near a chosen point by a <polynomial> with matching <derivatives>. If $f$ has <derivatives> through order $n$ at $a$, define
$$
T_{n,a}(x)=\sum_{k=0}^n\frac{f^{(k)}(a)}{k!}(x-a)^k.
$$
The <factorial> denominator makes $T_{n,a}^{(j)}(a)=f^{(j)}(a)$ for $0\leq j\leq n$. This determines a unique <polynomial> of <degree of a polynomial> at most $n$. Order zero matches the value, order one also matches the <tangent line>, and order two also incorporates the second <derivative>. Matching more local information is useful because <polynomials> are easy to evaluate, differentiate, and integrate. The distinction between the finite <Taylor polynomial> and the infinite <Taylor series> is developed in https://openstax.org/books/calculus-volume-2/pages/6-3-taylor-and-maclaurin-series[OpenStax, Taylor and Maclaurin series].

For a computed example, let $f(x)=\sqrt{1+x}$ and expand at zero. Its first three <derivatives> give
$$
f(0)=1,\qquad f'(0)=\frac12,\qquad f''(0)=-\frac14,\qquad T_{2,0}(x)=1+\frac x2-\frac{x^2}8.
$$
At $x=0.1$, the linear approximation is $1.05$ and the quadratic approximation is $1.04875$, compared with $\sqrt{1.1}\approx1.048808848$. The quadratic correction captures the downward bending of the <square root> and reduces the absolute difference from about $0.00119115$ to $0.0000588482$.

\Image[/taylor-square-root-approximation.png]
{title=Matching more derivatives improves a local square-root approximation, and the third derivative supplies an error bound}

The <Taylor remainder> turns this convenient approximation into a controlled calculation. On $[0,0.1]$, $f'''(x)=3/[8(1+x)^{5/2}]$ is positive and at most $3/8$. The <Taylor theorem with Lagrange remainder> therefore gives
$$
0<\sqrt{1.1}-1.04875\leq\frac{(3/8)(0.1)^3}{3!}=\frac1{16000}.
$$
Consequently \b[$1.04875<\sqrt{1.1}\leq1.0488125$] follows without using the displayed decimal evaluation as evidence. The <Taylor polynomial> and the <Taylor remainder> play different roles: the former supplies an answer that is easy to compute, while the latter specifies what accuracy is justified. Farther from the expansion point, the same low-degree <polynomial> need not remain accurate.