$\displaystyle \displaystyle \begin{align*} I_n &= \int_0^a{(a - x)^n\cos{x}\,dx} \end{align*}$
Using integration by parts with $\displaystyle \displaystyle \begin{align*} u = (a - x)^n \implies du = -n(a-x)^{n-1}\,dx \end{align*}$ and $\displaystyle \displaystyle \begin{align*} dv = \cos{x}\,dx \implies v = \sin{x} \end{align*}$ and the integral becomes
$\displaystyle \displaystyle \begin{align*} \int{(a - x)^n\cos{x}\,dx} &= (a - x)^n\sin{x} - \int{-n(a - x)^{n - 1}\sin{x}\,dx} \\ &= (a - x)^n\sin{x} + n\int{(a - x)^{n-1}\sin{x}\,dx} \end{align*}$
Using Integration by parts again with $\displaystyle \displaystyle \begin{align*} u = (a - x)^{n - 1} \implies du = -(n - 1)(a - x)^{n - 2}\,dx \end{align*}$ and $\displaystyle \displaystyle \begin{align*} dv = \sin{x}\,dx \implies v = -\cos{x} \end{align*}$ and the integral becomes
$\displaystyle \displaystyle \begin{align*} \int{(a - x)^n\cos{x}\,dx} &= (a - x)^n\sin{x} + n\left[-(a-x)^{n-1}\cos{x} - \int{(n - 1)(a - x)^{n-2}\cos{x}\,dx}\right] \\ &= (a - x)^n\sin{x} - n(a - x)^{n - 1}\cos{x} - n(n - 1)\int{(a - x)^{n-2}\cos{x}} \end{align*}$
and evaluating between 0 and a will give you the required result