What's the theoretical basis for integration using partial fractions? Exercises involving integration using partial fractions depend on expressing a rational function $\frac{P(x)}{Q(x)}$ (where the degree of $P$ is less than the degree of $Q$) as a sum of $$\frac{A}{(x+a)^k}$$ and $$ \frac{Bx+C}{(x^2+bx+c)^m}$$
I didn't see a reasonable explanation for why this is possible (especially for why it's necessary to put a linear polynomial $Bx+c$ in the numerator when there are "repeated" quadratical terms in the denominator).
OBS.: I'm just a calculus student, so the theory which explains this might not be accessible to me. I asked this however because maybe someone could show me a way to look to it.
 A: The reason we can break up a function of the form $\frac{P(x)}{Q(x)}$, where the degree of the polynomial $P(x)$ is less than that of $Q(x)$ into the sum of functions of the form $\frac {a} {x+b}$ is that, so long as the sum of the numerators is zero, the degree of $P(x)$ will be less than $Q(x)$ by at least one. In order to see this let's consider the situation where $$f(x)=\frac{mx+n}{(x+r)(x+s)}$$ 
We can split this function up into $$f(x)=\frac{a_1}{x+r}+\frac{a_2}{x+s}=\frac{a_1(x+s)+a_2(x+r)}{(x+r)(x+s)}$$ 
Which we arrive at by cross multiplying, just like a numerical fraction. We see then that so long as $a_1+a_2=m$ and $a_1s+a_2r=n$ then this fraction decomposition works. In the event that $Q(x)$ doesn't neatly factor into monomials then we always need to place a polynomial whose degree is one less than that of its denominator polynomial in our expansion, so that we can guarantee that the degree of $P(x)$ is less than that of $Q(x)$. Let's consider the situation where $$f(x)=\frac{mx^2+nx+p}{(b_1x^2+b_2x+b_3)(c_1x+c_2)}=$$ $$\frac{a_1x+a_2}{b_1x^2+b_2x+b_3}+\frac{a_3}{c_1x+c_2}=\frac{(a_1x+a_2)(c_1x+c_2)+a_3(b_1x^2+b_2x+b_3)}{(b_1x^2+b_2x+b_3)(c_1x+c_2)}$$ We see again that so long as the degree of $P(x)$ is less than $Q(x)$ this approach is promising. But if $Q(x)$ has 'redundant terms' in it (i.e. $(g(x))^k$ for some polynomial $g(x)$ and some natural number $k$, which is greater than 1) then our fraction sum expansion will have 'redundant terms' as well. Can you see why?
A: Suppose you have
$$
\frac{P(x)}{Q(x)}=\frac{P(x)}{(x-a)^nQ_0(x)}
$$
with $n\ge1$ and $Q_0(a)\ne0$, so $n$ is the maximum possible exponent for $x-a$. We want to see that we can write
$$
\frac{P(x)}{(x-a)^nQ_0(x)}=
\frac{A(x)}{(x-a)^{n-1}Q_0(x)}+\frac{r}{(x-a)^n}
$$
It's not restrictive to assume that $P(a)\ne0$ (or we could simplify further before starting). The equation becomes
$$
(x-a)A(x)+rQ_0(x)=P(x)
$$
or
$$
A(x)=\frac{P(x)-rQ_0(x)}{x-a}
$$
and it's simple to find $r=P(a)/Q_0(a)$: the fraction on the right simplifies because the numerator is divisible by $x-a$.
Now we have a rational function where the degree of the denominator is less than the degree of the original rational function and so we can repeat the process until the end.
This of course requires that we can split the denominator into linear factors, which is possible in the complex numbers. What to do for real numbers? We can still split the denominator into linear factors over the complex numbers.
When we find a non real root $a$ of multiplicity $n$ in the denominator, we are sure that the conjugate $\bar{a}$ is again a root of the denominator with the same multiplicity (easy to prove). So in the decomposition above we find
$$
\frac{P(x)}{Q(x)}=
\frac{P(x)}{(x-a)^n(x-\bar{a})^nQ_1(x)}
$$
where $x-a$ doesn't divide $Q_1(x)$, so $Q_1(a)\ne0$ and $Q_1(\bar{a})\ne0$. We wish to prove that we can write this as
$$
\frac{P(x)}{Q(x)}=
\frac{B(x)}{(x-a)^{n-1}(x-\bar{a})^{n-1}Q_1(x)}+
\frac{sx+r}{(x-a)^n(x-\bar{a})^n}
$$
which becomes
$$
P(x)=B(x)(x-a)(x-\bar{a})+(sx+r)Q_1(x)
$$
or
$$
B(x)=\frac{P(x)-(sx+r)Q_1(x)}{(x-a)(x-\bar{a})}
$$
and we just have to ensure that
$$
\begin{cases}
P(a)-(sa+r)Q_1(a)=0\\
P(\bar{a})-(s\bar{a}+r)Q_1(\bar{a})=0
\end{cases}
$$
Set $b=P(a)/Q_1(a)$, so $P(\bar{a})/Q_1(\bar{a})=\bar{b}$ and the system becomes
$$
\begin{cases}
sa+r=b\\
s\bar{a}+r=\bar{b}
\end{cases}
$$
that is
$$
\begin{cases}
s=\dfrac{b-\bar{b}}{a-\bar{a}}\\[6px]
r=\dfrac{a\bar{b}-\bar{a}b}{a-\bar{a}}
\end{cases}
$$
which are real.
