Given a point $P(3,1)$ and two lines $l_{1}: x+2 y+3=0, l_{2}: x+2 y-7=0$, find the equation of the circle passing through $P$ and tangent to both $l_{1}$ and $l_{2}$.
From the given conditions, we know that $l_{1} / / l_{2}$. As shown in the figure, the center of the circle lies on the line $l_{3}: x+2 y-2=0$, and the radius is half the distance between the two parallel lines $l_{1}$ and $l_{2}$. Take any point on $l_{1}$, such as $(-1, -1)$. The distance from this point to $l_{2}$ is $\left|\frac{-1-2-7}{\sqrt{1^{2}+2^{2}}}\right|=2 \sqrt{5}$.
This is the distance between $l_{1}$ and $l_{2}$, so the radius of the circle is $\sqrt{5}$.
Let the coordinates of the center of the circle be $(\alpha, \beta)$. Since the center of the circle lies on the line $l_{3}$, we have $\alpha+2 \beta-2=0$, so $\alpha=2-2 \beta$. Substituting this expression and the coordinates into the circle equation $(x-u)^{2}+(y-b)^{2}=R^{2}$, we get $(2-2 \beta-3)^{2}+(\beta-1)^{2}=5$, which simplifies to $(5 \beta-3)(\beta+1)=0$. Solving this, we get $\left\{\begin{array}{l}\alpha=1, \\ \beta=-1 ;\end{array}\left\{\begin{array}{l}\alpha=\frac{4}{5}, \\ \beta=\frac{3}{5}\end{array}\right.\right.$ Therefore, the equations of the circle are
$$
(x-4)^{2}+(y+1)^{2}=5 \text { or }\left(x-\frac{4}{5}\right)^{2}+\left(y-\frac{3}{5}\right)^{2}=5 \text {. }
$$