<s>[INST] How to evaluate the following integral, $\int\frac{x \, dx}{x^2+2x+17}$? I am new to integration. This function is kinda tricky for me :  $$\int\frac{x \, dx}{x^2+2x+17}$$
I came up with following three approaches:


*

*Partial fraction decomposition, but I can't factor the denominator into different parts.

*Substitution: I tried $u = x^{2}$ and $u = x^2+2x+17$, but both of them seem not to be helpful.

*I also tried dividing both denominator and numerator by $x$, then the fraction became $\frac{1}{x+\frac{17}{x}+2}$ . It is more complex.


Any suggestions or hints? Thank you so much!
 [/INST] Variations on this one come up here from time to time.
There is a standard technique in algebra for reducing a problem involving a quadratic polynomial with a first-degree term to a problem involving a quadratic polynomial without a first-degree term.
$$
u = x^2+2x+17,\qquad du = (2x+2)\,dx, \qquad \frac{du} 2 = (x+1)\,dx
$$
$$
\frac{x}{x^2+2x+17} = \underbrace{\frac{x+1}{x^2+2x+17}} + \frac{-1}{x^2+2x+17}
$$
The integral of the function over the $\underbrace{\text{underbrace}}$ is done via the substitution above.  Then next term has to be treated differently.
$$
\underbrace{x^2+2x+17 = (x^2 + 2x + 1) + 16 = (x+1)^2 + 16}_\text{completing the square}
$$
$$
\int \frac 1 {(x+1)^2 + 16} \,dx = \int \frac{1/16}{\left( \frac{x+1} 4 \right)^2 + 1} \, dx = \int \frac{1/4}{\left( \frac{x+1} 4 \right)^2 + 1} \, \frac{dx} 4 = \frac 1 4 \int \frac{du}{u^2+1}
$$
etc.
There is a standard technique in algebra for reducing a problem involving a quadratic polynomial with a first-degree term to a problem involving a quadratic polynomial without a first-degree term.
</s>