# Solve won't return an answer for a set of four equations

So I was doing my homework and this system popped up, so I was trying to solve it but Mathematica has just been stuck with it for two days. It won't give me an answer. I am trying to get the code to use it in MATLAB, but I first need a set of solutions without my initial conditions for d, r1, r2 and q.

r4 = Sqrt[xB^2 + d^2];
r5 = Sqrt[xB^2 + (d - r1)^2];
r6 = r4 - r3;
f1 = Sin[q] + r1 - r3 Sin[T1];
f2 = Cos[q] - r3 Cos[T1];
f3 = Sin[q] + r6 Sin[T1] - r5 Sin[T2];
f4 = Cos[q] + r6 Cos[T1] - r5 Cos[T2];
s = Solve[{f1, f2, f3, f4} == 0, {r3, xB, T1, T2}]

• I would suggest trying the Weierstrass substitution for T1 and T2 so that you have a fully algebraic set of equations. – J. M.'s discontentment Oct 1 '18 at 4:01
• Nope, still wont solve it hehehe – Mario Alvarez Oct 1 '18 at 4:27
• Using Reduce instead of Solve will give you some information in a minute, Solve is more generally suited to polynomial problems while Reduce can attack transcendentals. But if this is a homework problem then I think there is something deeply wrong – Bill Oct 1 '18 at 5:02
• Nothing is wrong Bill, that's just how my teacher likes his homework problems. I just tried using Reduce just now, but something awful was spat at my face. – Mario Alvarez Oct 1 '18 at 6:52
• Thread[{f1, f2, f3, f4} == 0] – Αλέξανδρος Ζεγγ Oct 1 '18 at 15:50

As noted, one can use the Weierstrass substitution. I will give a partial solution, and let the OP finish the task.

With the definitions above:

eqs = Thread[{f1, f2, f3, f4} == 0] /.
Thread[{T1, T2} -> 2 ArcTan[{u1, u2}]] // TrigExpand // Simplify;


To ease things a bit, solve first for r3 and xB:

ss = Solve[eqs, {r3, xB}, {u1, u2}] // FullSimplify // PowerExpand;


where for example we get the solution

Last[ss]
{r3 -> Sqrt[1 + r1^2 + 2 r1 Sin[q]], xB -> (d Cos[q])/(r1 + Sin[q])}


To solve for e.g. T1, just plug any of the solutions in ss into the first equations in eqs, and then undo the substitution:

{T1 -> #} & /@ (2 ArcTan[u1] /. Simplify[Solve[First[eqs] /. Last[ss], u1]])
{{T1 -> 2 ArcTan[(-Cos[q] + Sqrt[1 + r1^2 + 2 r1 Sin[q]])/(r1 + Sin[q])]},
{T1 -> 2 ArcTan[(Cos[q] + Sqrt[1 + r1^2 + 2 r1 Sin[q]])/(r1 + Sin[q])]}}


so we see that there are two possible values of T1 for each {r3, xB} pair. You can then use these to solve for u2 (and thus T2).

• Thank you man, that was right on the spot. I just solved the set of equations by using your method and learned a lot. You just saved a man's life. – Mario Alvarez Oct 3 '18 at 4:17