88
Xnumbers Tutorial
186
Series Evaluation
=xSerie(Funct, Id, a, b, [Param], [DgtMax])
Returns the numeric series of a function f(n) .
∑
=
=
b
n a
f n
S
( )
The parameter "Funct" is a math expression string such as:
"2^n/n*(-1)^(n+1)", "x^n/n!", "(-1)^(n)*(3+a)*x/(n-1)", ...
Remember the quote " " for passing a string to an Excel function.
For further details about the math string see Math formula string
"Id" indicates the integer index of the sum (usually "n", "k" , "i", etc.)
"a" and "b" are the limits of the sum.
The function may also have other parameters ("x", "y", "a", etc.) that can assume real values.
"Param" contains labels and values for parameters substitution (if there are). If we pass the
variable range without “labels”, the function will assign the values to the variables in the same
order that they appear in the formula string, from left to right.
The parameter "DgtMax" sets the multiprecision arithmetic. if omitted or zero the function uses
the fastest standard arithmetic
Example 1. Compute
∑
=
+
⋅
−
10
1
1
( 1)
n
n
n
n
x
for x = 2, with standard precision (15 digits) and with 25 digits.
The function substitutes x = 2 and then, computes the series f(n) for n =1, 2 ...10
10
2
...
4
2
3
2
2
2
2
2
( 1)
10
4
3
2
1
10
1
1
−
−
+
⋅ = = −
−
∑
=
+
n
n
n
n
xSerie("(-1)^(n+1)*x^n/n","n",1,10,2)= -64.8253968253968
Example 2. Compute
∑
=
=
10
n 0
n
n!
x
s
for x = −1.5, with standard precision (15 digits) and with 25 digits. As known, this series
approximates the exponential e^(-1.5)
The function xSerie accepts one or more parameters.