I ran into a question with proving the reduction formula: $$ \int \cos^n x \ dx = \frac{1}{n}\cos^{n-1}x\sin x + \frac{n-1}{n}\int\cos^{n-2}x \ dx $$ I then attempted to prove by differentiation with respect to $x$, but something strange happened (have I just violated the Fundamental Theorem of Calculus?)
After differentiation, the resulting expression is:
$\displaystyle\cos^n x=\bigg[\frac{1}{n}\bigg]\bigg[(n-1)\cos^{n-2}x(-\sin x)(\sin x)+\cos^{n-1}x\cos x+\frac{n-1}{n}\cos^{n-2}x\bigg]$
$\displaystyle=\bigg[\frac{n-1}{n}\cos^{n-2}x\bigg]\bigg[\cos^2x+\cos^n x\bigg]$
$\displaystyle \frac{n-1}{n}\bigg[\cos^nx+\cos^{2n-2}x\bigg]$
Edit: I corrected the derivative, but problem not solved.
Hint Write
$$\int\cos^n x dx=\int\cos x\cos^{n-1}x dx$$ and do an integration by parts using the relation $$\cos^2 x+\sin^2x =1$$
Edit
$$\int\cos^n x dx=\int\underbrace{\cos x}_{=f'(x)}\underbrace{\cos^{n-1}x }_{=g(x)}dx=\sin x\cos^{n-1}x+(n-1)\int\sin x\sin x\cos^{n-2}x dx$$ so $$\int\cos^n x dx=\int\cos x\cos^{n-1}x dx=\sin x\cos^{n-1}x+(n-1)\int(1-\cos^2 x)\cos^{n-2}x dx$$ so developp and you find $$n\int\cos^n x dx=\sin x\cos^{n-1}x+(n-1)\int\cos^{n-2}x dx$$ now divide by $n$ and you get your result.