Page 1 sur 1

simplify(expr, 'pol')

Publié : ven. nov. 08, 2024 4:28 am
par compsystems
When simplifying, the result is often expressed as a rational expression, a second parameter could be accepted to try to simplify as a polyonomy.

simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9)) [Enter] returns (3*x^2+24*x+37)/3
simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9), 'pol') [Enter] returns x^2+9*x^1+20*x^0

simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9)) [Enter] returns (3*x^2+24*x+37)/3
factor(ans) => (x+5.91485421551)*(3.*x-5.74456264654+12.)*0.333333333333

simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9), 'pol') [Enter] returns x^2+9*x^1+20*x^0
factor(ans) => (x+4)*(x+5)

Re: simplify(expr, 'pol')

Publié : ven. nov. 15, 2024 8:50 pm
par parisse
I don't understand what you mean, the results are not the same as the inputs.

Re: simplify(expr, 'pol')

Publié : sam. nov. 16, 2024 12:53 pm
par compsystems
Hello.
I copied the examples wrong
the parameter pol, would try to take the result to an expression without quotient, that is to say it would distribute in each term automatically

simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9)) [Enter] returns (3*x^2+24*x+37)/3
simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9), 'pol') [Enter] returns x^2+8*x+37/3

Re: simplify(expr, 'pol')

Publié : sam. nov. 16, 2024 8:46 pm
par parisse
normal does that already.

Re: simplify(expr, 'pol')

Publié : dim. nov. 17, 2024 2:39 am
par compsystems
hello
normal cmd ok

I think these would be good examples to attach to the xCas documentation
simplify(((1/3)*x+(23/9))*(3*x+1)+(88/9)) => (3*x^2+24*x+37) / 3
normal(((1/3)*x+(23/9))*(3*x+1)+(88/9)) => x^2 + 8*x + 37/3
as you can see the difference between the two commands.

I think it would also be useful to be able to control the form of simplification.
simplify( ((1/3)*x+(23/9))*(3*x+1)+(88/9), 'normal') => x^2 + 8*x + 37/3

there is a very useful simplification, which is to take the coefficient of the highest power exponent of a polynomial to 1.
simplify((3*x+5)*x-9) => 3*x^2+5*x-9
simplify((3*x+5)*x-9, 'coeff1') => 1*x^2+5/3*x-3

Re: simplify(expr, 'pol')

Publié : lun. nov. 18, 2024 6:55 pm
par XcasEngGuy
That would be an easy command to create with xcas programming