[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] How can I get the constant term in a polynomial
From: |
Francois Maltey |
Subject: |
[Axiom-developer] How can I get the constant term in a polynomial |
Date: |
17 Dec 2006 18:13:45 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Hello,
I want to simplify sin ((a+1)*(b+%pi)) = sin (a*b + a*%pi + b + %pi)
to - sin (a*b + a*%pi + b)
I can get the coefficient of %pi in the numerator of the argument of sin x.
MP ==> SparseMultivariatePolynomial(R, K)
K ==> Kernel F
Z ==> Integer
kpi : K := retract(pi())@K -- the constant %pi
coeffPi : MP -> Z
coeffPi x ==
R has retractIfCan : R -> Union(Integer,"failed") =>
ccz := retractIfCan (coefficient (p, kpi, 1))@Union(Z, "failed")
ccz case Integer => ccz::Integer
0
In this example this coefficient is (a+1).
I don't want the all coefficient a+1, but only the constant term, 1 in R.
How can I get this 1 in R ?
The coeffPi function is sufficient for sin (a+3*%pi),
not for sin ((a+b+1)*%pi)
I don't see this function in SMP by )sh SMP nor in polycat.spad.
Have a nice day !
Francois
- [Axiom-developer] How can I get the constant term in a polynomial,
Francois Maltey <=