taylor - Taylor series expansion
Note The syntax of taylor has changed. The old syntax will be removed in a future version. |
taylor(f) computes the Taylor series expansion of f up to the fifth order. The expansion point is 0.
taylor(f,Name,Value) usesadditional options specified by one or more Name,Value pair arguments.
taylor(f,v) computes the Taylor series expansion of f with respect to v.
taylor(f,v,Name,Value) uses additional options specified by one or more Name,Value pair arguments.
taylor(f,v,a) computes the Taylor series expansion of f with respect to v around the expansion point a.
taylor(f,v,a,Name,Value) uses additional optionsspecified by one or more Name,Value pair arguments.
f = 1/(5 + 4*cos(x));
T = taylor(f, 'Order', 8)
(49*x^6)/131220 + (5*x^4)/1458 + (2*x^2)/81 + 1/9
which is all the terms up to, but not including, order eight in the Taylor series for f(x):
Technically, T is a Maclaurin series, since its expansion point is a = 0.
prints Tin a format resembling typeset mathematics:
6 4 2
49 x 5 x 2 x
------ + ---- + ---- + 1/9
131220 1458 81
* If you use both the third argument a and ExpansionPoint to specify the expansion point, the value specified via ExpansionPoint prevails.
* If v is a vector, then the expansion point a must be a scalar or a vector of the same lengthas v. If v is a vector and a is a scalar, then a is expanded into a vector of the same length as v with all elements equal to a.
f | Symbolic expression. |
v | Symbolic variable or vector of symbolic variables with respect to which you want to compute the Taylor series expansion.Default: Symbolic variable or vector of symbolic variables of f determined by symvar. |
a | Realnumber (including infinities and symbolic numbers) specifying the expansion point. For multivariate Taylor series expansions, use a vector of numbers. |
Taylor Series Expansion
Taylor series expansion represents an analytic function f(x) as an infinite sum of terms around the expansion point x = a:
Taylor series expansion requires a function to have derivatives up to an infiniteorder around the expansion point.
Maclaurin Series Expansion
Taylor series expansion around x = 0 is called Maclaurin series expansion:
Compute the Maclaurin series expansions of these functions:
x^5/120 + x^4/24 + x^3/6 +x^2/2 + x + 1
x^5/120 - x^3/6 + x
x^4/24 - x^2/2 + 1
Compute the Taylor series expansions around x = 1 for these functions. The default expansion point is 0. To specify a different expansion point, use ExpansionPoint:
taylor(log(x),x, 'ExpansionPoint', 1)
x - (x - 1)^2/2 + (x - 1)^3/3 - (x - 1)^4/4 + (x - 1)^5/5 - 1
Alternatively, specify the expansion point as the third argument of taylor:
taylor(acot(x), x, 1)
pi/4 - x/2 + (x - 1)^2/4 - (x - 1)^3/12 + (x - 1)^5/40 + 1/2
Compute the Maclaurin series expansion forthis function. The default truncation order is 6. Taylor series approximation of this function does not have a fifth-degree term, so taylor approximates this function with the fourth-degree polynomial:
f = sin(x)/x;
t6 = taylor(f)
x^4/120 - x^2/6 + 1
Symsum - Sum of series
Leer documento completo
Regístrate para leer el documento completo.