Answer
$\frac{\theta\sin\pi\theta}{\pi}+\frac{\cos\pi\theta}{\pi^{2}}+C$
Work Step by Step
We use the formula $\int udv=uv-\int vdu$
with $u=\theta,\,dv=\cos \pi\theta\,d\theta$
$du=d\theta,\,v=\frac{\sin\pi\theta}{\pi}$
Then, $\int \theta \cos\pi\theta\,d\theta=\theta\times\frac{\sin\pi\theta}{\pi}-\int\frac{\sin\pi\theta}{\pi}d\theta$
$=\frac{\theta\sin\pi\theta}{\pi}+\frac{\cos\pi\theta}{\pi^{2}}+C$