Finding the indefinite integral of the function \((x\cos x+\sin x)\) is difficult on the first sight. However, one hint changes the world:
You may now try to solve the problem yourself, and then look at the following example that solves the problem.
The following problems are similar in nature, and it is a good idea to work on them before proceeding to the theory of integration by parts.
We may now solve a problem similar to the one from Example 1:
If \(u\) and \(v\) are differentiable functions then
\[\int u(x)\cdot v^{\prime}(x)\,dx=u(x)\cdot v(x)-\int v(x)\cdot u^{\prime}(x)\,dx.\]Let us color the integral on the left in blue, and the integral on the right in green.
The idea of the integration by parts is to start with difficult blue integral, and end up with an easy green integral. In Example 4, the integral \(\int x\cos x\,dx\) was blue, and \(\int \sin x\,dx\) was green.