Evaluate the following integrals -
$\int(x+1) \sqrt{x^{2}-x+1} d x$
Let $I=\int(x+1) \sqrt{x^{2}-x+1} d x$
Let us assume $x+1=\lambda \frac{d}{d x}\left(x^{2}-x+1\right)+\mu$
$\Rightarrow x+1=\lambda\left[\frac{d}{d x}\left(x^{2}\right)-\frac{d}{d x}(x)+\frac{d}{d x}(1)\right]+\mu$
We know $\frac{\mathrm{d}}{\mathrm{dx}}\left(\mathrm{x}^{\mathrm{n}}\right)=\mathrm{n} \mathrm{x}^{\mathrm{n}-1}$ and derivative of a constant is 0 .
$\Rightarrow x+1=\lambda\left(2 x^{2-1}-1+0\right)+\mu$
$\Rightarrow x+1=\lambda(2 x-1)+\mu$
$\Rightarrow x+1=2 \lambda x+\mu-\lambda$
Comparing the coefficient of $x$ on both sides, we get
$2 \lambda=1 \Rightarrow \lambda=\frac{1}{2}$
Comparing the constant on both sides, we get
$\mu-\lambda=1$
$\Rightarrow \mu-\frac{1}{2}=1$
$\therefore \mu=\frac{3}{2}$
Hence, we have $x+1=\frac{1}{2}(2 x-1)+\frac{3}{2}$
Substituting this value in I, we can write the integral as
$I=\int\left[\frac{1}{2}(2 x-1)+\frac{3}{2}\right] \sqrt{x^{2}-x+1} d x$
$\Rightarrow I=\int\left[\frac{1}{2}(2 x-1) \sqrt{x^{2}-x+1}+\frac{3}{2} \sqrt{x^{2}-x+1}\right] d x$
$\Rightarrow I=\int \frac{1}{2}(2 x-1) \sqrt{x^{2}-x+1} d x+\int \frac{3}{2} \sqrt{x^{2}-x+1} d x$
$\Rightarrow I=\frac{1}{2} \int(2 x-1) \sqrt{x^{2}-x+1} d x+\frac{3}{2} \int \sqrt{x^{2}-x+1} d x$
Let $I_{1}=\frac{1}{2} \int(2 x-1) \sqrt{x^{2}-x+1} d x$
Now, put $x^{2}-x+1=t$
$\Rightarrow(2 x-1) d x=d t$ (Differentiating both sides)
Substituting this value in $\mathrm{I}_{1}$, we can write
$\mathrm{I}_{1}=\frac{1}{2} \int \sqrt{\mathrm{t} \mathrm{dt}}$
$\Rightarrow \mathrm{I}_{1}=\frac{1}{2} \int \mathrm{t}^{\frac{1}{2}} \mathrm{dt}$
Recall $\int x^{n} d x=\frac{x^{n+1}}{n+1}+c$
$\Rightarrow \mathrm{I}_{1}=\frac{1}{2}\left(\frac{\mathrm{t} \frac{1}{2}+1}{\frac{1}{2}+1}\right)+\mathrm{c}$
$\Rightarrow \mathrm{I}_{1}=\frac{1}{2}\left(\frac{\mathrm{t}^{\frac{3}{2}}}{\frac{3}{2}}\right)+\mathrm{c}$
$\Rightarrow \mathrm{I}_{1}=\frac{1}{2} \times \frac{2}{3} \mathrm{t} \frac{3}{2}+\mathrm{c}$
$\Rightarrow \mathrm{I}_{1}=\frac{1}{3} \mathrm{t} \frac{3}{2}+\mathrm{c}$
$\therefore \mathrm{I}_{1}=\frac{1}{3}\left(\mathrm{x}^{2}-\mathrm{x}+1\right)^{\frac{3}{2}}+\mathrm{c}$
Let $\mathrm{I}_{2}=\frac{3}{2} \int \sqrt{\mathrm{x}^{2}-\mathrm{x}+1} \mathrm{dx}$
We can write $x^{2}-x+1=x^{2}-2(x)\left(\frac{1}{2}\right)+\left(\frac{1}{2}\right)^{2}-\left(\frac{1}{2}\right)^{2}+1$
$\Rightarrow x^{2}-x+1=\left(x-\frac{1}{2}\right)^{2}-\frac{1}{4}+1$
$\Rightarrow x^{2}-x+1=\left(x-\frac{1}{2}\right)^{2}+\frac{3}{4}$
$\Rightarrow x^{2}-x+1=\left(x-\frac{1}{2}\right)^{2}+\left(\frac{\sqrt{3}}{2}\right)^{2}$
Hence, we can write $I_{2}$ as
$I_{2}=\frac{3}{2} \int \sqrt{\left(x-\frac{1}{2}\right)^{2}+\left(\frac{\sqrt{3}}{2}\right)^{2}} d x$
Recall $\int \sqrt{\mathrm{x}^{2}+\mathrm{a}^{2}} \mathrm{dx}=\frac{\mathrm{x}}{2} \sqrt{\mathrm{x}^{2}+\mathrm{a}^{2}}+\frac{\mathrm{a}^{2}}{2} \ln \left|\mathrm{x}+\sqrt{\mathrm{x}^{2}+\mathrm{a}^{2}}\right|+\mathrm{c}$
$\Rightarrow I_{2}=\frac{3}{2}\left[\frac{\left(x-\frac{1}{2}\right)}{2} \sqrt{\left(x-\frac{1}{2}\right)^{2}+\left(\frac{\sqrt{3}}{2}\right)^{2}}\right.$
$\left.+\frac{\left(\frac{\sqrt{3}}{2}\right)^{2}}{2} \ln \left|\left(x-\frac{1}{2}\right)+\sqrt{\left(x-\frac{1}{2}\right)^{2}+\left(\frac{\sqrt{3}}{2}\right)^{2}}\right|\right]+c$
$\Rightarrow \mathrm{I}_{2}=\frac{3}{2}\left[\frac{2 \mathrm{x}-1}{4} \sqrt{\mathrm{x}^{2}-\mathrm{x}+1}+\frac{3}{8} \ln \left|\mathrm{x}-\frac{1}{2}+\sqrt{\mathrm{x}^{2}-\mathrm{x}+1}\right|\right]+\mathrm{c}$
$\therefore \mathrm{I}_{2}=\frac{3}{8}(2 \mathrm{x}-1) \sqrt{\mathrm{x}^{2}-\mathrm{x}+1}+\frac{9}{16} \ln \left|\mathrm{x}-\frac{1}{2}+\sqrt{\mathrm{x}^{2}-\mathrm{x}+1}\right|+\mathrm{c}$
Substituting $I_{1}$ and $I_{2}$ in $I$, we get
$I=\frac{1}{3}\left(x^{2}-x+1\right)^{\frac{3}{2}}+\frac{3}{8}(2 x-1) \sqrt{x^{2}-x+1}+\frac{9}{16} \ln \left|x-\frac{1}{2}+\sqrt{x^{2}-x+1}\right|+c$
Thus, $\int(\mathrm{x}+1) \sqrt{\mathrm{x}^{2}-\mathrm{x}+1} \mathrm{dx}=\frac{1}{3}\left(\mathrm{x}^{2}-\mathrm{x}+1\right)^{\frac{3}{2}}+\frac{3}{8}(2 \mathrm{x}-1) \sqrt{\mathrm{x}^{2}-\mathrm{x}+1}+$ $\frac{9}{16} \ln \left|x-\frac{1}{2}+\sqrt{x^{2}-x+1}\right|+c$