<s>[INST] Partial fraction decomposition and trig substitution I am reviewing material for the CAA module 0 exam and part of it is integration. I had trouble doing a partial fractions problem and the work that they having showing the answer is convoluted and unclear.
I am asked to integrate:
$\int \frac{x+7}{x^2(x+2)}dx$
obviously when you set it up you get:
$\frac{A}{x}+\frac{B}{x^2}+\frac{c}{x+2}=\frac{x+7}{x^2(x+2)}\tag{$*$}$
I had no problems here I had problems in the next step.
multiplying through I got:
$A(x^2)(x+2)+B(x)(x+2)+C(x^2)(x)=x+7$
Somehow they got $Ax(x+2)+B(x+2)+C(x^2)=x+7$
That is not even possible unless you factor out an x on the left hand side and divide both sides by x which would give you $\frac{x+7}{x}$ on the right hand side. So either their work is incorrect or I am missing something.
I also tried solving a trig substitution problem: (ignoring the constants they get pulled out anyway)
$\int\frac{1}{x^4\sqrt{x^2-7}}dx$
obviously $x=\sqrt{7}\sec(\theta)$
and eventually you get to: $\int \cos^3(\theta) dx$
peel off a cos: $\int \cos^2(\theta)\cos(\theta)\,d(\theta)$
use an identity:
$\int 1-\sin^2(\theta) \cos(\theta)$ 
let $u=\sin(\theta),\enspace du=\cos(\theta)\,d(\theta) \to d(\theta)=\frac{1}{\cos(\theta)}du$
which gives an integral of:
$\int 1-u^2 du$ because cos gets canceled out with substituting $d(\theta)$
which comes out to be $u-\frac{1}{3}u^3+c$
now in the reference triangle the Adjacent side $= \sqrt{7}$ Hypotenuse $=x$
Now is this right? This has to be right integration wise because even the answer showed an integral of cos cubed but then it went off and used some integration technique other than what I used which is the only sensible technique to peel off the cos. Their answer gave something retarded like $\frac{(2x^2+7)\sqrt{x^2-7}}{x^2 \times x}$ from the integral of $\cos^3(\theta)$ which came out to be $2+\cos^2(\theta)\sin(\theta)$. Am I going crazy? My method gives a valid solution, correct? and they used an unnecessary method right? I mean I was taught this method way back in calc II and I am going to be very frustrated if for some magical reason its something different.
 [/INST] 
Somehow they got $Ax(x+2)+B(x+2)+C(x^2)=x+7$
That is not even possible unless you factor out an x on the left hand side and divide both sides by x which would give you $\frac{x+7}{x}$ on the right hand side. So either their work is incorrect or I am missing something.

Yes, you're missing the notion of least common denominator, i.e the l.c.m. of the denominators:
$$\frac{A}{x}+\frac{B}{x^2}+\frac{c}{x+2}=\frac{x+7}{x^2(x+2)}$$
Here it is $x^2(x+2)$, and
$$\frac{A}{x}+\frac{B}{x^2}+\frac{C}{x+2}= \frac{Ax(x+2)}{x^2(x+2)}+\frac{B(x+2)}{x^2(x+2)}+\frac{Cx^2}{x^2(x+2)},$$
so that multiplying by the denominator, you obtain indeed
$$Ax(x+2)+B(x+2)+Cx^2=x+7.$$

*

*Now setting $x=0$, you get $2B=7$, so $B=\frac72$.


*Next $x=-2$ yields $4C=5$, or $C=\frac54$.


*Finally  the coefficient of $x^2$ in the l.h.s. must be $0$, so $A+C=0$, and $A=-\frac 54$.
</s>