3. [4] Let $A B C$ be a triangle with $\angle B A C=90^{\circ}$. A circle is tangent to the sides $A B$ and $A C$ at $X$ and $Y$ respectively, such that the points on the circle diametrically opposite $X$ and $Y$ both lie on the side $B C$. Given that $A B=6$, find the area of the portion of the circle that lies outside the triangle.
diametrically opposite $X$ and $Y$, respectively. We have $O X^{\prime}=O Y^{\prime}=r$, and $\angle X^{\prime} O Y^{\prime}=90^{\circ}$. Since triangles $X^{\prime} O Y^{\prime}$ and $B A C$ are similar, we see that $A B=A C$. Let $X^{\prime \prime}$ be the projection of $Y^{\prime}$ onto $A B$. Since $X^{\prime \prime} B Y^{\prime}$ is similar to $A B C$, and $X^{\prime \prime} Y^{\prime}=r$, we have $X^{\prime \prime} B=r$. It follows that $A B=3 r$, so $r=2$.

Then, the desired area is the area of the quarter circle minus that of the triangle $X^{\prime} O Y^{\prime}$. And the answer is $\frac{1}{4} \pi r^{2}-\frac{1}{2} r^{2}=\pi-2$.