# 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}$.
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.