Is there some kind of method/trick/strategy/etc used to turn
$$\frac{1}{2+u}\cdot\frac{1}{1+u^2}$$
into
$$\frac{1}{5}\left [\frac{1}{2+u}-\frac{u-2}{1+u^2}\right ]$$
?
I run into such problems while integrating.
For the example above, the integral was
$$\int\frac{dx}{2+\tan{x}}$$
In Spivak's Calculus, such algebra is done out of the blue. Is it just either cleverness or trial and error or a mix of both is there some method?
For the record, Spivak does say "there is no substitute for cleverness" at the beginning of this multi-item problem of integration. I just want to confirm that in fact it is as difficult as it seems to pull such decompositions out of thin air.
The partial fraction decomposition is introduced on page 374 of Spivak's "Calculus" which you refer to in the question. Here is this example.
Let $$ \begin{align} \frac{1}{2+u}\cdot\frac{1}{1+u^2} = {a\over2+u}+{bu+c\over 1+u^2} \end{align} $$ then multiplying out gives $$ {(2+u)(bu+c)+a(1+u^2)\over (2+u)(1+u^2) } ={(a+b)u^2+(2b+c)u+2c+a \over (2+u)(1+u^2)}. $$ Since there is no $u^2$ on the top we must have $a=-b$, similarly for $u$ gives $c=-2b=2a$, then $2c+a=1$ gives $5a=1$, so $a=1/5$, $b=-1/5$, $c=2/5$.