Calculate the antiderivative of a given function Consider the function $f : \left[ 0, \frac{\pi}{4} \right)$, $f(x) = \frac{(\cos x + \sin x)^n}{(\cos x - \sin x)^{n + 2}}$, where $n \in \mathbb{N}^*$. Find the antiderivative $F$ of $f$ such that $F(0) = \frac{1}{2(n + 1)}$.
I've noticed that $(\cos x - \sin x)' = -(\cos x + \sin x)$, but I can't figure out how to use this in finding $F$.
Thank you!

Noting
$$ \cos x+\sin x=\sqrt2\sin(x+\frac{\pi}{4}),\cos x-\sin x=\sqrt2\cos(x+\frac{\pi}{4}) $$
one has
\begin{eqnarray}
F(x)&=&\int \frac{(\cos x + \sin x)^n}{(\cos x - \sin x)^{n + 2}} dx\\
&=&\int \frac{(\sqrt2\sin(x+\frac{\pi}{4}))^n}{(\sqrt2\cos(x+\frac{\pi}{4}))^{n + 2}} dx\\
&=&\int \tan^n(x+\frac{\pi}{4})\frac{1}{2\cos^2(x+\frac{\pi}{4})} dx\\
&=&\frac12\int \tan^n(x+\frac{\pi}{4})\sec^2(x+\frac{\pi}{4}) dx\\
&=&\frac12\int \tan^n(x+\frac{\pi}{4})d\tan(x+\frac{\pi}{4})\\
&=&\frac1{2(n+1)}\tan^{n+1}(x+\frac{\pi}{4})+C.
\end{eqnarray}
Using $F(0)=\frac{1}{2(n+1)}$, it is easy to see $C=0$.
