Integration Techniques - Adding [arbitrary] values to the numerator. Suppose you wanted to evaluate the following integral.

Where did the 4 come from? I understand that it makes the solution but how would you make an educated guess to put a 4? And how in the future would I solve similar questions?
 A: We want to have a fraction with the form
$$\frac{f'}f$$
so since the derivative of the denominator $x^2+4x+13$ is $2x+4$ so we write the numerator
$$x-2=\frac 1 2 (2x-4)=\frac 1 2 (2x+4)-4$$
A: As Sami mentioned, the idea is to reduce to a fraction that will be of the form $\,f'/f,\,$ so it is the derivative of a log. In fact it is not difficult to reduce the integration of rational functions to their "logarithmic" parts, using an old algorithm that goes back to Hermite.  It works as follows. By  squarefree decomposing the denominator and partial fraction expanding, we reduce to integrating rational functions of the form $\rm\:A/D^k\in \mathbb Q(x)\:,\:$ where $\rm\:\deg\:A < \deg\:D^k,\:$ and where $\rm\:D\:$ is squarefree, so $\rm\:\gcd(D,D') = 1\:.\:$ Thus by Bezout's GCD Identity (extended Euclidean algorithm) there are $\rm\:B,C\in \mathbb Q[x]\:$ such that $\rm\ B\ D' + C\ D\ =\ A/(1-k)\:.\:$ Then a little algebra shows that
$$\rm\int \frac{A}{D^k}\ =\ \frac{B}{D^{k-1}}\ +\ \int \frac{(1-k)\ C - B'}{D^{k-1}} $$
Iterating the above rule we eventually reduce to the case $\rm\:k=1\:,\:$ i.e. squarefree denominator $\rm\:D\:.\:$
Thus using the above "quotient rule" and nothing deeper than Euclid's algorithm for polynomials (without requiring any factorization) one can mechanically compute the "rational part" of the integral of a rational function, i.e. the part of the integral not involving logarithms. This Hermite reduction rule is the basis of an algorithm due to Hermite (1872).  It plays a fundamental role in the transcendental case of some integration algorithms.
A: I believe $-4$ is the remainder of $\frac{x-2}{2x+4}$.  It's the only real significance.
