#### Provide Solution For R.D.Sharma Maths Class 12 Chapter 18  Indefinite Integrals Exercise  Revision Exercise Question 128 Maths Textbook Solution.

Answer:$-2 \log |x+1|-\frac{1}{x+1}+3 \log |x+2|+C$

Given: $\int \frac{x^{2}+x+1}{(x+1)^{2}(x+2)} d x$

Hint: using partial fraction

Explanation: let $I=\int \frac{x^{2}+x+1}{(x+1)^{2}(x+2)} d x$

$\frac{x^{2}+x+1}{(x+1)^{2}(x+2)}=\frac{A}{(x+1)}+\frac{B}{(x+1)^{2}}+\frac{C}{(x+2)}$

Multiplying by : $(x+1)^{2}(x+2)$

$x^{2}+x+1=A(x+1)(x+2)+B(x+2)+C(x+1)^{2}$

Putting x=-1

$x^{2}+x+1=A(x+1)(u+2)+B(x+2)+C(x+1)^{2}$

\begin{aligned} &\text { putting } x=-1\\ &1-1+1=A(0)(1)+B(1)+C(0)\\ &=0+B+0=>B=1 \end{aligned}

\begin{aligned} &\text { putting } x=-2 \\ &4+(-2)+1=A(-1)(0)+B(0)+C(1) \\ &3=0+0+C=>3 \end{aligned}

\begin{aligned} &\text { putting } x=0\\ &0+0+1=A(1)(2)+B(2)+C(1)\\ &1=2 A+2 B+C\\ &1=2 A+2(1)+3\\ &2 A=-4 \Rightarrow A=-2 \end{aligned}

$\frac{x^{2}+x+1}{(x+1)^{2}+x+2}=\frac{-2}{x+1}+\frac{1}{(x+1)^{2}}+\frac{3}{x+2}$

$\int \frac{x^{2}+x+1}{(x+1)^{2}+x+2}=-2 \int \frac{1}{x+1} d x+1 \int \frac{1}{(x+1)^{2}} d x+3 \int \frac{d x}{x+2}$

$=-2 \log |x+1|+1 \int(x+1)^{-2} d x+3 \log |x+2|+C$

$=-2 \log |x+1|+1\left[\frac{(x+1)^{2+1}}{-2+1}\right]+3 \log |x+2|+C$

$=-2 \log |x+1|-\frac{1}{x+1}+3 \log |x+2|+C$