Analytic solution inverse kinematics - different solutions with different calculation steps I have the following problem:
$$5\cos \theta_1+3\sqrt{3}\sin \theta_1=4\qquad\qquad\textbf{(I)}$$
$$5\sin \theta_1-3\sqrt{3}\cos \theta_1=6\qquad\qquad\textbf{(II)}$$
I have two seemingly correct paths to a solution, however only one actually computes the correct one.
Path 1, yielding the correct solution (I$\cdot$5, II $\cdot-3\sqrt{3}$):
$$25 \cos\theta_1 + 15 \sqrt{3} \sin\theta_1
    = 20$$
$$-15 \sqrt{3} \sin\theta_1 + 27 \cos\theta_1
    = -18\sqrt{3}$$
Add both:
$$52 \cos\theta_1 = 20 - 18\sqrt{3}$$
$$\theta_1=\cos^{-1}\left(\frac{20-18\sqrt{3}}{52}\right)\approx1.7874$$
Path 2, resulting in a different solution, that doesn't even satisfy the system of equations(I $\cdot3\sqrt{3}$, II $\cdot5$):
$$15 \sqrt{3} \cos\theta_1 + 27 \sin\theta_1
    = 12 \sqrt{3}$$
$$25 \sin\theta_1 - 15 \sqrt{3} \cos\theta_1
    = 30$$
Add both:
$$52 \sin\theta_1 = 30 + 12\sqrt{3}$$
$$\theta_1 = \sin^{-1} \left( \frac{15 + 6\sqrt{3}}{26} \right)
\approx 1.3542$$
$$5\cos(1.3542)+3\sqrt{3}\sin(1.3542)=6.1493\neq4$$
I don't see any errors in both solutions, however only the first path calculates the correct value. How can this be? How is this generalizable (or not) to the solutions of systems of equations with sin/cos in them?

For this system, I would set $\sigma=\sin \theta_1,\chi=\cos\theta_1$ and work those out rather than throwing yourself into inverse trig functions of irrationals so early.
$$3\sqrt 3 \sigma +5\chi =4 \tag I$$$$5\sigma-3\sqrt 3 \chi=6\tag {II}$$
Applying $(I)* 3\sqrt 3, (II)*5$ as in your second choice, we get: $$27\sigma+15\sqrt 3\chi=12\sqrt3 \tag{III}$$$$25\sigma-15\sqrt3 \chi =30 \tag{IV}$$
yielding $\sigma =\frac{6\sqrt 3+15}{26}$ and $\chi=\frac{10-9\sqrt 3}{26}$
You can calculate that $\sigma^2+\chi^2=1$ indeed.
You can then solve and see that picking the second solution of $\sin \theta= \frac{6\sqrt3+15}{26}$, where $\theta \approx1.787$ gives the correct answer here.
