Example 3 Solve the equation $5^{x+1}=3^{x^{2}-1}$.
Take logarithm with base 3 on both sides, we get
$$
(x+1) \log _{3} 5=x^{2}-1,
$$

i.e., $(x+1)\left(x-\log _{3} 5-1\right)=0$, thus $x=-1$ or $x=\log _{3} 5+1$.