r^2 = (mx+b)^2 + x^2

And then my troubles begin, because writing that out would give:
r^2 + b^2 = x^2 + mx^2 + 2mbx
shouldn't you have the "b^2" over on the right side of the equation?
Like so,
r^2 = x^2 + mx^2 + 2mbx+ b^2

or alternatively,
r^2 - b^2 = x^2 + mx^2 + 2mbx