series
Puiseux series
Description
series(___,
uses
additional options specified by one or more Name,Value
)Name,Value
pair
arguments. You can specify Name,Value
after the
input arguments in any of the previous syntaxes.
Examples
Find Puiseux Series Expansion
Find the Puiseux series expansions of univariate and multivariate expressions.
Find the Puiseux series expansion of this expression at the
point x = 0
.
syms x series(1/sin(x), x)
ans = x/6 + 1/x + (7*x^3)/360
Find the Puiseux series expansion of this multivariate expression.
If you do not specify the expansion variable, series
uses
the default variable determined by symvar(f,1)
.
syms s t f = sin(s)/sin(t); symvar(f, 1) series(f)
ans = t ans = sin(s)/t + (7*t^3*sin(s))/360 + (t*sin(s))/6
To use another expansion variable, specify it explicitly.
syms s t f = sin(s)/sin(t); series(f, s)
ans = s^5/(120*sin(t)) - s^3/(6*sin(t)) + s/sin(t)
Specify Expansion Point
Find the Puiseux series expansion of psi(x)
around x
= Inf
. The default expansion point is 0. To specify a different
expansion point, use the ExpansionPoint
name-value
pair.
series(psi(x), x, 'ExpansionPoint', Inf)
ans = log(x) - 1/(2*x) - 1/(12*x^2) + 1/(120*x^4)
Alternatively, specify the expansion point as the third argument
of series
.
syms x series(psi(x), x, Inf)
ans = log(x) - 1/(2*x) - 1/(12*x^2) + 1/(120*x^4)
Plot Puiseux Series Approximation
Find the Puiseux series expansion of exp(x)/x
using different truncation orders.
Find the series expansion up to the default truncation order 6.
syms x
f = exp(x)/x;
s6 = series(f, x)
s6 =
Use Order
to control the truncation order. For example, approximate the same expression up to the orders 7 and 8.
s7 = series(f, x, 'Order', 7)
s7 =
s8 = series(f, x, 'Order', 8)
s8 =
Plot the original expression f
and its approximations s6
, s7
, and s8
. Note how the accuracy of the approximation depends on the truncation order.
fplot([s6 s7 s8 f]) legend('approximation up to O(x^6)','approximation up to O(x^7)',... 'approximation up to O(x^8)','exp(x)/x','Location', 'Best') title('Puiseux Series Expansion')
Specify Direction of Expansion
Find the Puiseux series approximations using
the Direction
argument. This argument lets you
change the convergence area, which is the area where series
tries
to find converging Puiseux series expansion approximating the original
expression.
Find the Puiseux series approximation of this expression. By
default, series
finds the approximation that
is valid in a small open circle in the complex plane around the expansion
point.
syms x series(sin(sqrt(-x)), x)
ans = (-x)^(1/2) - (-x)^(3/2)/6 + (-x)^(5/2)/120
Find the Puiseux series approximation of the same expression that is valid in a small interval to the left of the expansion point. Then, find an approximation that is valid in a small interval to the right of the expansion point.
syms x series(sin(sqrt(-x)), x) series(sin(sqrt(-x)), x, 'Direction', 'left') series(sin(sqrt(-x)), x, 'Direction', 'right')
ans = (-x)^(1/2) - (-x)^(3/2)/6 + (-x)^(5/2)/120 ans = - x^(1/2)*1i - (x^(3/2)*1i)/6 - (x^(5/2)*1i)/120 ans = x^(1/2)*1i + (x^(3/2)*1i)/6 + (x^(5/2)*1i)/120
Try computing the Puiseux series approximation of this expression.
By default, series
tries to find an approximation
that is valid in the complex plane around the expansion point. For
this expression, such approximation does not exist.
series(real(sin(x)), x)
Error using sym/series>scalarSeries (line 90) Unable to compute series expansion.
However, the approximation exists along the real axis, to both
sides of x = 0
.
series(real(sin(x)), x, 'Direction', 'realAxis')
ans = x^5/120 - x^3/6 + x
Input Arguments
Tips
If you use both the third argument
a
and theExpansionPoint
name-value pair to specify the expansion point, the value specified viaExpansionPoint
prevails.
Version History
Introduced in R2015b