3. On the ellipse $9 x^{2}+4 y^{2}-18 x-16 y=11$, find the point $A$ closest to the line $x+y=8$ and the point $B$ farthest from the same line.
Solution. The points of tangency are points where the ellipse touches lines $p$ and $q$ which are parallel to the line $x+y=8$. Let $s$ be a line parallel to the line $x+y=8$, i.e., $s: y=n-x$, for some $n \in \mathbb{R}$. Substituting into $9 x^{2}+4 y^{2}-18 x-16 y=11$, we get:

$$
9 x^{2}+4(n-x)^{2}-18 x-16(n-x)=11
$$

i.e.

$$
13 x^{2}-x(8 n+2)+4 n^{2}-16 n-11=0
$$

The points $A$ and $B$ are unique, so the solution to (1) for $x$ is a double root, which means the discriminant of (1) is zero, i.e.

$$
D=(8 n+2)^{2}-4 \cdot 13 \cdot\left(4 n^{2}-16 n-11\right)=0
$$

By simplifying, we get $D=-144\left(n^{2}-6 n-4\right)$, so from $n^{2}-6 n-4=0$, we get $n=3 \pm \sqrt{13}$. For $n=3+\sqrt{13}$, we obtain the closest point $A\left(1+\frac{4 \sqrt{13}}{13}, 2+\frac{9 \sqrt{13}}{13}\right)$, and for $n=3-\sqrt{13}$, we obtain the farthest point $B\left(1-\frac{4 \sqrt{13}}{13}, 2-\frac{9 \sqrt{13}}{13}\right)$.