For optimization problems involving square root, it is common to optimize the squared expression instead of that containing the square root. What if we have sum of squared expressions ?
Consider the following figure which shows distances from two fixed points $H,Q$ to a variable point $X$;$O$ is the origin:

The objective is to find $x$ which minimizes the distance $\alpha HX +\beta XQ$ , i.e. minimize
$S(x) = \alpha \sqrt{h^2+x^2} + \beta \sqrt{(p-x)^2 + q^2}$
The usual method of finding the optimal x by setting the derivative to $0$ results in a hideous fourth-order quartic.
It feels like this can be solved for a unique $x$ but I am at a loss trying to solve this. Any suggestions ?
I do not see an "hideous fourth-order quartic" anywhere. If $$S(x) = \sqrt{h^2+x^2} + \sqrt{(p-x)^2 + q^2}$$ $$S'(x)=\frac{x}{\sqrt{h^2+x^2}}-\frac{p-x}{\sqrt{(p-x)^2+q^2}}$$ So, for $S'(x)=0$,$$\frac{x}{p-x}=\frac{\sqrt{h^2+x^2}}{\sqrt{(p-x)^2+q^2}}$$ Square both sides, reduce to same denominator, expand and simplify; you should arrive to $$-h^2 p^2+2 h^2 p x+x^2 \left(q^2-h^2\right)=0$$
Added after the introduction of the weights.
Since now $$S(x) = \alpha \sqrt{h^2+x^2} + \beta \sqrt{(p-x)^2 + q^2}$$ I should try to find any analytical solution and use numerical methods instead. You then look for the zero of $$S'(x)=\frac{\alpha x}{\sqrt{h^2+x^2}}-\frac{\beta (p-x)}{\sqrt{(p-x)^2+q^2}}$$ in the range $0 \leq x \leq p$. For that I would suggest a combination of Newton and bisection steps (see for example subroutine RTSAFE in "Numerical recipes"). You have $$S''(x)=\frac{\alpha h^2}{\left(h^2+x^2\right)^{3/2}}+\frac{\beta q^2}{\left((p-x)^2+q^2\right)^{3/2}}$$
If you want to simply use Newton, you should notice that $$S'(0)= -\frac{\beta p}{\sqrt{p^2+q^2}} <0$$ $$S''(0)=\frac{\alpha }{\sqrt{h^2}}+\frac{\beta q^2}{\left(p^2+q^2\right)^{3/2}}>0$$ $$S'(p)=\frac{\alpha p}{\sqrt{h^2+p^2}}>0$$ $$S''(p)=\frac{\alpha h^2}{\left(h^2+p^2\right)^{3/2}}+\frac{\beta }{\sqrt{q^2}}>0$$ So, starting iterating at $x_0=p$ should lead to solution without any overshoot of it.