Products & Services Solutions Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

taylor - Taylor series expansion

Syntax

taylor(f)
taylor(f, n)
taylor(f, a)
taylor(f, n, v)
taylor(f, n, v, a)

Description

taylor(f) returns the fifth order Maclaurin polynomial approximation to f.

taylor(f, n) returns the (n-1)-order Maclaurin polynomial approximation to f. Here n is a positive integer.

taylor(f, a) returns the fifth order Taylor series approximation to f about point a. Here a is a real number. If a is a positive integer or if you want to change the expansion order, use taylor(f,n,a) to specify the base point and the expansion order.

taylor(f, n, v) returns the (n-1)-order Maclaurin polynomial approximation to f, where f is a symbolic expression representing a function and v specifies the independent variable in the expression. v can be a string or symbolic variable.

taylor(f, n, v, a) returns the Taylor series approximation to f about a. The argument a can be a numeric value, a symbol, or a string representing a numeric value or an unknown. If a is a symbol or a string, do not omit v.

If a is neither an integer nor a symbol or a string, you can supply the arguments n, v, and a in any order. taylor determines the purpose of the arguments from their position and type.

You also can omit any of the arguments n, v, and a. If you do not specify v, taylor usessymvar to determine the function's independent variable. n defaults to 6, and a defaults to 0.

The following expression present the Taylor series for an analytic function f(x) about the base point x=a:

Examples

The following table describes the various uses of the taylor command and its relation to Taylor and Maclaurin series. Before using the taylor command, define the function you want to expand. For example:

syms x
f = exp(x^2);

Mathematical Operation

MATLAB Operation

taylor(f)

n is a positive integer

taylor(f,n)

n is a positive integer.

a is a real number

taylor(f,a)

a is a real number.

n is a positive integer and a is real. Also, a can be a positive integer.

taylor(f,n,a)

a is real and n is a positive integer.

In the case where f is a function of two or more variables (f=f(x,y,...)), there is an additional parameter that allows you to select the variable for the Taylor expansion. Look at this table for illustrations of this feature.

Mathematical Operation

MATLAB Operation

taylor(f,y)

n is a positive integer

taylor(f,y,n) or taylor(f,n,y)

n is a positive integer.

a is real

taylor(f,y,a)

a is real.

a is real and n is a positive integer

taylor(f,n,y,a)

a is real and n is a positive integer.

See Also

symvar, taylortool

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS