On the diagonal $B D$ of the rectangular trapezoid $A B C D\left(\angle D=90^{\circ}, B C \| A D\right)$, a point $Q$ is taken such that $B Q: Q D=1: 3$. A circle with center at point $Q$ touches the line $A D$ and intersects the line $B C$ at points $P$ and $M$. Find the length of the side $A B$, if $B C=9, A D=8, P M=4$.
Let $E$ be the point of tangency of the circle with the line $A D$, and $F$ be the projection of the center $Q$ of the circle onto the line $B C$. Then the points $E, Q$, and $F$ lie on the same line, and $F$ is the midpoint of $P M$. Therefore, $F P = F M = 2$. Let $Q E = Q P = Q M = R$. Suppose that the point $P$ lies between $C$ and $M$. From the similarity of triangles $Q F B$ and $Q E D$, we find that $Q F = \frac{O B}{O D} \cdot Q E = \frac{R}{3}$. By the Pythagorean theorem, $Q P^{2} = Q F^{2} + F P^{2}$, or $R^{2} = \frac{1}{9} R^{2} + 4$, from which $R = \frac{3}{\sqrt{2}}$,

$E F = Q E + Q F = \frac{4 R}{3} = 2 \sqrt{2}$.

Let $H$ be the projection of point $A$ onto the line $B C$. Then $B H = B C - C H = B C - A D = 1, A H = E F = 2 \sqrt{2}$.

From the right triangle $A B H$, we find that $A B^{2} = A H^{2} + B H^{2} = 9$.

## Answer

3.