11.12: Applications of Taylor Polynomials.

Example 1: Approximating f(x) = sin(x).

Part a.  Consider the graphs of the 1st m approximating polynomials on the interval from 0 to 2π.

Table[
        Plot[{Sin[
              x], (∑_(n = 0)^m)(((((-1))^n) (x^((2  n + 1))))/((2  n + 1)!))}, {x, 0, 2  π}, 
          Ticks -> {{(π/2), π, ((3  π)/2), 
                2  π}, {-1, 1}}, 
          PlotRange -> {-1.5, 1.5}], {m, 0, 15}];

Part b.  Consider the plots of the error associated with the first m approximating polynomials.

Table[
        Plot[{Sin[
                x] - (∑_(n = 0)^m)(((((-1))^n) (x^((2  n + 1))))/((2  n + 1)!))}, {x, 0, 2  π}, 
          Ticks -> {{(π/2), π, ((3  π)/2), 2  π}, 
              Automatic}], {m, 0, 15}];

Part c.  Suppose that we our goal is to find an integer value for m that guarantees error less that (10^(-10)) (think of a calculator).

To do this, we will use Taylor's Inequality which states that if there is an M such that | (f^((n + 1)))(
          x) |≤M for | x - 
          a | ≤ d, then the remainder (Subscript[R, n])(x) of the Taylor series satisfies the inequality \(TraditionalForm\`\(\(|\)\(\ \)\(\(R\_n\)(
          x)\)\(\ \)\(|\)\(\(≤\)\(\ \)\(M\/\(\((n + 
                    1)\)!\)\)\)\(|\)\(x - a\)\( | \^\(n + 1\)\)\)\) for | x -  
          a |≤d. 

In our case, a = 0 and the (((n + 1))^th) derivative is bounded above by 1 since the original function was the sine function.

Off[NSolve::"zerosol"];
\(\(Join[{{"m", \*""Coefficient \!\(M\/\(\((n + 1)\)!\)\)""}}, 
          Table[{m, \((1)\)\^\(m + 1\)\/\(\((m + 1)\)!\)}, {m, 0, 15}]] // 
        TableForm\) // N\)

Part d. Find the number of terms that must be included to converge within (10^(-10)) on ((-π)/2) ≤ 
        x ≤ (π/2).

\(\(Join[{{"m", "Error upperbound", \*""Less than (10^(-10))?""}}, 
Table[{m, \((π\/2)\)\^\(m + 1\)\/\(\((m + 1)\)!\), 
              If[\((π\/2)\)\^\(m + 1\)\/\(\((m + 1)\)!\) < 
                  10\^\(-10\), "Yes", "No"]}, {m, 0, 20}]] // 
        TableForm\) // N\)

Part e. Finding the interval of x values (that is, from ((Subscript[x, min]), (Subscript[x, max])) for which the approximation is within (10^(-10)).

Note: In this case, we simply use the remainder theorem for alternating series.

Off[NSolve::"zerosol"];
\(Join[{{"m", \*""Coefficient (M/((n + 1)!))"", "End points"}}, 
N[
          Table[{m, \((1)\)\^\(m + 1\)\/\(\((m + 1)\)!\), 
              NSolve[\((x)\)\^\(m + 1\)\/\(\((m + 1)\)!\) == 
                  10\^\(-10\), x]}, {m, 0, 15}]]] // TableForm\)