Hello
if coeff(-6*x^2,x^2) -> -6
if coeff(-6*x^4,x^3) -> -6
if coeff(-6*x^4,x^4) -> -6
then
coeff(-6*x^1,x^1) -> [-6,0] ?
coeff(-6*x,x^1) -> [-6,0] ?
coeff cmd with second parameter
Modérateur : xcasadmin
-
- Messages : 603
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: coeff cmd with second parameter
coeff expects a variable name as 2nd argument and a positive integer as 3rd argument. The variable name may be omitted if it is x.
-
- Messages : 603
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: coeff cmd with second parameter
but as I see in the examples it also accepts in the second argument a power, only that for x^1 = x it does not work
Re: coeff cmd with second parameter
That's expected, x^1 is evaled to x before coeff is called. You can however run coeff(-6*x^1,'x^1')
-
- Messages : 603
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: coeff cmd with second parameter
but in this case it fails
coeff(-6*x,'x') returns [-6, 0] expected -6
coeff(-6*x,'x') returns [-6, 0] expected -6
Re: coeff cmd with second parameter
'x^1' is not the same as 'x', it's a symbolic of rootnode ^, not an identifier.