TaylorSeries

# TaylorSeries - dent Note that the first term on the right...

This preview shows pages 1–2. Sign up to view the full content.

The Taylor Series Expansion and An Introduction to Mathematica Purpose: Our first excursion into Mathematica will be simple, for more detail on Mathematica I suggest Wolfram, S. Mathematica: A System for Doing Mathematics on Computer or Blachman, N. Mathematica: A Practical Approach. The purpose of this notebook is to show the remainder term of a second order Taylor series expansion of a quadratic funciton. The Mathematics The first step is to declare a third order function. In this function x1 is the variable and a,b, and c are parameters. In[1]:= g1 = x1 3 + ax1 2 + b x1 + c Out[1]= c + b x1 + a x1 2 + x1 3 Given the original function, the second order Taylor expansion for g(x1) at x0 is: In[2]:= fg1 = I x0 3 + a x0 2 + b x0 + c M + I 3 x0 2 + 2 a x0 + b M H x1 - x0 L + 1 2 H 6 x0 + 2 a L H x1 - x0 L 2 Out[2]= c + b x0 + a x0 2 + x0 3 + H b + 2 a x0 + 3 x0 2 L H - x0 + x1 L + 1 2 H 2 a + 6 x0 L H - x0 + x1 L 2 A useful exercise to learn Mathematica is to automate the derivation from the first equation, but this will be left to the stu-

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dent. Note that the first term on the right hand side of the equation is simply g(x0). Instructing Mathematica to simplify this expression yields: In[3]:= Simplify @ fg1 D Out[3]= c + x0 3-3 x0 2 x1 + 3 x0 x1 2 + x1 H b + a x1 L Subtracting this result from the orginal expression g(x1) yields the error of approximation: In[4]:= g1-fg1 Out[4]=-b x0-a x0 2-x0 3 + b x1 + a x1 2 + x1 3-H b + 2 a x0 + 3 x0 2 L H-x0 + x1 L-1 2 H 2 a + 6 x0 L H-x0 + x1 L 2 In[5]:= Simplify @ % D Out[5]=-H x0-x1 L 3 TaylorSeries.nb 1 Note that if x1-x0<1 then the error term converges to zero faster than x1 approaches x0. TaylorSeries.nb 2...
View Full Document

## This note was uploaded on 11/08/2011 for the course AEB 6533 taught by Professor Moss during the Fall '08 term at University of Florida.

### Page1 / 2

TaylorSeries - dent Note that the first term on the right...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online