So I am building a computer program.
In the program I need to build a function that takes this arguments {a, b, c, d, e, f, s, u}, and returns back the value of x in this equation:
$$ \sqrt{\left(x-a\right)^2+\left(\left(u\left(x-e\right)+f\right)-b\right)^2}+\sqrt{\left(x-c\right)^2+\left(\left(u\left(x-e\right)+f\right)-d\right)^2}=s $$
So basically I just need to simplify and solve the equation to get this form: $$ x=\mathrm{everythingElse}$$ And then I can code it.
The problem is that I cant solve this equation, first of all I trying to do it by hand and there is to many arguments I just couldn't solve it, than I tried to use wolfram alpha but it failed as well due to "execution time exceeded".
Let $$A = u^2+1 \\ B = -2a+2u(f-b-ue) \\ C = a^2+(f-b-ue)^2 \\ D = -2c+2u(f-d-ue) \\ E = c^2+(f-d-ue)^2$$ Now, equation is $\sqrt{Ax^2+Bx+C}+\sqrt{Ax^2+Dx+E}=s$. After squaring twice, we get: $$[(B-D)^2-4As^2]x^2-2[BE-BC+Bs^2+CD-DE+Ds^2]x+[C^2-2CE+E^2-2Cs^2-2Es^2+s^4]=0$$ This is quadratic (or maybe linear) equation which can be solved easily. Note that due to squaring we could get extra solutions. Simplest way to remove them is to put found $x$ into initial equality and check if it holds.