Can this equation be solved by squaring both sides first?

The equation can be solved for $$x$$ by expanding the left side, grouping like terms and then squaring both sides. Can this equation be solved for $$x$$ by squaring both side first? If not, why? I can't get past the last step. Thanks $$\sqrt{a}(d - x) = \sqrt{b}x \Rightarrow$$ $$a(d^{2} - 2dx + x^{2}) = bx^{2} \Rightarrow$$ $$d^{2} - 2dx + x^{2} = x^{2} \frac{b}{a} \Rightarrow$$ $$\frac{d^{2} - 2dx + x^{2}}{x^{2}} = \frac{b}{a}$$

• "The equation can be solved for $x$ by expanding the left side, grouping like terms and then squaring both sides." -- To square what? The grouped like terms would be $\sqrt a d = \left(\sqrt a+\sqrt b\right)x$, then division would give $x = \dfrac{\sqrt a d}{\sqrt a + \sqrt b}$. Commented Feb 22, 2023 at 1:27
• @peterwhy Yeah, I don't know what I was thinking of. Maybe all those square roots threw me. Commented Feb 22, 2023 at 5:42

Yours is a linear equation it doesnt need to be squared. $$\sqrt{a}(d - x) = \sqrt{b}x \implies (d-x)=x\sqrt{b/a}\implies x(1+\sqrt{b/a})=d \implies x=\frac{d\sqrt{a}}{\sqrt{a}+\sqrt{b}}$$