I was trying to solve the following integral:
$$\int \frac{dx}{(x^2 + 2x + 1)(x^2 + 1)}$$
But I'm having some trouble doing partial fractions decomposition with this one. What I did was the following: Firstly I simplified the denominator of the fraction:
$$\int \frac{dx}{(x^2 + 1)(x + 1)^2}$$
So, I know that, to do partial fractions with this we are suposed to write it as:
$$\frac{1}{(x^2 + 1)(x + 1)^2} = \frac{*}{x^2 + 1} + \frac{*}{x + 1} + \frac{*}{(x + 1)^2}$$
The part I'm having touble with is figuring out what should go in the $*$. I checked in WolframAlpha and it's supossed to be written as:
$$\frac{1}{(x^2 + 1)(x + 1)^2} = \frac{Ax + B}{x^2 + 1} + \frac{C}{x + 1} + \frac{D}{(x + 1)^2}$$
My question is: How can I conclude this? Is there a general rule for doing this? What is the thought process behind choosing what to put in the numerator of the fractions? My teacher only showed us some examples and I also find myself having some trouble doing this when it's a type of fraction I've never seen before, can you give me some general tips when doing this?