Coefficients[] command is buggy

pirsquared shared this problem 7 years ago
New

Hi,


In current and beta versions of web-based Geogebra, the Coefficients[] command yields an error when fed a variable. For example:


    d(x)=x^2+6x+9

    coefficients[d]

yields the error "Illegal arguments: Number d" (clearly d isn't a number).


    coefficients[d(x)]

yields "Illegal argument: x".


This only is a problem on entry - any sheets I have created before using Coefficients continue to work as expected, but cannot be changed without producing one of the above errors.

Comments (4)

photo
1

Hmmm. Curiouser and curiouser.


I repeated my own example (in 5.0.169 in Chrome) and it worked fine, so I assumed it was just a glitch. However I then went about creating the worksheet I intended to create before I encountered this problem, and I was able to regenerate the issue as follows:


d(x)=x+2

coefficients[d] <- works fine

e(x)=x^2+8x+9

coefficients[d] <- still works fine

f(x)=d*e

coefficients[d] <- still works fine, as does coefficients[e] or [f]

f_1(x)=expand[d*e]

coefficients[d] <- does not work any more.


So the command seems to fall over once any algebraic commands are issued. I've tested Expand and Simplify and both yield the same issue, and it happens even if the expression being expanded is not dependent on d at all.


Weird, huh?

photo
1

Hi


I think that the problem is with expand command


When you use it in Input bar, everything go wrong

(even d(1) for example)


Just try :

f(x)=x+1

Expand[f]

f(1) > error with input bar, not with CAS...

photo
1

When you use it in Input bar, everything go wrong

(even d(1) for example)

So it does. Thanks for spotting this.


Looks like a wide-reaching problem with 5.0.169 - reported here too as a general issue - not limited to just this command. Just happened to be the one I was using today!

photo
1

Please try 5.0.170.0, online now

© 2023 International GeoGebra Institute