Answer
$$\int t^2\cos t dt=t^2\sin t+2t\cos t-2\sin t+C$$
Work Step by Step
$$A=\int t^2\cos t dt$$
Take $u=t^2$ and $dv=\cos t dt$
We then have $du=2tdt$ and $v=\sin t$
Apply the formula $\int udv= uv-\int vdu$, we have $$A=t^2\sin t-\int \sin t\times 2t dt$$ $$A=t^2\sin t-2\int t\sin t dt$$
We still cannot calculate directly the integral $\int t\sin tdt$, because there still exists $t$ inside the integral. So we need to carry out integration by parts one more time.
Take $u=t$ and $dv=\sin t dt$
We then have $du=dt$ and $v=-\cos t$
Apply the formula $\int udv= uv-\int vdu$ for $\int t\sin tdt$, we have $$A=t^2\sin t-2\Big(-t\cos t-\int -\cos tdt\Big)$$ $$A=t^2\sin t-2\Big(-t\cos t+\int\cos tdt\Big)$$ $$A=t^2\sin t-2\Big(-t\cos t+\sin t+C\Big)$$ $$A=t^2\sin t+2t\cos t-2\sin t+C$$