Solving $x + \sqrt{x(x-a)} = b + a/2$ This algebraic equation came up in some work I was doing, and I haven't been able to solve it. I know what the solution is, but I'm quite bothered by not knowing the techniques to get there.
$$x + \sqrt{x(x-a)} = b + \frac{a}{2} $$
My attempts:
$$x + \sqrt{x(x-a)} = \frac{x^2 - x(x-a)}{x - \sqrt{x(x-a)}}$$
This led to the same issues in the denominator that I was having previously.
$$(x + \sqrt{x(x-a)})^2= x^2 + x(x-a) + 2x \sqrt{x(x-a)} = \frac{(a + 4b^2)^2}{2}$$
This RHS looks fairly close to the actual solution for $x $, but I don't see how to work with this unruly equation

Well, we have that:
$$x+\sqrt{x\left(x-\text{a}\right)}=\text{b}+\frac{\text{a}}{2}\tag1$$
Subtract $x$ from both sides:
$$\sqrt{x\left(x-\text{a}\right)}=\text{b}+\frac{\text{a}}{2}-x\tag2$$
Square both sides:
$$\left(\sqrt{x\left(x-\text{a}\right)}\right)^2=\left(\text{b}+\frac{\text{a}}{2}-x\right)^2=x\left(x-\text{a}\right)=\frac{\text{a}^2}{4}+\text{a}\text{b}+\text{b}^2-x\left(\text{a}+2\text{b}\right)+x^2\tag3$$
So:
$$x\left(x-\text{a}\right)-\frac{\text{a}^2}{4}-\text{a}\text{b}-\text{b}^2+x\left(\text{a}+2\text{b}\right)-x^2=$$
$$\text{a}^2-4\text{a}\text{b}-4\text{b}^2+8\text{b}x=0\tag4$$
