Solution (source code)

= Solution

For equal <masses> and an <elastic collision>, $q=1$ and
$$
\frac{v_1}{u_1}=\frac12(\cos\theta_1\pm|\cos\theta_1|).
$$
Thus the nonzero outgoing branch is
$$
\boxed{v_1=u_1\cos\theta_1,\qquad 0\le\theta_1<\frac\pi2,}
$$
and the other nonnegative algebraic root is $v_1=0$. The latter is the head-on transfer of the incoming <momentum> and <kinetic energy> to particle 2: $v_2=u_1$. A stationary particle has no defined outgoing direction, so this root is not a separate physical outcome for every chosen $\theta_1$.

On the nonzero branch, <momentum conservation> gives
$$
\mathbf v'_2=u_1\widehat{\mathbf x}-\mathbf v'_1,
\qquad v_2=u_1\sin\theta_1.
$$
The two nonzero outgoing <velocities> are perpendicular: squaring <momentum conservation> and comparing with <kinetic energy> conservation gives $\mathbf v'_1\cdot\mathbf v'_2=0$. For $\cos\theta_1<0$, the nonzero root is negative and must be rejected; backward scattering of a moving incident particle is impossible in this equal-mass, initially stationary-target case.