# How do you use trig substitution to evaluate integral x/sqrt(x^2+x+1)dx?

Apr 9, 2018

$\int \frac{x}{\sqrt{{x}^{2} + x + 1}} \mathrm{dx} = \sqrt{{x}^{2} + x + 1} - \frac{1}{2} \ln \left\mid 2 x + 1 + 2 \sqrt{{x}^{2} + x + 1} \right\mid + C$

#### Explanation:

Write the numerator of integrand as:

$x = \frac{1}{2} \left(2 x + 1\right) - \frac{1}{2}$

and note that:

$\frac{d}{\mathrm{dx}} \left({x}^{2} + x + 1\right) = 2 x + 1$

Then:

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

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

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

Solve now the resulting integral by completing the square at the denominator:

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

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

Substitute now:

$2 x + 1 = \sqrt{3} \tan t$ with $t \in \left(- \frac{\pi}{2} , \frac{\pi}{2}\right)$

$\mathrm{dx} = \frac{\sqrt{3}}{2} {\sec}^{2} t \mathrm{dt}$

to have:

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{\sqrt{3}}{2} \int \frac{{\sec}^{2} t \mathrm{dt}}{\sqrt{3 {\tan}^{2} t + 3}}$

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \int \frac{{\sec}^{2} t \mathrm{dt}}{\sqrt{{\tan}^{2} t + 1}}$

Use the trigonometric identity:

${\tan}^{2} t + 1 = {\sec}^{2} t$

and as for $t \in \left(- \frac{\pi}{2} , \frac{\pi}{2}\right)$ the secant is positive:

$\sqrt{{\tan}^{2} t + 1} = \sec t$

Then:

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \int \frac{{\sec}^{2} t \mathrm{dt}}{\sec} t$

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \int \sec t \mathrm{dt}$

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \ln \left\mid \sec t + \tan t \right\mid + C$

and undoing the substitution:

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \ln \left\mid \frac{2 x + 1}{\sqrt{3}} + \sqrt{{\left(2 x + 1\right)}^{2} / 3 + 1} \right\mid + C$

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \ln \left\mid \left(2 x + 1\right) + \sqrt{{\left(2 x + 1\right)}^{2} + 3} \right\mid + C$

$\frac{1}{2} \int \frac{\mathrm{dx}}{\sqrt{{x}^{2} + x + 1}} = \frac{1}{2} \ln \left\mid 2 x + 1 + 2 \sqrt{{x}^{2} + x + 1} \right\mid + C$

Putting the partial solutions together:

$\int \frac{x}{\sqrt{{x}^{2} + x + 1}} \mathrm{dx} = \sqrt{{x}^{2} + x + 1} - \frac{1}{2} \ln \left\mid 2 x + 1 + 2 \sqrt{{x}^{2} + x + 1} \right\mid + C$