1. Simplify the Integrand
To evaluate the integral, divide both the numerator and the denominator by $$x^2$$:
$$\int \frac{x^2+1}{x^4+1} \, dx = \int \frac{1 + \frac{1}{x^2}}{x^2 + \frac{1}{x^2}} \, dx$$
2. Rewrite the Denominator
We can express the denominator $$x^2 + \frac{1}{x^2}$$ in terms of the algebraic identity $$(x - \frac{1}{x})^2$$:
$$\left(x - \frac{1}{x}\right)^2 = x^2 + \frac{1}{x^2} - 2 \implies x^2 + \frac{1}{x^2} = \left(x - \frac{1}{x}\right)^2 + 2$$
Substitute this back into our integral expression:
$$\int \frac{1 + \frac{1}{x^2}}{\left(x - \frac{1}{x}\right)^2 + 2} \, dx$$
3. Use Substitution Method
Let us use the substitution method by setting:
$$u = x - \frac{1}{x}$$
Differentiating both sides with respect to $$x$$ gives:
$$du = \left(1 + \frac{1}{x^2}\right) dx$$
Substitute $$u$$ and $$du$$ into the rewritten integral:
$$\int \frac{1}{u^2 + 2} \, du = \int \frac{1}{u^2 + (\sqrt{2})^2} \, du$$
4. Evaluate the Integral
Using the standard integration formula $$\int \frac{1}{y^2 + a^2} \, dy = \frac{1}{a} \tan^{-1}\left(\frac{y}{a}\right) + C$$, we get:
$$\frac{1}{\sqrt{2}} \tan^{-1}\left(\frac{u}{\sqrt{2}}\right) + C$$
5. Substitute Back the Original Variable
Replace $$u$$ with its original definition $$x - \frac{1}{x}$$:
$$\frac{1}{\sqrt{2}} \tan^{-1}\left(\frac{x - \frac{1}{x}}{\sqrt{2}}\right) + C = \frac{1}{\sqrt{2}} \tan^{-1}\left(\frac{x^2 - 1}{\sqrt{2}x}\right) + C$$