Partial Fraction decomposition when denominator is in $x^2 + a$ form Why isn't the expansion of $$ \frac{s^3 - 2s^2 + 16s - 2}{(s^2+1)(s^2+16)} $$
in the form of 
$$ \frac{As+B}{s^2+1} + \frac{Cs+D}{s^2+16} $$ since (as I recall) the denominator is of square power  and you should decompose it (in the numerator) until the s diminishes.
Apparently wolframalpha is saying the correct form should be
$$ \frac{A}{s^2+1} + \frac{B}{s^2+16} $$
Please clarify.
Thank you in advance.
 A: We have:
$$ \dfrac{s^3 - 2s^2 + 16s - 2}{(s^2+1)(s^2+16)} = \dfrac{as+b}{s^2+1} + \dfrac{cs+d}{s^2+16} $$
When we multiply things out and equate sides, we have:
$$ s^3 - 2s^2 + 16s - 2 = 16 b + d + 16 a s + c s + b s^2 + d s^2 + a s^3 + c s^3$$
Equating like powers leads to:
$$a+c = 1, b+d = -2, 16a+c = 16, 16b+d=-2$$
When you solve for the constants, you get:
$$a = 1, b = 0, c = 0, d = -2$$
So,
$$ \dfrac{s^3 - 2s^2 + 16s - 2}{(s^2+1)(s^2+16)} = \dfrac{s}{s^2+1} - \dfrac{2}{s^2+16} $$
A: There is a fast way, which is seldom seen on a calculus textbook. Polynomials $s^2 + 1$ and $s^2 + 16$ are coprime and squarefree, so we can solve it in a manner similar to linear denominators.
The numerator on $s^2 + 1$ is the unique representative of
$$\frac {s^3 - 2s^2 + 16s - 2}{s^2 + 16} + \left\langle s^2 + 1 \right\rangle$$
whose degree less than $\deg \left( s^2 + 1 \right) = 2$. Let's denote this as
$$\left\lceil s^2 + 1 \right\rceil \frac {s^3 - 2s^2 + 16s - 2}{s^2 + 16}.$$
To extract multiples of $s^2 + 1$, we can simply set $s^2 = -1$ and let the problem solves itself.
$$\left\lceil s^2 + 1 \right\rceil \frac {s^3 - 2s^2 + 16s - 2}{s^2 + 16}
= \frac {-\left(s - 2\right) + 16s - 2}{15} = s.$$
Similarly,
$$\left\lceil s^2 + 16 \right\rceil \frac {s^3 - 2s^2 + 16s - 2}{s^2 + 1}
= \frac {-16\left(s - 2\right) + 16s - 2}{-15} = -2.$$
Both numerators are found.
$$\frac {s^3 - 2s^2 + 16s - 2}{\left(s^2 + 1\right) \left(s^2 + 16\right)} = \frac{s}{s^2+1} - \frac{2}{s^2+16}.$$
This method was published in Guoce Xin's A Fast Algorithm for Partial Fraction Decompositions (2004). It is covered in the last section in the article.
