<s>[INST] Integration: Method of partial fractions - Any standard method of finding constants in hard to solve expressions? I've been computing many indefinite integrals using the method of partial decomposition.
The integrals are usual on the form $$\int \frac {x^2-29x+5} {(x-4)^2(x^2+3)} dx$$
which is equal to
$$\int \frac {A} {x-4}  + \frac {B} {(x-4)^2} + \frac {Cx+D} {x^2+3}dx$$
and the constants are given by
$$x^2-29x+5=A(x-4)(x^2+3)+B(x^2+3)+(Cx+D)(x-4)^2 = (A+C)x^3+(-4A+B-8C+D)x^2+(3A+16C-8D)x + 12A+ 3B+16D$$
which can be solved using a matrix because no two constants are multiplied, squared or somehow messed up.
Also as I've been reading here:
Link the constants should be unique since the proof is based on polynomial division in a polynomial ring over field $F$, in this case the field is $\mathbb R$.
My question is: so far I have solved for all constants using a matrix. But what if the partial fractions include terms like $$(ax^2+bx+c)^k = \frac {A_1x + B_1} {a^2+bx+c} + .. + \frac {A_kx + B_k} {(ax^2+bx+c)^k}$$ for some very high power of $k$.
Then when multiplying all the denominators together to solve for constants, I will get some expression involving constants that cannot be solved for using a matrix. I know we don't meet these hard to solve tasks in a standard textbook, but they must arise in real.
As stated above, we know there exists values for the constants such that equality holds. However how would you solve these expressions involving constants I'm refering too ? - Is there some standard way ? Should I use some algebra system on my PC, or is there somehow to do it by hand when the power of $k$ is high ?
Thanks for your time.
 [/INST] One can find partial fractions this way:
\begin{equation*}
f(x)=\frac{x^{2}-29x+5}{(x-4)^{2}(x^{2}+3)}=\frac{A}{(x-4)}+\frac{B}{%
(x-4)^{2}}+\frac{Cx+D}{x^{2}+3}.
\end{equation*}
\begin{equation*}
B=\left. (x-4)^{2}f(x)\right] _{x=4}=\left. \frac{x^{2}-29x+5}{(x^{2}+3)}%
\right] _{x=4}=-5.
\end{equation*}
\begin{eqnarray*}
Cx+D &=&\left. (x^{2}+3)f(x)\right] _{x^{2}=-3} \\
&=&\left. \frac{x^{2}-29x+5}{x^{2}-8x+16}\right] _{x^{2}=-3} \\
&=&\left. \frac{\left( -3\right) -29x+5}{(-3)-8x+16}\right] _{x^{2}=-3} \\
&=&\left. \frac{-29x+2}{-8x+13}\right] _{x^{2}=-3} \\
&=&\left. \frac{\left( -29x+2\right) \left( 8x+13\right) }{\left(
-8x+13\right) \left( 8x+13\right) }\right] _{x^{2}=-3}\ tricky \\
&=&\left. \frac{26-232x^{2}-361x}{169-64x^{2}}\right] _{x^{2}=-3} \\
&=&\frac{26-232(-3)-361x}{169-64(-3)} \\
&=&-x+2.
\end{eqnarray*}
To find $A$ multiply by $x$
\begin{equation*}
xf(x)=A\left( \frac{x}{x-4}\right) +\frac{Bx}{(x-4)^{2}}+\frac{Cx^{2}+Dx}{%
x^{2}+3}
\end{equation*}
then take the limit as $x$ tends to $+\infty $
\begin{eqnarray*}
\lim_{x\rightarrow \infty }xf(x) &=&\lim_{x\rightarrow \infty }A\left( \frac{%
x}{x-4}\right) +\frac{Bx}{(x-4)^{2}}+\frac{Cx^{2}+Dx}{x^{2}+3} \\
0 &=&A+0+C
\end{eqnarray*}
then 
\begin{equation*}
A=-C=1.
\end{equation*}
Therefore,
\begin{equation*}
\frac{x^{2}-29x+5}{(x-4)^{2}(x^{2}+3)}=\frac{1}{x-4}-\frac{5}{\left(
x-4\right) ^{2}}+\frac{-x+2}{x^{2}+3}.
\end{equation*}
</s>