$x = a_1\cos(\theta_1 + \theta_2) + a_2\cos(\theta_1)$
$y = a_1\sin(\theta_1 + \theta_2) + a_2\sin(\theta_1)$
Solve for $\theta_1$ and $\theta_2$,they are angles for a robot, where $x$ and $y$ are the position. I want to get the angles given a position, I know there will be multiple solutions. I've attempted to use Wolfram Alpha to no avail.
Accidentally mistyped the equation, have updated.
You can use the sum to product identities to write $$ \cos(\theta_1 + \theta_2) + \cos(\theta_1)=2\cos\left(\frac {2\theta_1+\theta_2}2\right)\cos\left(\frac {\theta_2}2\right)\\ \sin(\theta_1 + \theta_2) + \sin(\theta_1)=2\sin\left(\frac {2\theta_1+\theta_2}2\right)\cos\left(\frac {\theta_2}2\right)\\ \frac yx=\tan\left(\frac {2\theta_1+\theta_2}2\right)\\ 2\theta_1+\theta_2=\arctan \frac {2y}x\\ \frac {x^2+y^2}{a_2^2}=\cos^2\left(\frac {\theta_2}2\right)\\ \theta_2=2\arccos \sqrt{\frac {x^2+y^2}{a_2^2}}$$
Added: with the $a$s not being the same, the above doesn't work. You can still write $\sin = \pm \sqrt {1-\cos^2}$ to get to two equations in two unknowns, $\cos \theta_1$ and $\cos (\theta_1+\theta_2)$. It will be messier.