This is one of the trickier methods of integration, and it requires some practise. The basic idea is to split a function which would be difficult to integrate into two parts. Differentiating one part and integrating the other will then lead to a function which is much easier to integrate.
The formula is that the integral of u dv = uv - the integral of v du. It is best demonstrated with an example:
Let's integrate f(x) = xcos(x)
We can see that x will disppear if we differentiate it, so let's set x = u and cos(x) = dv.
Differentiating u and integrating dv then gives du = 1 and v = sin(x)
Now we substitute these into the formula: xsin(x) - integral of sin(x)
Sin(x) is easy to integrate, it is just -cos(x). Now we have our answer! The integral of xcos(x) = xsin(x) + cos(x) + c, where c is our unknown (and always necessary!) constant of integration.