Let \(y = 3^x\). Then \(3^{-x} = \frac{1}{y}\).
The equation becomes \(\frac{y^2 + \frac{1}{y}}{y^2 - \frac{1}{y}} = 4\).
Multiply numerator and denominator by \(y\) to clear the fraction:
\(\frac{y^3 + 1}{y^3 - 1} = 4\).
Cross-multiply to get:
\(y^3 + 1 = 4(y^3 - 1)\).
Expand and simplify:
\(y^3 + 1 = 4y^3 - 4\).
Rearrange terms:
\(3y^3 = 5\).
So, \(y^3 = \frac{5}{3}\).
Since \(y = 3^x\), we have \((3^x)^3 = \frac{5}{3}\).
Thus, \(3^{3x} = \frac{5}{3}\).
Take the logarithm of both sides:
\(3x \log 3 = \log \left( \frac{5}{3} \right)\).
Solve for \(x\):
\(x = \frac{\log \left( \frac{5}{3} \right)}{3 \log 3}\).
Calculate \(x\) to 3 decimal places:
\(x \approx 0.155\).