# Expanding a polynomial with fractional powers

Given an expression like

a + b*y + c*y^2 + d*Sqrt[f + g*y + h*y^2]


How can I programatically, expand this to a quartic without any fractional powers?

Right now, I am having to copy and paste it as input expression and manually move the Sqrt to the RHS and square. I suspect there's an easier way to do this in Mathematica, perhaps using the Coefficient function or something similar.

• To make sure I understand the question, you want to automatically convert the equation A+B*y+C*y^2+D*Sqrt[F+G*y+H*y^2]==0 to the equation (A+B*y+C*y^2)^2 == D^2 (F+G*y + H*y^2). And you are fine with the fact that this may introduce extraneous roots (if your variables are real and Sqrt[] is interpreted as the positive square root). – David E Speyer Feb 19 '13 at 17:50
• Yes that's correct and I completely accept the consequences. My expression currently doesn't include the "==0"; however, that assertion is also true. – Blair Azzopardi Feb 19 '13 at 17:54
• Maybe you want Reduce[a + b*y + c*y^2 + d*Sqrt[f + g*y + h*y^2] == 0, y]? This works better (gives shorter solutions) when you specify additional information about your coefficients. What's the underlying problem that you want to solve? – Thies Heidecke Feb 19 '13 at 17:54
• You will not want to use capital C and D in your expression. They are built-in symbols. – chuy Feb 19 '13 at 18:11
• @ThiesHeidecke - Reduce seems to produce a very complicated output. The manual approach seems to produce a more succinct answer, i.e. Collect[Expand[(a + by + cy^2)^2 - (dSqrt[f + gy + h*y^2])^2], y] – Blair Azzopardi Feb 19 '13 at 18:25

eq = a + b*y + c*y^2 + d*Sqrt[f + g*y + h*y^2] == 0;

$$a^2-d^2 f + \left(2 a b-d^2 g\right)y + \left(2 a c+b^2-d^2 h\right)y^2 +2 b c y^3+c^2 y^4=0$$