Assume we have three variables which get expressed as sparse multivariate taylor series.:
xts:=x::TaylorSeries Fraction Integer
yts:=y::TaylorSeries Fraction Integer
zts:=z::TaylorSeries Fraction Integer
These will cause traditional routines to expand in series form:
t1:=sin(xts)
1 3 1 5 1 7 1 9
x - - x + --- x - ---- x + ------ x + O(11)
6 120 5040 362880
We can ask for a specific coefficient, in this case, the coefficient of the third power.
coefficient(t1,3)
1 3
- - x
6
And we can get that coefficient, expressed as a monomial.
coefficient(t1,monomial(3,x)$IndexedExponents Symbol)
1
- -
6
In a multivariate version we get a polynomial in x and y
t2:=sin(xts + yts)
1 3 1 2 1 2 1 3
(y + x) + (- - y - - x y - - x y - - x )
6 2 2 6
+
1 5 1 4 1 2 3 1 3 2 1 4 1 5
(--- y + -- x y + -- x y + -- x y + -- x y + --- x )
120 24 12 12 24 120
+
PAREN
1 7 1 6 1 2 5 1 3 4 1 4 3 1 5 2
- ---- y - --- x y - --- x y - --- x y - --- x y - --- x y
5040 720 240 144 144 240
+
1 6 1 7
- --- x y - ---- x
720 5040
+
PAREN
1 9 1 8 1 2 7 1 3 6 1 4 5
------ y + ----- x y + ----- x y + ---- x y + ---- x y
362880 40320 10080 4320 2880
+
1 5 4 1 6 3 1 7 2 1 8 1 9
---- x y + ---- x y + ----- x y + ----- x y + ------ x
2880 4320 10080 40320 362880
+
O(11)
We can ask for the third coefficient which is
coefficient(t2,3)
1 3 1 2 1 2 1 3
- - y - - x y - - x y - - x
6 2 2 6
And we can ask for the third coefficient of that coefficient in x
coefficient(t2,monomial(3,x)$IndexedExponents Symbol)
1
- -
6
And we can convert that result to a polynomial
polynomial(t2,5)
1 5 1 4 1 2 1 3 1 3 1 2 1 4 1 2
--- y + -- x y + (-- x - -)y + (-- x - - x)y + (-- x - - x + 1)y
120 24 12 6 12 2 24 2
+
1 5 1 3
--- x - - x + x
120 6
See Also: