Okay, thank you so much! We have $\frac{M_2}{M_1+M_2}V_{CM}=\frac{M_1}{M_1+M_2}U_1$
Is equal to $M_2V_{CM}=M_1U_1$
We didd have $\tan\theta_1=\frac{sin\theta}{\cos\theta+\frac{V}{U'_1}}$
We get $V_{CM}=\frac{M_1}{M_2}U_1$
Put that into tangent equation and we get
$\tan\theta_1=\frac{\sin\theta}{\cos\theta+\frac{M_1}{M_2}}$
Say that $\frac{M_1}{M_2}=C$ (constant).
Now take the derivative of $\tan\theta_1(\theta)$
$\frac{d}{d\theta}=0\Rightarrow \cos\theta=-\frac{M_1}{M_2}$
We have found a maximum $\tan\theta_1$ by taking the derivative of it and equal it to $0$
If $M_1=M_2, \cos\theta=-\frac{M_1}{M_2}=-1$
And $\tan\theta_1=\frac{\sin\theta}{\cos\theta+1}$
My teacher did something like this:
$\tan\theta_1 \to \infty$
I don't understand how he found $\theta=\pi$