<s>[INST] Solve $\int (4x+2)\sqrt{x^2+x+1}\,dx$ Trying to solve this for a while now, so far I was able to come up without a proper answer.
Problem : $\displaystyle \int (4x+2)\sqrt{x^2+x+1}\,dx$. 
I tried to take two common from $(4x+2)$ and also to take $(x+1)^2 - x$ from the root, but wasn't able to come up with something to take for substitution. A hint in the right direction would be highly appreciated
Edit :
I forgot to mention this. As this is part of the integration by substitution exercise it'd be highly appreciated if you could provide the hint in that direction.
 [/INST] I'm extremely new to integration and my methods are sloppy but I'd like to try out this question. The following isn't an answer but a demonstration that any substitution can do the job as long as it is done right (Although, a fundamental zen of calculus dictates that the rightest way is the fastest way, I think any path is better than no path)
I'm going to try my luck with $u = 4x+2 \implies \frac{du}{dx} = 4 \implies dx= \frac{1}{4} du$
Also, by the above assumption, $x = \frac{u-2}{4}$ 
$$
\require{cancel}
\begin{align}
&\int (4x+2)\sqrt{x^2+x+1}\,dx \\
&= \int{u\cdot\sqrt{\left(\frac{u-2}{4}\right)^2 + \frac{u-2}{4}+ 1}}\cdot\frac{1}{4} du\\
&= \frac{1}{4} \int{u}\cdot\sqrt{\frac{u^2 - 4u + 4 +4(u-2) + 4^2}{4^2}}\, du\\
&= \frac{1}{4} \int{ u \cdot \frac{1}{4}\cdot \sqrt{u^2 \cancel{- 4u} + 4 \cancel{+ 4u} - 8 +16}}\, du\\
&=\frac{1}{16} \int{u\cdot\sqrt{u^2 + 12}}\, du
\end{align}
$$
Mhh, we need to substitute again inorder to proceed. Let's continue this with
$$v =\sqrt{ u^2 + 12 } 
\implies \frac{dv}{du} = \frac{2u}{2\sqrt{u^2 + 12}} = \frac{u}{v}
\implies du = \frac{v}{u}\, dv$$
Continuing,
$$
\begin{align}
&\frac{1}{16} \int{u\cdot\sqrt{u^2 + 12}}\, du \\
&= \frac{1}{16} \int{u\cdot v \cdot \frac{v}{u}\, dv} \\
&= \frac{1}{16}\int{v^2}\, dv\\
&= \frac{1}{16}\frac{v^{2+1}}{(2+1)} + C\\
&= \frac{v^3}{48} + C
\end{align}$$
Putting $v$ interms of $x$, you'll probably get the right answer.
$\dots$ Maybe taking $u=x^2+x+1$ would have been a better substitution.
Well, practice makes perfect! :D
</s>