HP Forums
Ordering of expressions - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Ordering of expressions (/thread-6342.html)



Ordering of expressions - compsystems - 06-03-2016 02:42 AM

How I can do, so that the CAS displayed, orderly algebraic expressions, as they appear in the books of algebra


expand((x+y+z)^2) -> 2*x*y + 2*x*z + 2*y*z + x^2 + y^2 + z^2 =(

-> x^2 +2*x*y + 2*x*z + y^2 + 2*y*z + z^2 =)


RE: Ordering of expressions - Tim Wessman - 06-03-2016 04:47 AM

tap simplify

expand doesn't touch the ordering because changing the order all around kind of defeats the purpose of the expansion I think.

reorder(...) lets you do it according to a specific variable order you set.


RE: Ordering of expressions - compsystems - 06-03-2016 11:12 AM

Please include a flag automatic ordering in the next firmware, otherwise a presentation in a classroom requires simplify repetitively


RE: Ordering of expressions - DrD - 06-03-2016 12:15 PM

Would it be practical to enhance the expand() command to include an optional vector of variables?

expand((x+y+z)^2); // ==> 2*x*y+2*x*z+2*y*z+x^2+y^2+z^2

reorder(expand((x+y+z)^2,[x,y,z])); // ==> x^2+2*x*y+2*x*z+y^2+2*y*z+z^2

[Suggestion for enhancement]
expand(Expr, [Variables]); // Enhancement: (optionally), include result reordering.

-Dale-