#### Explain Solution R.D.Sharma Class 12 Chapter 18 Indefinite Integrals Exercise 18.20 Question 1 maths Textbook Solution.

Answer: $x+\log \left|x^{2}-x\right|+2 \log |x-1|-2 \log |x|+c$

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

Hint: Using Partial fraction and $\int \frac{1}{x} d x$

Explanation: Let $I=\int \frac{x^{2}+x+1}{x^{2}-x} d x$

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

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

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

\begin{aligned} &=\int 1 d x+\int \frac{2 x-1}{x^{2}-x} d x+2 \int \frac{1}{x^{2}-x} d x\\ &=x+\log \left|x^{2}-x\right|+2 I_{1} \quad \ldots \ldots \end{aligned}(1)

where, $I_{1}=\int \frac{1}{x^{2}-x} d x$

Now,$\int \frac{1}{x^{2}-x} d x=\int \frac{1}{x(x-1)} d x$

$\frac{1}{x(x-1)}=\frac{A}{x}+\frac{B}{x-1}$

Multiplying by  $x(x-1)$

$1=A(x-1)+B(x)$

Putting

\begin{aligned} &x=1 \\ &1=A(1-1)+B(1) \Rightarrow B=1 \end{aligned}

Putting

\begin{aligned} &x=0 \\ &1=A(0-1)+B(0) \Rightarrow A=-1 \end{aligned}

\begin{aligned} &\therefore \frac{1}{x(x-1)}=\frac{-1}{x}+\frac{1}{x-1} \\ &\therefore \int \frac{1}{x(x-1)} d x=-\int \frac{1}{x} d x+\int \frac{1}{x-1} d x \\ &\therefore I_{1}=-\log |x|+\log |x-1| \end{aligned}

Put in (1)

\begin{aligned} &I=x+\log \left|x^{2}-x\right|+2[-\log |x|+\log |x-1|] \\ &=x+\log \left|x^{2}-x\right|-2 \log |x|+2 \log |x-1|+c \end{aligned}