Computer Simulation: Visualization of Power Series Approximations

None 2023
Students use prepared Sage code or a prepared Mathematica notebook to plot \(\sin\theta\) simultaneously with several terms of a power series expansion to judge how well the approximation fits. Students can alter the worksheet to change the number of terms in the expansion and even to change the function that is being considered. Students should have already calculated the coefficients for the power series expansion in a previous activity, Calculating Coefficients for a Power Series.
What students learn
  • Visualizing the fit of a power series approximation to a given function;
  • Visualizing how the fit of a power series improves as more terms are added;
  • What it means to expand a power series around a point other than \(z=0\).
  • Media
    • 2073/SeriesExpansions.nb
    • 2073/SeriesExpansionsAlt.nb
    • 2073/SeriesExpansions_LG.nb

Use the Sage code in the activity at this link or the attached Mathematica Notebook to plot the function \(\sin\theta\) and power series approximations to the function to explore how well the approximations work.

You will first need to calculate the coefficients of the power series. For the first part of the worksheet, calculate these coefficients for the power series around \(\theta=0\) and for the second part of the worksheet, calculate the coefficients around \(\theta=\frac{\pi}{6}\). You may have done these calculations in Calculating Coefficients for a Power Series.

You will need to know a few things about Mathematica Notebooks:

  • To select a line of code, click anywhere on the line.
  • To evaluate the line of code, first select it and then hit SHIFT/ENTER.
  • Some of the lines of code are missing information (the values of the coefficients. Enter them BEFORE evaluating the line of code.)

Instructor's Guide

Student Conversations

  • Students have to modify the worksheet in order to plot approximations better than 3rd order. Students who are uncomfortable with Mathematica may have a little trouble.
  • Students are asked to determine how many terms are needed in the approximation in order to fit the function \(\sin{\theta}\) between \(-\pi\) to \(\pi\). Students should be encouraged to explore other ranges.


  • This activity leads into a nice discussion of idealizations and making approximations. The question of "How many terms do I need to keep in my approximation?" is related to the question of "What domain do I care about?" and "How much accuracy do I need?"
  • Most students at the middle division level are familiar with small-angle approximations from the example of simple harmonic motion of a pendulum. This activity illustrates nicely how small your angle must be in order for the approximation \(\sin{\theta}\approx \theta\) to make sense.
  • You can also discuss some nice sense-making activities. One such example is being able to tell if you've got the sign wrong for a particular term - if it makes the approximation worse (the approximation diverges from the original function faster than it did with fewer terms), then you may have made a sign error.

Author Information
Corinne Manogue
Taylor series power series approximation
Learning Outcomes