Solution (source code)

= Solution

Let the projectile's initial laboratory <velocity> be $u\hat{\mathbf x}$. The <centre-of-momentum frame> moves at
$$
V=\frac{Mu}{M+m}.
$$
In that frame, the projectile's initial <speed> is $w=u-V=mu/(M+m)$. An <elastic collision> preserves that <speed>, but can change its direction. Transforming the outgoing projectile <velocity> back by <Galilean velocity addition> gives
$$
\mathbf u_{\mathrm{out}}=V\hat{\mathbf x}+w\mathbf n,\qquad |\mathbf n|=1.
$$
This is the <velocity-circle construction for elastic scattering>: the outgoing tip lies on a <circle> of radius $w$, centred a distance $V$ from the origin in the velocity plane. Since $M>m$, $V>w$ and the origin lies outside this circle. The largest <scattering angle> occurs when the ray from the origin is tangent to it. The resulting <right triangle> gives
$$
\boxed{\sin\theta_{\max}=\frac wV=\frac mM,\qquad 0\leq\theta\leq\arcsin\frac mM.}
$$
Equality is kinematically possible; in the <centre-of-momentum frame> it corresponds to $\cos\chi=-w/V=-m/M$, where $\chi$ is the outgoing projectile <angle> to its initial direction. In particular, a heavier projectile cannot reverse its laboratory direction in an isolated <elastic collision> with an initially stationary lighter target.