# Evaluate the following integrals:

Question:

Evaluate the following integrals:

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

Solution:

Given $I=\int \frac{x^{3}+x^{2}+2 x+1}{x^{2}-x+1} 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{x^{3}+x^{2}+2 x+1}{x^{2}-x+1} d x=\int \frac{3 x-1}{x^{2}-x+1}+x+2 d x$

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

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

Let $3 x-1=\frac{3}{2}(2 x-1)+\frac{1}{2}$ and split,

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

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

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

Let $\mathrm{u}=\mathrm{x}^{2}-\mathrm{x}+1 \rightarrow \mathrm{dx}=\frac{1}{2 \mathrm{x}-1} \mathrm{du}$

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

$=\int \frac{1}{\mathrm{u}} \mathrm{du}$

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

$\Rightarrow \int \frac{1}{\mathrm{u}} \mathrm{du}=\log |\mathrm{u}|=\log \left|\mathrm{x}^{2}-\mathrm{x}+1\right|$

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

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

Let $u=\frac{2 x-1}{\sqrt{3}} \rightarrow d x=\frac{\sqrt{3}}{2} d u$

$\Rightarrow \int \frac{1}{\left(\mathrm{x}-\frac{1}{2}\right)^{2}+\frac{3}{4}} \mathrm{dx}=\int \frac{2 \sqrt{3}}{3 \mathrm{u}^{2}+3} \mathrm{du}$

$=\frac{2}{\sqrt{3}} \int \frac{1}{\mathrm{u}^{2}+1} \mathrm{du}$

We know that $\int \frac{1}{x^{2}+1} d x=\tan ^{-1} x+c$

$\Rightarrow \frac{2}{\sqrt{3}} \int \frac{1}{u^{2}+1} d u=\frac{2 \tan ^{-1} u}{\sqrt{3}}=\frac{2 \tan ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right)}{\sqrt{3}}$

Then,

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

$=\frac{3}{2}\left(\log \left|x^{2}-x+1\right|\right)+\frac{1}{2}\left(\frac{2 \tan ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right)}{\sqrt{3}}\right)$

$=\frac{3 \log \left|\mathrm{x}^{2}-\mathrm{x}+1\right|}{2}+\frac{\tan ^{-1}\left(\frac{2 \mathrm{x}-1}{\sqrt{3}}\right)}{\sqrt{3}}$

Then,

$\Rightarrow \int \frac{\mathrm{x}^{3}+\mathrm{x}^{2}+2 \mathrm{x}+1}{\mathrm{x}^{2}-\mathrm{x}+1} \mathrm{dx}=\int \frac{3 \mathrm{x}-1}{\mathrm{x}^{2}-\mathrm{x}+1} \mathrm{dx}+\int \mathrm{x} \mathrm{dx}+2 \int 1 \mathrm{dx}$

We know that $\int x^{n} d x=\frac{x^{n+1}}{n+1}+c$ and $\int 1 d x=x+c$

\begin{aligned} \Rightarrow \int \frac{3 x-1}{x^{2}-x+1} d x+\int x d x+2 \int & 1 d x \\=& \frac{3 \log \left|x^{2}-x+1\right|}{2}+\frac{\tan ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right)}{\sqrt{3}}+\frac{x^{2}}{2}+2 x+c \end{aligned}

$=\frac{3 \log \left|x^{2}-x+1\right|+x^{2}+4 x}{2}+\frac{\tan ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right)}{\sqrt{3}}+c$

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