Back to Symbolic Mathematics

taylor

Taylor series expansion

Syntax

T = taylor(f, x)
T = taylor(f, x, a)
T = taylor(f, x, a, n)

Description

Computes the Taylor series expansion of f around the point a (default 0). Returns a polynomial approximation with n terms (default 6). The result is a symbolic polynomial representing the truncated Taylor series.

Parameters

NameDescription
fSymbolic expression to expand
xExpansion variable
a(optional)Expansion point (default: 0)
n(optional)Number of terms (default: 6)

Returns

Taylor polynomial

Examples

Try It
>> syms x; taylor(exp(x), x, 0, 4)
1 + x + x^2/2 + x^3/6
Try It
>> syms x; taylor(sin(x), x)
x - x^3/6 + x^5/120

See Also