Taylor Series Examples

Ivan Cnop
Vrije universiteit Brussel
icnop@vub.ac.be

Non-elementary functions

We present some Taylor expansions for non-elementary functions to caution the user.

Combining sinus functions.

Plot[Sin[x - Sin[x]], {x, -1, 2 Pi + 1}]

Plot[Sin[x - Sin[x]], {x, - .1,  .1}]

Second derivative

D[D[Sin[x - Sin[x]], x], x]

Plot[%, {x, - .1,  .1}]

Conclusion

Because the second derivative looks linear, the function itself behaves like a third power near the origin

Series

Series[x - Sin[x], {x, 0, 6}]

Series[Sin[x - Sin[x]], {x, 0, 6}]

Series[Sin[x], {x, 0, 20}]

Sinus(x) divided by x  .

Series[Sin[x]/x, {x, 0, 20}]

poly = Normal[%];

Plot[{Sin[x]/x, poly},  {x, -10, 10}]

Problems with Taylor series

Illustrating the scope of the approximation.

Exercise

Plot[Abs[x (x - 2)]/(x^2 + 1),  {x, -5, 5}]

Choose a value for  x  and write Taylor polynomials of different orders. Plot these and check on what interval these approximate the function reasonably well

Exercise

Same question for

Plot[Abs[x - 1 ] E^x,  {x, -5, 5},  
      PlotRange -> {0, 3}]

Solving instability issues

Is  Mathematica  unreliable?

Plot[(1 - Cos[x])/(x^2), {x, -1, 1}]

Near the origin this exhibits

Plot[(1 - Cos[x])/(x^2), {x, - .0001,  .0001}]

Selecting PlotRange by hand shows oscillations are small:

Plot[(1 - Cos[x])/(x^2), {x, - .0001,  .0001}, 
      PlotRange -> { .4999999,  .5000001}]

But this is still unsatisfactory

Conclusion:

We need a different technique

Using Taylor series.

Simplify[Normal[Series[(1 - Cos[x]), {x, 0, 14}]]/(x^2)]

Plot[%, {x, - .001,  .001}, 
      PlotRange -> { .4999999,  .5000001}]

In fact a lower order will do:

Simplify[Normal[Series[(1 - Cos[x]), {x, 0, 5}]]/(x^2)]

Plot[%, {x, - .001,  .001}, 
      PlotRange -> { .49999,  .50001}]

Simplify[Normal[Series[(1 - Cos[x]), {x, 0, 4}]]/(x^2)]

Plot[%, {x, - .001,  .001}, 
      PlotRange -> { .49999,  .50001}]

Plot[%%, {x, - .1,  .1}, 
      PlotRange -> { .499,  .501}]

We can replace the plot of the function by this parabola near the origin.

Conclusion.

To work with plotting technology we need a thorough understanding of mathematical techniques