# Series Taylor Matlab

Solo disponible en BuenasTareas
• Páginas : 5 (1148 palabras )
• Descarga(s) : 0
• Publicado : 29 de marzo de 2012

Vista previa del texto
taylor - Taylor series expansion
Note   The syntax of taylor has changed. The old syntax will be removed in a future version. |
Syntax
taylor(f)
taylor(f,Name,Value)
taylor(f,v)
taylor(f,v,Name,Value)
taylor(f,v,a)
taylor(f,v,a,Name,Value)
Description
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.
Taylor Series
The statements
syms x
f = 1/(5 + 4*cos(x));
T = taylor(f, 'Order', 8)
return
T =
(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.
The command
pretty(T)
prints Tin a format resembling typeset mathematics:

6 4 2
49 x 5 x 2 x
------ + ---- + ---- + 1/9
131220 1458 81
Tips
* 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.
Input Arguments
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. |
Definitions
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:

Examples
Compute the Maclaurin series expansions of these functions:
syms x
taylor(exp(x))
taylor(sin(x))
taylor(cos(x))
ans =
x^5/120 + x^4/24 + x^3/6 +x^2/2 + x + 1

ans =
x^5/120 - x^3/6 + x

ans =
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:
syms x
taylor(log(x),x, 'ExpansionPoint', 1)
ans =
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)
ans =
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:
syms x
f = sin(x)/x;
t6 = taylor(f)
t6 =
x^4/120 - x^2/6 + 1
Symsum - Sum of series
Syntax
symsum(expr)...