No problem!

We begin with g=h:

\frac{x^2}{2a} - \frac{a}{2} = \frac{(x-c)^2}{2b} - \frac{b}{2}

I want to solve this equation for x, and I recognize it as a polynomial equation in x (since the only operations on x are addition / subtraction, multiplication and exponentiation by natural numbers). Thus my goal will be to collect terms that have the same degree in x.

The first thing I notice is that there’s a (x-c)^2 which I expand to x^2 - 2cx + c^2:

\frac{x^2}{2a} - \frac{a}{2} = \frac{x^2-2cx+c^2}{2b} - \frac{b}{2}

Now I use the distributive law on some of the pieces:

\frac{1}{2a} x^2 - \frac{a}{2} = \frac{1}{2b}x^2 -\frac{c}{b}x+\frac{c^2}{2b} - \frac{b}{2}

And let me now move everything over to the left hand side of the equation (by subtracting / adding terms to both sides):

\frac{1}{2a} x^2 - \frac{a}{2} - \frac{1}{2b}x^2 + \frac{c}{b}x - \frac{c^2}{2b} + \frac{b}{2} = 0

Now I can group terms according to degree:

\left(\frac{1}{2a} x^2 - \frac{1}{2b}x^2\right) + \frac{c}{b}x + \left(\frac{b}{2} - \frac{a}{2} - \frac{c^2}{2b}\right) = 0

Now I can factor out x^2/2 from the first parenthesized term (and also simplify the final term by combining the two terms that have the same denominator):

\left(\frac{1}{a} - \frac{1}{b}\right)\frac{x^2}{2} + \frac{c}{b}x + \left(\frac{b-a}{2} - \frac{c^2}{2b}\right) = 0

Now the only thing I have to do is show that \frac{1}{a}-\frac{1}{b} = \frac{b-a}{ab}. Fractions can be combined by finding the lowest common denominator, in this case it’s ab, which is divisible by both a and b, thus \frac{1}{a}=\frac{b}{ab} and \frac{1}{b}=\frac{a}{ab} and so

\frac{1}{a}-\frac{1}{b}=\frac{b}{ab}-\frac{a}{ab}=\frac{b-a}{ab}

as desired.

Finally, we have:

\frac{b-a}{2ab} x^2 + \frac{c}{b}x +\left(\frac{b-a}{2}-\frac{c^2}{2b}\right) = 0

[Reflecting a bit on this, I realize I’ve spent a remarkably large amount of my life fooling around with expressions like this… I’m glad all that practice came in handy again today, but here’s to hoping these sorts of skills (doing tedious calculations with human effort rather than e.g. computer effort) will be made obsolete sooner rather than later, like doing arithmetic on numbers by hand.

Note that Wolfram Alpha can solve these sorts of equations (and even give a step-by-step solution if you pay them), but in my opinion they choose a rather ugly final form in this case:

]