Collect() does not work as should be
05-03-2024, 04:44 PM
Post: #1
 amindanial Junior Member Posts: 17 Joined: Jan 2024
Collect() does not work as should be
When the following command is entered in the CAS view

collect(a*z^2+q*z+p*z^2+o+n*z+y,z)

I get:

a*z^2 +n*z+o+p+z^2+q*z+y

whereas that same command was entered in XCas, and the answer was

z*(z*(a+p)+n+q)+o+y

which is the correct one as per the manual of HP Prime.

My HP Prime model is:
SW version: 2.1.14730
Hardware Version: D
OS: V2.060.650
05-03-2024, 06:45 PM
Post: #2
 Albert Chan Senior Member Posts: 2,643 Joined: Jul 2018
RE: Collect() does not work as should be
Hi, amindanial

Collect (factors) results depends on CAS setting.
If you have Simplify=Max, factors get "simplified" away.

We do have a bug, variable supplied not working (Simplify=Min)

> collect(x^2+3x+2)         → (x+1)*(x+2)
> collect(x^2+3x+2,x)      → x*(x+3)+2      ???
05-04-2024, 03:21 AM
Post: #3
 amindanial Junior Member Posts: 17 Joined: Jan 2024
RE: Collect() does not work as should be
However, what is the bug you are talking about "We do have a bug, variable supplied not working"?
05-04-2024, 03:37 AM
Post: #4
 Albert Chan Senior Member Posts: 2,643 Joined: Jul 2018
RE: Collect() does not work as should be
collect(x^2+3x+2) and collect(x^2+3x+2, x) should give the same answer (x+1)*(x+2)
05-04-2024, 05:01 AM (This post was last modified: 05-04-2024 05:04 AM by amindanial.)
Post: #5
 amindanial Junior Member Posts: 17 Joined: Jan 2024
RE: Collect() does not work as should be
"collect(x^2+3x+2) and collect(x^2+3x+2, x) should give the same answer (x+1)*(x+2)"
No, these two expressions don't give the same answer according to XCAS engine which is used by HP Prime as shown in the following screenshot.
05-04-2024, 12:10 PM (This post was last modified: 05-04-2024 12:11 PM by Albert Chan.)
Post: #6
 Albert Chan Senior Member Posts: 2,643 Joined: Jul 2018
RE: Collect() does not work as should be
XCas ans HP Prime use the same engine ... of course screenshot matched.
But is it right? How is collect(Poly, Var) supposed to work?

collect(Poly, Var) $$\;\overset{?}{=}\;$$ poly2symb(symb2poly(Poly, Var), Var)

XCas help does not even show this optional Var form, only collect(Poly or LstPoly)
XCas manual did (optional α, not Var), but no example of what to expect.
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)