Elastic collision in two dimensions Suppose a particle with mass $m_1$ and speed $v_{1i}$ undergoes an elastic collision with stationary particle of mass $m_2$. After the collision, particle of mass $m_1$ moves with speed $v_{1f}$ in a direction of angle $\theta$ above the line it was moving previously. Particle with mass $m_2$ moves with speed $v_{2f}$ in a direction of angle $\phi$ below the line which particle with mass $m_1$ was moving previously. Using equations for conservation of momentum and kinetic energy, how can we prove these two equations
$\frac{v_{1f}}{v_{1i}}=\frac{m_1}{m_1+m_2}[\cos \theta \pm  \sqrt{\cos^2 \theta - \frac{m_1^2-m_2^2}{m_1^2}}]$
and
$\frac{\tan(\theta +\phi)}{\tan(\phi)}=\frac{m_1+m_2}{m_1-m_2}$
?
EDIT. Here is what I've done:
For the first one, set the $xy$ coordinate system so that the positive direction of the $x$ axis points toward the original path of the particle with mass $m_1$. So we have three equations:
$m_1v_{1i}=m_1v_{1f}\cos \theta + m_2v_{2f} \cos \phi$
$0=m_1v_{1f}\sin \theta - m_2v_{2f}\sin \phi$
$m_1v_{1i}^2=m_1v_{1f}^2+m_2v_{2f}^2$.
From the second one, we get:
$v_{2f}=\frac{m_1v_{1f}\sin \theta}{m_2 \sin \phi}$
Plotting this into third equation, we get
$v_{1i}^2=v_{1f}^2(1+\frac{m_1 \sin^2 \theta}{m_2 \sin^2 \phi})$ (1)
From the first equation, we have
$\cos \phi =\frac{m_1(v_{1i}-v_{1f}\cos \theta)}{m_2v_{2f}}$
which after applying the equation we have for $v_2f$ becomes
$\sin^2 \phi = \frac{1}{1+\frac{(v_{1i}-v_{1f}\cos \theta)^2}{\sin^2 \theta \times v_1f^2}}$
Plotting this into equation (1), gives us an equation in terms of $m_1$, $m_2$, $v_{1f}$, $v_{1i}$ and $\theta$, but it is too far from what I expected.
For the second one, assigning the $xy$ coordinate in a way that the positive direction of the $x$ axis points toward the final path of the particle $m_2$, will give us three equations (two for conservation of linear momentum and one for conservation of kinetic energy), but I don't know what to do next.
 A: Since this is a homework problem, I will only provide a sketch of the solution. From the conservation laws, we have the three equations
$$\begin{align}
\tag{1} m_1v_{1i} - m_1v_{1f}\cos \theta &= m_2v_{2f} \cos \phi, \\
\tag{2} m_1v_{1f}\sin \theta &= m_2v_{2f}\sin \phi, \\
\tag{3} m_1v_{1i}^2 - m_1v_{1f}^2 &= m_2v_{2f}^2.
\end{align}$$
Summing the squares of (1) and (2) eliminates $\phi$. The RHS of the resultant equation contains $v_{2f}^2$ which can be eliminated using (3). Then, one would obtain a quadratic equation in terms of $\frac{v_{1f}}{v_{1i}}$, which can be solved to obtain the desired equation
$$\frac{v_{1f}}{v_{1i}} = \frac{m_1}{m_1+m_2}\left[\cos \theta \pm  \sqrt{\cos^2 \theta - \frac{m_1^2-m_2^2}{m_1^2}}\right].$$
For the next equation, we rotate the axes to obtain the angle $\theta+\phi$ more easily. Here, the conservation laws are
$$\begin{align}
\tag{4} m_1v_{1i}\cos\phi - m_1v_{1f}\cos(\theta+\phi) &= m_2v_{2f}, \\
\tag{5} m_1v_{1i}\sin \phi &= m_1v_{1f}\sin(\theta+\phi), \\
\tag{6} m_1v_{1i}^2 - m_1v_{1f}^2 &= m_2v_{2f}^2.
\end{align}$$
First, we square (4) and use (6) to eliminate $v_{2f}$. Then, we use (5) to eliminate $v_{1i},v_{if}$ from the resultant equation, obtaining an equation in terms of $\phi$ and $\theta+\phi$. Using trigonometric identities, we get an equation in terms of $\tan\phi$ and $\tan(\theta+\phi)$ only. Then, this equation can be rewritten as a quadratic equation in $\frac{\tan\phi}{\tan(\theta+\phi)}$: 
$$\left[1-\frac{\tan\phi}{\tan(\theta+\phi)}  \right]^2=\frac{m_2}{m_1}\left[1-\frac{\tan^2\phi}{\tan^2(\theta+\phi)}\right],$$
which can be solved to obtain the desired equation
$$\frac{\tan(\theta +\phi)}{\tan(\phi)}=\frac{m_1+m_2}{m_1-m_2}.$$
