simplify(expr, 'pol')

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

simplify(expr, 'pol')

Message par compsystems » ven. nov. 08, 2024 4:28 am

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)

parisse
Messages : 5878
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: simplify(expr, 'pol')

Message par parisse » ven. nov. 15, 2024 8:50 pm

I don't understand what you mean, the results are not the same as the inputs.

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: simplify(expr, 'pol')

Message par compsystems » sam. nov. 16, 2024 12:53 pm

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

parisse
Messages : 5878
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: simplify(expr, 'pol')

Message par parisse » sam. nov. 16, 2024 8:46 pm

normal does that already.

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: simplify(expr, 'pol')

Message par compsystems » dim. nov. 17, 2024 2:39 am

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

XcasEngGuy
Messages : 160
Inscription : mer. janv. 13, 2010 3:20 pm

Re: simplify(expr, 'pol')

Message par XcasEngGuy » lun. nov. 18, 2024 6:55 pm

That would be an easy command to create with xcas programming

Répondre