#### explain solution RD Sharma class 12 Chapter 18 Indefinite Integrals exercise 18.30 question 14

$\frac{3}{5} \log |x+2|+\frac{1}{5} \log \left|x^{2}+1\right|+\frac{1}{5} \tan ^{-1} x+C$

Hint:

To solve this integration, we use partial fraction method

Given:

$\int \frac{x^{2}+x+1}{\left(x^{2}+1\right)(x+2)} d x \\$

Explanation:

Let

\begin{aligned} &I=\int \frac{x^{2}+x+1}{\left(x^{2}+1\right)(x+2)} d x \\ &\frac{x^{2}+x+1}{\left(x^{2}+1\right)(x+2)}=\frac{A}{x+2}+\frac{B x+C}{x^{2}+1} \end{aligned}
\begin{aligned} &\frac{x^{2}+x+1}{\left(x^{2}+1\right)(x+2)}=\frac{A\left(x^{2}+1\right)+(B x+C)(x+2)}{(x+2)\left(x^{2}+1\right)} \\ &x^{2}+x+1=A\left(x^{2}+1\right)+B x^{2}+2 B x+C x+2 C \\ &x^{2}+x+1=x^{2}(A+B)+(2 B+C) x+(A+2 C) \end{aligned}

Comparing the coefficient

$A+B=1$           (1)

$2B+C=1$        (2)

$A+2C=1$         (3)

Subtract equation (3) from equation (1), we get

\begin{aligned} &A+B=1 \quad- \\ &\frac{A+2 C=1}{B-2 C=0} \\ &B=2 C \end{aligned}

Equation (2)

\begin{aligned} &2(2 C)+C=1 \\ &4 C+C=1 \\ &5 C=1 \\ &C=\frac{1}{5} \\ &B=\frac{2}{5} \end{aligned}

Equation (1)

\begin{aligned} &A+\frac{2}{5}=1 \\ &A=1-\frac{2}{5} \\ &A=\frac{3}{5} \end{aligned}

Now

$\frac{x^{2}+x+1}{\left(x^{2}+1\right)(x+2)}=\frac{3}{5(x+2)}+\frac{\frac{2}{5} x+\frac{1}{5}}{\left(x^{2}+1\right)}$

$\frac{x^{2}+x+1}{\left(x^{2}+1\right)(x+2)}=\frac{3}{5(x+2)}+\frac{2 x+1}{5\left(x^{2}+1\right)}$

\begin{aligned} &I=\frac{3}{5} \int \frac{1}{x+2} d x+\frac{1}{5} \int \frac{2 x+1}{x^{2}+1} d x \\ &I=\frac{3}{5} \log |x+2|+\frac{1}{5} \int \frac{2 x}{x^{2}+1} d x+\frac{1}{5} \int \frac{1}{x^{2}+1} d x+C \\ &I=\frac{3}{5} \log |x+2|+\frac{1}{5} \log \left|x^{2}+1\right|+\frac{1}{5} \tan ^{-1} x+C \end{aligned}