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!

We're trying to integrate
$$ \int f(x) dx = \int \frac{(\cos x + \sin x)^n}{(\cos x - \sin x)^{n + 2}} dx,$$
Divide numerator and denominator by $\cos^{n+2}(x)$:
$$ \int \frac{1}{\cos^2(x)}\frac{(1 + \tan x)^n}{(1 - \tan x)^{n + 2}} dx,$$
Now substitute $t = \tan(x)$; $dt = \frac{1}{\cos^2(x)}dx$:
\begin{align} \int \frac{(1 + t)^n}{(1 - t)^{n + 2}} dt &= \frac{1}{2}\int \frac{(1 + t)^n(1-t+1+t)}{(1 - t)^{n + 2}}\\
& = \frac{1}{2}\int \frac{(1 + t)^n(1-t)^n((1-t)+(1+t))}{(1 - t)^{2n + 2}}dt\\
& = \frac{1}{2}\int \frac{(1-t)^{n+1}(1 + t)^n+(1+t)^{n+1}(1 - t)^n}{(1 - t)^{2n + 2}}dt\\
& = \frac{1}{2(n+1)}\int \frac{d}{dt}\left(\frac{1+t}{1-t}\right)^{n+1}dt\\
& = \frac{1}{2(n+1)}\left(\frac{1+t}{1-t}\right)^{n+1} + c\\
& = \frac{1}{2(n+1)}\left(\frac{1+\tan(x)}{1-\tan(x)}\right)^{n+1} + c
\end{align}
Since $\tan(0) = 0$, you'll want $c = 0$.
