# Integration, CAS vs human

To evaluate integral

$\int x(1+x)^{19}\; dx$,

the CAS I have tried (maxima, mathematica) expands $(1+x)^{19}$ first, followed by multiply the expression by $x$. Finally, integrate term by term yields the result, a messy looking polynomial (see Fig. 1)

Fig. 1

A human being however, will more likely to recognize the fact that $(1+x)^{19}$ is the derivative of $\frac{(1+x)^{20}}{20}$ and therefore use the method of integration by parts:

$\int x (1+x)^{19}\;dx$

$=\int x (\frac{(1+x)^{20}}{20})'\;dx$

$=x \frac{(1+x)^{20}}{20}-\int x'\frac{(1+x)^{20}}{20}\;dx$

$=x\frac{(1+x)^{20}}{20}-\frac{1}{20}\int(1+x)^{20}\;dx$

$=\frac{x(1+x)^{20}}{20}-\frac{(1+x)^{21}}{420}\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (1)$

An even better approach is:

$\int x(1+x)^{19}\;dx$

$=\int (1+x-1) (1+x)^{19}\;dx$

$=\int ((1+x)-1) (1+x)^{19}\;dx$

$=\int (1+x)^{20}-(1+x)^{19}\;dx$

$=\int (1+x)^{20}\;dx-\int (1+x)^{19}\;dx$

$= \frac{(1+x)^{21}}{21}-\frac{(1+x)^{20}}{20}\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad(2)$

The difference of result from CAS and (2) is a constant, as expected (see Fig. 2)

Fig. 2