Example 3. Find $\lim _{x \rightarrow \frac{\pi}{2}} \frac{\tan x}{\tan 3 x}$.
Solution. Using the L'Hôpital-Bernoulli rule, we get

$$
\lim _{x \rightarrow \frac{\pi}{2}} \frac{\tan x}{\tan 3 x}=\lim _{x \rightarrow \frac{\pi}{2}} \frac{\frac{1}{\cos ^{2} x}}{\frac{3}{\cos ^{2} 3 x}}=\lim _{x \rightarrow \frac{\pi}{2}} \frac{\cos ^{2} 3 x}{3 \cos ^{2} x}
$$

The limit of the ratio of the first derivatives is an indeterminate form of $\frac{0}{0}$. We resolve this indeterminate form:

$$
\lim _{x \rightarrow \frac{\pi}{2}} \frac{\cos ^{2} 3 x}{3 \cos ^{2} x}=\lim _{x \rightarrow \frac{\pi}{2}} \frac{-6 \cos 3 x \sin 3 x}{-6 \cos x \sin x}=\lim _{x \rightarrow \frac{\pi}{2}} \frac{\sin 6 x}{\sin 2 x}
$$

Again, we have an indeterminate form of $\frac{0}{0}$. Applying the L'Hôpital-Bernoulli rule once more, we find

$$
\lim _{x \rightarrow \frac{\pi}{2}} \frac{\sin 6 x}{\sin 2 x}=\lim _{x \rightarrow \frac{\pi}{2}} \frac{6 \cos 6 x}{2 \cos 2 x}=\frac{6}{2}=3
$$

Thus,

$$
\lim _{x \rightarrow \frac{\pi}{2}} \frac{\tan x}{\tan 3 x}=3
$$