# Evaluate the following integrals:

Question:

Evaluate the following integrals:

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

Solution:

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

Expressing the integral $\int \frac{\mathrm{P}(\mathrm{x})}{\mathrm{ax}^{2}+\mathrm{bx}+\mathrm{c}} \mathrm{dx}=\int \mathrm{Q}(\mathrm{x}) \mathrm{dx}+\int \frac{\mathrm{R}(\mathrm{x})}{\mathrm{ax}^{2}+\mathrm{bx}+\mathrm{c}} \mathrm{dx}$

$\Rightarrow \int \frac{\mathrm{x}^{2}+\mathrm{x}+1}{(\mathrm{x}-1) \mathrm{x}} \mathrm{dx}$

$\Rightarrow \int\left(\frac{2 \mathrm{x}+1}{(\mathrm{x}-1) \mathrm{x}}+1\right) \mathrm{dx}$

$\Rightarrow \int \frac{2 \mathrm{x}+1}{(\mathrm{x}-1) \mathrm{x}} \mathrm{dx}+\int 1 \mathrm{dx}$

Consider $\int \frac{2 x+1}{(x-1) x} d x$

By partial fraction decomposition,

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

$\Rightarrow 2 x+1=A x+B(x-1)$

$\Rightarrow 2 x+1=A x+B x-B$

$\Rightarrow 2 x+1=(A+B) x-B$

$\therefore B=-1$ and $A+B=2$

$\therefore A=2+1=3$

Thus, $\Rightarrow \frac{2 x+1}{(x-1) x}=\frac{3}{x-1}-\frac{1}{x}$

$\Rightarrow \int\left(\frac{3}{x-1}-\frac{1}{x}\right) d x$

$\Rightarrow 3 \int \frac{1}{x-1} d x-\int \frac{1}{x} d x$

Consider $\int \frac{1}{x-1} d x$

Substitute $u=x-1 \rightarrow d x=d u$

$\Rightarrow \int \frac{1}{x-1} d x=\int \frac{1}{u} d u$

We know that $\int \frac{1}{x} d x=\log |x|+c$

$\therefore \int \frac{1}{\mathrm{u}} \mathrm{du}=\log |\mathrm{u}|=\log |\mathrm{x}-1|$

Then,

$\Rightarrow 3 \int \frac{1}{x-1} d x-\int \frac{1}{x} d x=3(\log |x-1|)-\int \frac{1}{x} d x$

$=3(\log |x-1|)-\log |x|$

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

Then,

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

We know that $\int 1 \mathrm{dx}=\mathrm{x}+\mathrm{c}$

$\Rightarrow \int \frac{2 x+1}{(x-1) x} d x+\int 1 d x=3(\log |x-1|)-\log |x|+x+c$

$\therefore \mathrm{I}=\int \frac{\mathrm{x}^{2}+\mathrm{x}+1}{\mathrm{x}^{2}-\mathrm{x}} \mathrm{dx}=-\log |\mathrm{x}|+\mathrm{x}+3(\log |\mathrm{x}-1|)+\mathrm{c}$