Do we have to memorize partial fraction decompositions? I have recently learned about the use of Partial Fraction Decomposition (P.F.D) in integration.
I want to know whether one has to memorize the decompositions for various fractions or is there some logic behind them from which we can quickly figure 'them' out ( 'them' referring to knowing whether the numerator should be a constant, linear or quadratic polynomial just by seeing the particular fraction; etc.).
Consider this fraction 
$$\dfrac{x^4 +x +1}{x^3 \cdot (x^2 +9)^2}$$
I've read that its decomposition is:
$$\dfrac{A}{x} + \dfrac{B}{x^2} + \dfrac{C}{x^3} + \dfrac {Dx+E}{x^2 +9} + \dfrac{Fx+G}{{(x^2 +9)}^2}$$
I'm this the numerator of 3 terms is a constant but then suddenly the rest two terms have linear expressions as their numerator. So, if I got even one of the terms wrong my calculations would go wrong too!
And that is just another example of the several different fractions we get.
So, Is their some technique or logic that can be used for figuring out the P.F.D or do we actually need to memorize all of that?
 A: The logic is just the general theorem on partial fractions decomposition, valid over any field:

Let $f$ and $g$ be non-zero polynomials over a field $K$. If
  $$g =\prod_{i=1}^n p_i^{r_i}$$
  is a decomposition of $g$ as a product of (distinct) irreducible polynomials
  There are (unique) polynomials $b$ and $a_{ij}$ with $\deg a_{ij} < \deg p_i$ ($1\le i\le n$, $1\le j\le r_i$) such that
  $$\frac fg  = b + \frac{a_{11}}{p_1}+\dots+\frac{a_{1r_1}}{p_1^{r_1}}+\dots  + \frac{a_{n1}}{p_n}+\dots+\frac{a_{nr_n}}{p_n^{r_n}}$$
  and $b$ is the quotient of the Euclidean division of $f$ by $g$. In particular, if $\deg f<\deg g$, $b=0$.

When the field is $\mathbf R$, the irreducible polynomials are linear polynomials (degree $1$) and quadratic polynomials with complex roots, hence the degree condition for numerators implies these numerators are  constants and linear polynomials respectively.
A: You don't have to do anything in life, except do taxes and die.

But yeah, if you want to be any good at integration, you should remember how to decompose a rational function into partial fractions. The rule is that the numerator is always a polynomial of degree one less than the denominator before applying further powers to it. That is, if the original fraction has $(P(x))^n$ in the denominator, then this means the decomposed partial fractions will have $$\frac{P_1(x)}{P(x)} + \frac{P_2(x)}{P^2(x)} + \cdots + \frac{P_n(x)}{P^n(x)}$$ where each of the polynomials $P_i$ has a degree of $\deg(P)-1$.

So, since the original fraction has $(x^2+9)^2$ in the denominator, this will yield two fractions in the decomposition: $$\frac{P_1(x)}{(x^2+9)}\text{ and } \frac{P_2(x)}{(x^2+9)^2}$$
where both $P_1$ and $P_2$ are of degree $1$ (one less than $x^2+9$).
