## Example 8.4.7 (a): Using Taylor's Theorem

To use a second-degree polynomial to approximate a function we need, according to Taylor's theorem, three derivatives of the function. So, let's go:*f(x) = tan(x*^{2}+1)

**f(0) = 1.5574***f'(x) = 2*(1+tan(x*^{2}+1)^{2})*x

**f'(0) = 0***f''(x) = 8*tan(x*^{2}+1)*(1+tan(x^{2}+1)^{2})*x^{2}+2+2*tan(x^{2}+1)^{2}

**f''(0) = 6.8510***f'''(x) = 16*(1+tan(x*^{2}+1)^{2})^{2}*x^{3}+32*tan(x^{2}+1)^{2}*(1+tan(x^{2}+1)^{2})*x^{3}+24*tan(x^{2}+1)*(1+tan(x^{2}+1)^{2})*x

Note that all derivatives, including the third, exist near zero. As a matter of fact, the function is infinitely often differentiable approximately for

-0.75551 < x < 0.75551

Can you give the precise domain, perhaps including *Pi* somehow?

According to Taylor's theorem, we can now approximate our function by:

p_{2}(x) = 1.5574+6.8510/2*x^2

The graph below shows both functions. Note that close to the origin they agree very well, but further away the difference becomes significant. Can you find another Taylor polynomial that approximates the function better than the one we found here?