Suppose we want to find $\int x \cos x \dif x$, so we’re looking to find a function that has the derivative $x\cos x$. Any ideas?

Our first thought might be ‘$\frac{\dif}{\dif x} \sin x = \cos x$ so maybe something like $x\sin x$ might work.’ See if that works, and if it doesn’t then modify it so that it does. Show assumed knowledge

The product rule states that \[\frac{\dif}{\dif x} \left(f(x)g(x)\right) = f’(x)g(x) + f(x)g’(x).\] $\frac{\dif}{\dif x}\cos x = -\sin x$ and $\frac{\dif}{\dif x}\sin x = \cos x$.Can you add something to $x\sin x$ that will cancel out the extra part of the derivative that we don’t want?When we differentiate $x\sin x$ we get $1\sin x + x\cos x$ using the product rule. The $x\cos x$ that we wanted is in there, but there’s also a pesky $\sin x$. How can we get rid of that?

Instead of using $x\sin x$, what we need is $x\sin x + \text{something}$, where the ‘something’ is going to cancel out with the extra $\sin x$ after we differentiate, so the derivative of the something needs to be $-\sin x$. What we need is $\cos x$.

Let’s check that it works: \begin{align*} \frac{\dif}{\dif x} \left(x\sin x + \cos x\right) &= 1\sin x + x\cos x - \sin x\\ &= x\cos x. \end{align*} It works! Hence $\int x\cos x\dif x = x\sin x + \cos x + c$.

What about a definite integral? Find $\int_0^{\pi/2} x\cos x\dif x$ Show answer

\begin{align*} \int_0^{\pi/2} x\cos x\dif x &= \left[ x\sin x + \cos x\right]_0^{\pi/2}\\ &= \left(\frac{\pi}{2}\times1 + 0\right) - \left(0 + 1\right)\\ &= \frac{\pi}{2} - 1 \end{align*}