Evaluation of a general trigonometric integral How can I evaluate the integral
$$\int\sin^k(x)\ dx$$
in which I don't know if $k$ is an even or an odd number?

We can also use integration by parts to reduce the integral to either $\int\sin(x)\,\mathrm{d}x$ or $\int1\,\mathrm{d}x$.
$$
\begin{align}
\int\sin^n(x)\,\mathrm{d}x
&=-\int\sin^{n-1}(x)\,\mathrm{d}\cos(x)\tag{1}\\
&=-\cos(x)\sin^{n-1}(x)+(n-1)\int\sin^{n-2}(x)\cos^2(x)\,\mathrm{d}x\tag{2}\\
&=-\frac1n\cos(x)\sin^{n-1}(x)+\frac{n-1}n\int\sin^{n-2}(x)\,\mathrm{d}x\tag{3}
\end{align}
$$
Explanation:
$(1)$: $\mathrm{d}\cos(x)=-\sin(x)\,\mathrm{d}x$
$(2)$: integrate by parts
$(3)$: add $(n-1)\int\sin^n(x)\,\mathrm{d}x$ to both sides and divide by $n$
Modulo a constant of integration, induction and $(3)$ yields
$$
\begin{align}
&\int\sin^n(x)\,\mathrm{d}x\\
&=\frac{(n-1)!!}{n!!}x[n\text{ is even}]-\cos(x)\sum_{k=0}^{\lfloor\frac{n-1}2\rfloor}\frac{(n-1)!!(n-2k)!!}{n!!(n-2k-1)!!}\frac{\sin^{n-2k-1}(x)}{n-2k}\\
&=\frac{(n-1)!!}{n!!}\left(x[n\text{ is even}]-\cos(x)\sum_{k=0}^{\lfloor\frac{n-1}2\rfloor}\frac{(n-2k-2)!!}{(n-2k-1)!!}\,\sin^{n-2k-1}(x)\right)
\tag{4}
\end{align}
$$
where $[\dots]$ are Iverson Brackets.
