Q: Integrate the function $\frac{1}{\left(x^2+1\right)\left(x^2+4\right)}$
Given, $\frac{1}{\left(x^2+1\right)\left(x^2+4\right)}$
Let $I=\int \frac{1}{\left(x^2+1\right)\left(x^2+4\right)}$
Now, Using partial differentiation,
$\frac{1}{\left(x^2+1\right)\left(x^2+4\right)}=\frac{A x+B}{\left(x^2+1\right)}+\frac{C x+D}{\left(x^2+4\right)}$
$\implies \frac{1}{\left(x^2+1\right)\left(x^2+4\right)}=\frac{(A x+B)\left(x^2+4\right)+(C x+D)\left(x^2+1\right)}{\left(x^2+1\right)\left(x^2+4\right)}$
$\implies 1=(A x+B)\left(x^2+4\right)+(C x+D)\left(x^2+1\right)$
$\implies 1=A x^3+4 A x+B x^2+4 B+C x^3+C x+D x^2+D$
$\implies (A+C) x^3+(B+D) x^2+(4 A+C) x+(4 B+D)=1$
Equating the coefficients of $x, x^2, x^3$ and constant value,
$A+C=0 \implies C=-A$
$B+D=0 \implies B=-D$
$4 A+C=0 \implies 4 A=-C \implies 4 A=A \implies A=0=C$
$4 B+D=1 \implies 4 B-B=1 \implies B=\frac{1}{3}=-D$
Putting these values in equation, we have
$\Rightarrow \frac{1}{\left(x^2+1\right)\left(x^2+4\right)}=\frac{(0) x+\frac{1}{3}}{\left(x^2+1\right)}+\frac{(0) x+\left(-\frac{1}{3}\right)}{\left(x^2+4\right)}$
$\frac{1}{\left(x^2+1\right)\left(x^2+4\right)}=\frac{\frac{1}{3}}{\left(x^2+1\right)}+\frac{\left(-\frac{1}{3}\right)}{\left(x^2+4\right)}$
$\Rightarrow \int \frac{1}{\left(x^2+1\right)\left(x^2+4\right)} d x=\frac{1}{3} \cdot \int \frac{1}{\left(x^2+1\right)} d x-\frac{1}{3} \cdot \int \frac{1}{\left(x^2+4\right)} d x$
$=\frac{1}{3} \cdot \tan ^{-1} x-\frac{1}{3} \cdot \frac{1}{2} \tan ^{-1} \frac{x}{2}+C$
$\Rightarrow I=\frac{1}{3} \tan ^{-1} x-\frac{1}{6} \tan ^{-1} \frac{x}{2}+C$