Solution (source code)

= Solution

Let $r_A=|\mathbf P-\mathbf A|$, $r_B=|\mathbf P-\mathbf B|$, and define the outward-from-focus unit vectors $\mathbf u_A=(\mathbf P-\mathbf A)/r_A$ and $\mathbf u_B=(\mathbf P-\mathbf B)/r_B$. The <ellipse> is the nondegenerate level curve $r_A+r_B=s$, with $s>|\mathbf A-\mathbf B|$. The previous <gradient> result gives
$$
\nabla(r_A+r_B)=\mathbf u_A+\mathbf u_B.
$$
If $\mathbf t$ is a unit tangent at $P$, <orthogonality> to the level-curve <gradient> implies
$$
\mathbf t\cdot\mathbf u_A=-\mathbf t\cdot\mathbf u_B.
$$
Therefore $|\mathbf t\cdot\mathbf u_A|=|\mathbf t\cdot\mathbf u_B|$. These absolute dot products are the cosines of the acute angles made by the two focal lines with the unoriented <tangent line>. Thus those angles are equal.

Equivalently, the outward unit normal is $\mathbf n=(\mathbf u_A+\mathbf u_B)/|\mathbf u_A+\mathbf u_B|$, the bisector of the two unit focal directions. Its denominator is nonzero for a nondegenerate <ellipse>. Using $|\mathbf u_A|=|\mathbf u_B|=1$, the <specular reflection> formula becomes
$$
\mathbf u_A-2(\mathbf u_A\cdot\mathbf n)\mathbf n=\mathbf u_A-(\mathbf u_A+\mathbf u_B)=\boxed{-\mathbf u_B}.
$$
This algebra proves the equal-angle statement with the incident and reflected ray directions correctly oriented, rather than confusing the line $BP$ with the outgoing direction $PB$.

\Image[/past-exam-of-the-mathematical-methods-ii-course-of-the-university-of-oxford/2015-resit-ellipse-focal-reflection.png]
{title=The focal-distance gradient bisects the normal and reflects one focus to the other}