Example 2 Given a sequence of positive numbers $\left\{a_{n}\right\}$ satisfying
$$
\begin{array}{l}
\sqrt{a_{n} a_{n+1}+a_{n} a_{n+2}} \\
=3 \sqrt{a_{n} a_{n+1}+a_{n+1}^{2}}+2 \sqrt{a_{n} a_{n+1}},
\end{array}
$$

and $a_{1}=1, a_{2}=3$. Find the general term formula of the sequence $\left\{a_{n}\right\}$.
Solution: Dividing both sides of the given recurrence relation by $\sqrt{a_{n} a}$, we get
$$
\sqrt{1+\frac{a_{n+2}}{a_{n+1}}}=3 \sqrt{1+\frac{a_{n+1}}{a_{n}}}+2,
$$

which is equivalent to $\sqrt{1+\frac{a_{n+2}}{a_{n+1}}}+1=3\left(\sqrt{1+\frac{a_{n+1}}{a_{n}}}+1\right)$.
Let $b_{n}=\sqrt{1+\frac{a_{n+1}}{a_{n}}}+1$. Then
$$
b_{n+1}=\sqrt{1+\frac{a_{n+2}}{a_{n+1}}}+1 \text {. }
$$

Therefore, $b_{n+1}=3 b_{n}$, i.e., $\frac{b_{n+1}}{b_{n}}=3$.
It is easy to see that $b_{1}=\sqrt{1+\frac{a_{2}}{a_{1}}}+1=3$, so,
$$
b_{n}=3 \times 3^{n-1}=3^{n} \text {. }
$$

Thus, $\sqrt{1+\frac{a_{n+1}}{a_{n}}}+1=3^{n}$, which means
$$
\frac{a_{n+1}}{a_{n}}=\left(3^{n}-1\right)^{2}-1 \text {. }
$$

Hence, $a_{n}=\frac{a_{n}}{a_{n-1}} \cdot \frac{a_{n-1}}{a_{n-2}} \cdot \frac{a_{n-2}}{a_{n-3}} \cdots \cdots \frac{a_{2}}{a_{1}} \cdot a_{1}$
$$
=\prod_{k=1}^{n-1}\left[\left(3^{k}-1\right)^{2}-1\right](n>1) \text {. }
$$

Therefore, the general term formula is
$$
a_{n}=\left\{\begin{array}{ll}
1, & n=1 ; \\
\prod_{k=1}^{n-1}\left[\left(3^{k}-1\right)^{2}-1\right], & n>1 .
\end{array}\right.
$$