Recall the integration by parts formula
For this integral, we take u = x {\displaystyle u=x} and d v = cos ( x ) d x {\displaystyle dv=\cos(x)\,dx} , so d u = d x {\displaystyle du=dx} and v = sin ( x ) {\displaystyle v=\sin(x)} . Applying the formula, we obtain