Evaluating $\int \dfrac {2x} {x^{2} + 6x + 13}dx$ I am having trouble understanding the first step of evaluating
$$\int \dfrac {2x} {x^{2} + 6x + 13}dx$$ 
When faced with integrals such as the one above, how do you know to manipulate the integral into:
$$\int \dfrac {2x+6} {x^{2} + 6x + 13}dx - 6 \int \dfrac {1} {x^{2} + 6x + 13}dx$$ 
After this first step, I am fully aware of how to complete the square and evaluate the integral, but I am having difficulties seeing the first step when faced with similar problems. Should you always look for what the $"b"$ term is in a given $ax^{2} + bx + c$ function to know what you need to manipulate the numerator with? Are there any other tips and tricks when dealing with inverse trig antiderivatives?
 A: Just keep in mind which "templates" can be applied. The LHS in your second line is "prepped" for the $\int\frac{du}{u}$ template. Your choices for a rational function with a quadratic denominator are limited to polynomial division and then partial fractions for the remainder, if the denominator factors (which it always will over $\mathbb{C}$). The templates depend on the sign of $a$ and the number of roots. Here are some relevant "templates":
$$
\eqalign{
\int\frac1{ax+b}dx &= \frac1{a}\ln\bigl|ax+b\bigr|+C \\
\int\frac{dx}{(ax+b)^2} &= -\frac1{a}\left(ax+b\right)^{-1}+C \\
\int\frac1{x^2+a^2}dx &= \frac1{a}\arctan\frac{x}{a}+C \\
\int\frac1{x^2-a^2}dx &= \frac1{2a}\ln\left|\frac{x-a}{x+a}\right|+C \\
}
$$
So, in general, to tackle
$$
I = \int\frac{Ax+B}{ax^2+bx+c}dx
$$
you will want to write
$Ax+B$ as $\frac{A}{2a}\left(2ax+b\right)+\left(B-\frac{Ab}{2a}\right)$
to obtain
$$
\eqalign{
I &
= \frac{A}{2a}\int\frac{2ax+b}{ax^2+bx+c}dx
+ \left(B-\frac{Ab}{2a}\right) \int\frac{dx}{ax^2+bx+c}
\\&
= \frac{A}{2a}\ln\left|ax^2+bx+c\right|
+ \left(\frac{B}{a}-\frac{Ab}{2a^2}\right) \int\frac{dx}{x^2+\frac{b}{a}x+\frac{c}{a}}
}
$$
and to tackle the remaining integral, you can find the roots from the quadratic equation or complete the squares using the monic version (which is easier to do substitution with). If $a=0$, use the first "template" above. If you complete the squares and it's a perfect square, or if you get one double root, then use the second. If the roots are complex or there are two distinct real roots, then (after substituting $u=x+\frac{b}{2a}$) use the third or fourth "template".
A: I look at that fraction and see that the numerator differs from the derivative of the denominator by a constant, $6$. If the numerator were $2x+6$ instead of $2x$, the fraction would be of the form $u'/u$, and I’d be very happy. So I simply make it $2x+6$, subtracting $6$ to compensate:
$$\frac{2x}{x^2+6x+13}=\frac{(2x+6)-6}{x^2+6x+13}=\frac{2x+6}{x^2+6x+13}-\frac6{x^2+6x+13}\;.$$
Then I consider whether I can integrate the correction term. In this case I recognize it as the derivative of an arctangent, so I know that I’ll be able to handle it, though it will take a little algebra.
A: You want to make the substitution $u=x^2+6x+13$ . Thus, $du=2x+6$ the rest follows easily from there.
A: It's not necessary to write it out like that beforehand. It comes up naturally when you try to solve it.
$\displaystyle \int \dfrac {2x} {x^{2} + 6x + 13}dx = \int \dfrac{2x}{x^2 + 6x + 9 + 4}dx = \int \dfrac{2x}{(x + 3)^2 + 4}dx$
This sounds like a job for... u-substitution! (da-da-daaaa!)
Let $u = (x+3)^2$, so that $du = 2(x+3)dx = (2x + 6)dx$
Now is when we see that we wish we had that 6. There's only one way to get it - add and subract it. So we get
$\displaystyle \int \dfrac {2x} {x^{2} + 6x + 13}dx = \int \dfrac{2x + 6 - 6}{(x + 3)^2 + 4}dx = \int \dfrac{du}{u^2 + 4} + \int \dfrac{-6}{(x+3)^2 + 4}$
At least, that's how I think of it.
