Post Reply 
REORDER command
11-26-2016, 07:55 PM (This post was last modified: 11-26-2016 08:48 PM by compsystems.)
Post: #1
REORDER command
Hello again =)

Why the REORDER command is not working?


[Image: script_hp_prime_image00.png]


simplify flag: off
increasing flag: off
cas mode: on

Script on history view
PHP Code:
assume(a>0);
(
a*x^2+b*x+c) = 0;
Ans*4*a;         // ((a*x^2+b*x+c)*4*a) = 0
expand(Ans);     // (4*a^2*x^2+4*a*b*x+4*a*c) = 0
Ans+b^2;         // (4*a^2*x^2 +4*a*b*x + 4*a*c+b^2 ) = (b^2)
Ans-4*a*c;       // (4*a^2*x^2+4*a*b*x+4*a*c+b^2-4*a*c) = (b^2-4*a*c)
simplify(Ans);   // (4*a^2*x^2+4*a*b*x+b^2) = (-4*a*c+b^2)  
factor(Ans);     // (2*a*x+b)^2) = (-4*a*c+b^2)
(Ans);          // (abs(2*a*x+b)) = (√(-4*a*c+b^2))
assume(b>0);assume(c>0);
expr(replace(string(Ans),"abs","")); // (2*a*x+b) = (√(-4*a*c+b^2))
Ans-b;           // (2*a*x+b-b) = (√(-4*a*c+b^2)-b)
simplify(Ans);   // (2*a*x-b) = (√(-4*a*c+b^2)-2*b)
Ans/(2*a);       // (2*a*x/(2*a)) = (-b+√(-4*a*c+b^2))/(2*a)
simplify(Ans);   // x = (-b+√(-4*a*c+b^2))/(2*a)
part(Ans,1)=reorder(part(Ans,2),[b,a,c]);  // x = (-b+√[b^2-4*a*c])/(2*a)
expr(replace(string(Ans),"-b+","-b-")); // x = (-b-√[b^2-4*a*c])/(2*a) 
Find all posts by this user
Quote this message in a reply
Post Reply 




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