Example 8 Solve the equation $\frac{2\left(x^{2}+1\right)}{x+1}+\frac{6(x+1)}{x^{2}+1}=7$.
Solving, we assume
$$
\begin{array}{l}
\frac{2\left(x^{2}+1\right)}{x+1}=\frac{7}{2}+t, \\
\frac{6(x+1)}{x^{2}+1}=\frac{7}{2}-t .
\end{array}
$$

Multiplying the two equations, we get $12=\frac{49}{4}-t^{2}$.
Therefore, $t= \pm \frac{1}{2}$.
When $t=\frac{1}{2}$, $\frac{2\left(x^{2}+1\right)}{x+1}=\frac{7}{2}+\frac{1}{2}$, simplifying and rearranging gives $x^{2}-2 x-1=0$, solving for $x$ yields $x=1 \pm \sqrt{2}$.

When $t=-\frac{1}{2}$, $\frac{2\left(x^{2}+1\right)}{x+1}=\frac{7}{2}-\frac{1}{2}$, simplifying and rearranging gives $2 x^{2}-3 x-1=0$, solving for $x$ yields $x=\frac{3 \pm \sqrt{17}}{4}$.

Upon verification, $x=1 \pm \sqrt{2}, x=\frac{3 \pm \sqrt{17}}{4}$ are all roots of the original equation.