Multiplying both sides by \( x \):
\[
x^2 + 1 = 3x.
\]
\[
x^2 - 3x + 1 = 0.
\]
Using the quadratic formula:
\[
x = \frac{-(-3) \pm \sqrt{(-3)^2 - 4(1)(1)}}{2(1)}.
\]
\[
= \frac{3 \pm \sqrt{9 - 4}}{2}.
\]
\[
= \frac{3 \pm \sqrt{5}}{2}.
\]
Thus, the roots are:
\[
\frac{3+\sqrt{5}}{2}, \quad \frac{3-\sqrt{5}}{2}.
\]