# 分部积分的递推法

\begin{align*}\int\frac{dx}{(1+x^2)^n}&=\int1\cdot\frac{1}{(1+x^2)^n}dx\\ &=\frac{x}{(1+x^2)^n}-\int x(-n)\frac{1}{(1+x^2)^{n+1}}\cdot 2xdx\\ &=\frac{x}{(1+x^2)^n}+2n\int \frac{x^2}{(1+x^2)^{n+1}}dx\\ &=\frac{x}{(1+x^2)^n}+2n\int \frac{x^2+1-1}{(1+x^2)^{n+1}}dx\\ &=\frac{x}{(1+x^2)^n}+2n\int \frac{1}{(1+x^2)^{n}}dx-2n\int \frac{1}{(1+x^2)^{n+1}}dx\end{align*}

$2nI_{n+1}=\frac{x}{(1+x^2)^n}+(2n-1)I_{n}$

$I_{n+1}=\frac{2n-1}{2n}I_n+\frac{x}{(1+x^2)^n}$

\begin{align*}\int\frac{dx}{(1+x^2)^2}&=\frac{1}{2}\int \frac{1}{1+x^2}dx+\frac{x}{(1+x^2)}\\ &=\frac{1}{2}\arctan x+\frac{x}{1+x^2}+C\end{align*}

\begin{align*}\int\frac{dx}{(1+x^2)^3}&=\frac{3}{4}\int \frac{1}{(1+x^2)^2}dx+\frac{x}{(1+x^2)^2}\\ &=\frac{3}{4}\left(\frac{1}{2}\arctan x+\frac{x}{1+x^2}\right)+\frac{x}{(1+x^2)^2}+C\\ &=\frac{3}{8}\arctan x+\frac{1}{4}\frac{x}{1+x^2}+\frac{x}{(1+x^2)^2}+C\end{align*}

\begin{align*}I_n&=\int \cos^nxdx=\int\cos^{n-1}x\cos x\\ &=\cos^{n-1}x\sin x- \int\sin x(n-1)\cos^{n-2}x(-\sin x)dx\\ &=\cos^{n-1}x\sin x+(n-1)\int\cos^{n-2}\sin^2xdx\\ &=\cos^{n-1}x\sin x+(n-1)\int\cos^{n-2}(1-\cos^nx)dx\\ &=\cos^{n-1}x\sin x+(n-1)\int\cos^{n-2}xdx-(n-1)\int\cos^nxdx\\ &=\cos^{n-1}x\sin x+(n-1)I_{n-2}-(n-1)I_n\end{align*}

$nI_n=\cos^{n-1}x\sin x+(n-1)I_{n-2}$ 也就是 $I_n=\frac{1}{n}\cos^{n-1}x\sin x+\frac{n-1}{n}I_{n-2}$

\begin{align*}\int\cos^3xdx&=\frac{1}{3}\cos^2x\sin x+\frac{2}{3}\int\cos xdx\\ &=\frac{1}{3}\cos^2x\sin x+\frac{2}{3}\sin x+C\end{align*}

\begin{align*}\int\cos^4xdx&=\frac{1}{4}\cos^3x\sin x+\frac{3}{4}\cos^2xdx\\ &=\frac{1}{4}\cos^3x\sin x+\frac{3}{4}\left(\frac{1}{2}\cos x\sin x+\frac{1}{2}\int\cos^0xdx\right)\\ &=\frac{1}{4}\cos^3x\sin x+\frac{3}{8}\cos x\sin x+\frac{3}{8}x+C\end{align*}