I'm trying to solve quite a large equation for $x_2$ and for some reason Mathematica can't handle it. I'm not good enough at math to know why. I have a quadratic equation $f(x)=ax^2 + bx + c$, a point on the curve $(x_1, y_1)$, and a distance $L$. The length of a curve between 2 points given by:
Integrate[Sqrt[1 + (b + 2*a*x)^2], x]
this gives me:
-((ArcSinh[b + 2*a*Subscript[x, 1]] + (b + 2*a*Subscript[x, 1]) *
Sqrt[1 + b^2 + 4*a*b*Subscript[x, 1] + 4*a^2*Subscript[x, 1]^2])/(4*a)) +
(ArcSinh[b + 2*a*Subscript[x, 2]] + (b + 2*a*Subscript[x, 2]) *
Sqrt[1 + b^2 + 4*a*b*Subscript[x, 2] + 4*a^2*Subscript[x, 2]^2])/(4*a) == L
Given L
and x_1
, I need to figure out x_2
. Or rather, I need to put x_2
in terms of {L, x_1, a, b}
.
I'm pretty sure this is possible? If it isn't, I'd like to understand why. Here's my faulty code (it's big). Mathematica just responds with:
"Solve::nsmet: This system cannot be solved with the methods available to Solve."
Solve[FullSimplify[TrigToExp[-((ArcSinh[b + 2*a*Subscript[x, 1]] +
(b + 2*a*Subscript[x, 1]) * Sqrt[1 + b^2 + 4*a*b*Subscript[x, 1] +
4*a^2*Subscript[x, 1]^2])/(4*a)) + (ArcSinh[b + 2*a*Subscript[x, 2]] +
(b + 2*a*Subscript[x, 2]) * Sqrt[1 + b^2 + 4*a*b*Subscript[x, 2] +
4*a^2*Subscript[x, 2]^2])/(4*a) == L]], Subscript[x, 2]]/. Rule -> Equal
Update
So @Jack LaVigne's answer is probably the best way to handle this within Mathematica. However, my goal in all this was to find a solution that I could translate into traditional computer-language code for a dynamic quadratic equation defined by the (variable) coefficients ${a, b, c}$, a variable known length $L$, and an x-coordinate for a known point which I call $u$.
I found that the easiest way to get this into something I could translate into general-purpose computer code was using newtonian approximation. I made a very detailed step-by-step derivation of the solution in Mathematica:
https://drive.google.com/open?id=0B9YYph2TpOvrTVJ4aGFmMGxwVkU
Here is the Javascript code:
https://gist.github.com/sikanrong/bd7b05b800a5086c1502e2c7033127ed
You just pass in all the knowns, and it will run newton until it converges, and returns your answer, which is the x-coordinate for the unknown point which is a distance L along the curve away from the point at x-coordinate $u$.
I hope this helps people in the same situation.
NSolve
orFindRoot
$\endgroup$