Solution:After completing the square we get:
$x^{2}+6x+12=\left( x+3\right)^{2}+3\Longrightarrow \int \frac{x}{\sqrt{
x^{2}+6x+12}}dx=\int \frac{x}{\sqrt{\left( x+3\right) ^{2}+3}}dx$
Make the substitution
$u=x+3\Longrightarrow du=dx,x=u-3$ So
$\int \frac{x}{\sqrt{\left( x+3\right) ^{2}+3}}dx=\int \frac{\left(
u-3\right) }{\sqrt{u^{2}+3}}du$
Then make the
trigonometric substitution $u=\sqrt{3}\tan \theta $
$du=\sqrt{3}\sec ^{2}\theta d\theta $
$\int \frac{\left( u-3\right) }{\sqrt{u^{2}+3}}du=\int \frac{\left( \sqrt{3}
\tan \theta -3\right) }{\sqrt{3\left( \tan ^{2}\theta +1\right) }}\sqrt{3}
\sec ^{2}\theta d\theta =\int \frac{\left( \sqrt{3}\tan \theta -3\right) }{\sqrt{\sec ^{2}\theta }}
\sec ^{2}\theta d\theta =\sqrt{3}\int \sec \theta \tan \theta d\theta -3\int \sec \theta d\theta =\sqrt{3}\sec \theta -3\ln \left\vert \sec \theta +\tan \theta \right\vert
+C$
Take a look at the triangle below where $a=\sqrt{3},u=x$
So $=\sqrt{3}\frac{\sqrt{3+u^{2}}}{\sqrt{3}}-3\ln \left\vert \frac{\sqrt{
3+u^{2}}}{\sqrt{3}}+\frac{u}{\sqrt{3}}\right\vert +C$
Convert back to x
$u=x+3$
$\int \frac{x}{\sqrt{x^{2}+6x+12}}dx=\sqrt{3}\frac{\sqrt{3+\left( x+3\right)^{2}}}{\sqrt{3}}-3\ln \left\vert \frac{\sqrt{3+\left( x+3\right) ^{2}}}{\sqrt{3}}+\frac{\left( x+3\right) }{\sqrt{3}}\right\vert +C$