# `int x/sqrt(x^2 + x + 1) dx` Evaluate the integral

`intx/sqrt(x^2+x+1)dx`

Let's rewrite the integrand by completing the square of the denominator,

`=intx/sqrt((x+1/2)^2+3/4)dx`

Now let's apply the integral substitution,

Let `u=x+1/2`

`x=u-1/2`

du=1dx

`=int(u-1/2)/sqrt(u^2+3/4)du`

`=int(2u-1)/sqrt(4u^2+3)du`

Now apply the sum rule,

`=int(2u)/sqrt(4u^2+3)du-int1/sqrt(4u^2+3)du`

`=2intu/sqrt(4u^2+3)du-int1/sqrt(4u^2+3)du`

Now let's evaluate the first integral by applying the integral substitution,

Let `v=4u^2+3`

`dv=8udu`

`intu/sqrt(4u^2+3)du=int1/(8sqrt(v))dv`

`=1/8intv^(-1/2)dv`

`=1/8(v^(-1/2+1))/(-1/2+1)`

`=1/8v^(1/2)/(1/2)`

`=2/8v^(1/2)`

`=1/4sqrt(v)`

substitute back `v=4u^2+3`

`=1/4sqrt(4u^2+3)`

Now let's evaluate the second integral `int1/sqrt(4u^2+3)du` using integral substitution,

For `sqrt(bx^2+a)` substitute `x=sqrt(a)/sqrt(b)tan(v)` ,

Let `u=sqrt(3)/2tan(v)`

`du=sqrt(3)/2sec^2(v)dv`

`int1/sqrt(4v^2+3)du=int(sqrt(3)/2sec^2(v))/sqrt(4(sqrt(3)/2tan(v))^2+3)dv`

`=int(sqrt(3)sec^2(v))/(2sqrt(3tan^2(v)+3))dv`

`=sqrt(3)/2int(sec^2(v))/sqrt(3tan^2(v)+3)dv`

`=sqrt(3)/2int(sec^2(v))/(sqrt(3)sqrt(tan^2+1))dv`

`=1/2int(sec^2(v))/sqrt(tan^2(v)+1)dv`

Now use the identity:`1+tan^2(x)=sec^2(x)`

`=1/2int(sec^2(v))/sqrt(sec^2(v))dv`

assuming sec(v)`>=0`

`=1/2intsec(v)dv`

Now using the common integral,

`intsec(v)dx=ln((sec(v)+tan(v))`

`=1/2(ln(sec(v)+tan(v))`

Substitute back `v=arctan((2u)/sqrt(3))`

`=1/2[ln{sec(arctan((2u)/sqrt(3)))+tan(arctan((2u)/sqrt(3))}]`

`=1/2[ln{sqrt(1+(4u^2)/3)+(2u)/sqrt(3)}]`

`int(2u-1)/sqrt(4u^2+3)du=2(1/4sqrt(4u^2+3))-1/2ln(sqrt(1+4u^2/3)+(2u)/sqrt(3))`

`=1/2sqrt(4u^2+3)-1/2ln(sqrt(1+(4u^2)/3)+(2u)/sqrt(3))`

Substitute back `u=x+1/2`

`=1/2sqrt(4(x+1/2)^2+3)-1/2ln(sqrt(1+(4(x+1/2)^2)/3)+(2(x+1/2))/sqrt(3))`

`=1/2sqrt(4(x^2+1/4+x)+3)-1/2ln(sqrt(1+4/3(x^2+1/4+x))+(2/sqrt(3))(2x+1)/2)`

`=1/2sqrt(4x^2+1+4x+3)-1/2ln(sqrt((3+4x^2+1+4x)/3)+(2x+1)/sqrt(3))`

`=1/2sqrt(4x^2+4x+4)-1/2ln(sqrt((4x^2+4x+4)/3)+(2x+1)/sqrt(3))`

`=1/2sqrt(4(x^2+x+1))-1/2ln((2/sqrt(3))sqrt(x^2+x+1)+(2x+1)/sqrt(3))`

`=sqrt(x^2+x+1)-1/2ln((2sqrt(x^2+x+1)+2x+1)/sqrt(3))`

add a constant C to the solution,

`=sqrt(x^2+x+1)-1/2ln((2sqrt(x^2+x+1)+2x+1)/sqrt(3))+C`