Indefinite Integration

Evaluate $\displaystyle \int \dfrac{x^2 + 1}{x^4 + 1} \; dx$


$\begin{aligned} \text{Let } I & = \displaystyle \int \dfrac{x^2 + 1}{x^4 + 1} \; dx \\\\ & = \displaystyle \int \dfrac{1 + \dfrac{1}{x^2}}{x^2 + \dfrac{1}{x^2}} \; dx \;\;\; \cdots (1) \end{aligned}$

Now, $\left(x - \dfrac{1}{x}\right)^2 = x^2 - 2 + \dfrac{1}{x^2}$

$\implies$ $x^2 + \dfrac{1}{x^2} = \left(x - \dfrac{1}{x}\right)^2 + 2$ $\;\;\; \cdots$ (2)

In view of equation (2), equation (1) becomes

$I = \displaystyle \int \dfrac{1 + \dfrac{1}{x^2}}{\left(x - \dfrac{1}{x}\right)^2 + 2} \; dx$ $\;\;\;\; \cdots$ (3)

Let $x - \dfrac{1}{x} = t$ $\;\;\; \cdots$ (4a)

Differentiating equation (4a) gives,

$\left(1 + \dfrac{1}{x^2}\right) \; dx = dt$ $\;\;\; \cdots$ (4b)

Substituting equations (4a) and (4b) in equation (3) gives

$\begin{aligned} I & = \int \dfrac{dt}{t^2 + 2} \\\\ & = \int \dfrac{dt}{\left(t\right)^2 + \left(\sqrt{2}\right)^2} \\\\ & = \dfrac{1}{\sqrt{2}} \; \tan^{-1} \left(\dfrac{t}{\sqrt{2}}\right) + c \;\;\; \left[\text{Note: } \int \dfrac{dx}{x^2 + a^2} = \dfrac{1}{a} \tan^{-1} \left(\dfrac{x}{a}\right) + c\right] \\\\ & = \dfrac{1}{\sqrt{2}} \tan^{-1} \left(\dfrac{x - \dfrac{1}{x}}{\sqrt{2}}\right) + c \;\;\; \left[\text{From equation (4a)}\right] \\\\ & = \dfrac{1}{\sqrt{2}} \tan^{-1} \left(\dfrac{x^2 - 1}{x \sqrt{2}}\right) + c \end{aligned}$