Hello BP
1: Is there an included function that returns the terms of expression?
subst(a*x^2+b*x+c,'+', nop) enter [a*x^2, b*x, c]
possible name of the command
terms(a*x^2+b*x+c) -> [a*x^2, b*x, c]
2: to get the coefficient of a term
increasing_power(0)
coeff(a*x^2)[0] enter a
coeff(x^2)[0] enter 1
coeff(a*x^2, degree(a*x^2)) enter a
possible name of the command
coeffterm(a*x^2) -> a
coeffterm(x^2) -> 1
or
coeff(a*x^2, 'term') -> a
Thanks
operations with terms
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: operations with terms
[op(a*x^2+b*x+c)]
coeff(a*x^2+b*x+c,x,2)
coeff(a*x^2+b*x+c,x,2)
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: operations with terms
coeff(a*x^2+b*x+c,x,2) ok, but you have to know what degree of the polynomial is, sometimes it is very important to determine if the coefficient of the highest degree is 1, so it would be very useful to add a word to identify it
coeff(a*x^2+b*x+c,`>`) -> a
coeff(a*x^2+b*x+c,`>`) -> a
Re: operations with terms
The leading coefficient command is lcoeff