# Why $e=g \pm \sqrt{g}$ when $\left( g-e \right)^2=g$?

I have a problem that involves finding $e$ such that $\left( g-e \right)^2=g$. Maxima tells me that $e=g \pm \sqrt{g}$, but I can't work on that equation to get this result. Actually, I can't go past $2ge - e^2 = g^2 - g$. Can someone show me the algebraic steps to get that result?

-
Hint: note that $(g -e)^2 = (-(g-e))^2.$ –  Ian Mateus Oct 14 '12 at 22:30
Don't expand it, square root. –  wj32 Oct 14 '12 at 22:31

We have $(g-e)^2 = g$. Taking square roots, $(g-e) = \pm \sqrt{g}$. Rearranging terms gives $e = g \pm \sqrt{g}$.

Don't expand the left side; this makes it more difficult.

-
Oh, I let that slip. Too much math does that to your brain. Thanks everyone. –  GuiRitter Oct 15 '12 at 0:56
Not expanding the right side is the easy part; it's the left side that you need to guard against expanding. –  jwodder Oct 15 '12 at 1:48
@Jwodder: corrected –  Ganesh Oct 15 '12 at 4:57
If $(g-e)^2=g$, then either $g-e=\sqrt g$, or $g-e=-\sqrt g$. Now solve these equations for $e$ to get the two possibilities.