factor with 2 variables



On Fri, Feb 22, 2013 at 11:58, Jaime Villate wrote:
> On 02/21/2013 09:15 PM, Richard Fateman wrote:
> >On 2/21/2013 12:26 PM, Ranousse wrote:
> >>I wonder if there's a command to convert
> >>  2      2/3  4/3      4/3  2/3    2
> >>b  + 3 a    b    + 3 a    b    + a
> >>into
> >>(b^(2/3)+a^(2/3))^3
> >>
> >no, but try
> > ratsubst(z,a^(3/2),%)
> >ratsubst(w,b^(3/2),%)
> >factor(%)
> >
> Hi,
> Richard meant ratsubst(z,a^(2/3),%), ratsubst(w,b^(2/3),%), but that
> will not give you what you want. Try the following:
> 
> (%i2) f: b^2+3*a^(2/3)*b^(4/3)+3*a^(4/3)*b^(2/3)+a^2$
> 
> (%i3) subst([a=z^3,b=w^3],f);
> 
> (%o3) z^6+3*w^2*z^4+3*w^4*z^2+w^6
> 
> (%i4) factor(%);
> 
> (%o4) (z^2+w^2)^3
> 
> (%i5) subst([z=a^(1/3),w=b^(1/3)],%);
> 
> (%o5) (b^(2/3)+a^(2/3))^3
> 
> Cheers,
> Jaime

I thank you both for the answers.