Well the answer is that it doesn't always work.
Integration by parts is a pretty simple formula if we're just going to memorize it.
After all, we only have to remember that the integral of u dv is equal to u times v minus
the integral of v du.
But what's really going on under the surface of this formula?
How does integration by parts even work?
Well, the integration by parts formula is actually just a consequence of the product
rule for derivatives.
And that should make sense to us if we really think about it.
After all, the product rule tells us how to find the derivative of the product of two
functions.
So if want to know how to integrate the product of two functions, it makes a lot of sense
to start with the product rule!
And that's exactly what integration by parts does.
It shows us how to integrate the product of two functions.
So if we assume the product rule formula is true, then it's pretty straightforward to
see how the integration by parts formula is also true.
If we start with the product rule, which tells us that the derivative of the product of two
functions f and g is given by the sum of the derivative f times g and f times the derivative
of g, then we can integrate both sides of the product rule formula.
But because we're making the same change to both sides, we're not actually changing the
value of the equation.
Whenever we integrate the sum of two terms, we can split the integral in two and integrate
each term separately, so that's what we'll do to the right side.
Over here on the left, because integration and differentiation are inverse operations
that undo each other, the integral and derivative cancel each other out.
Now we subtract this first integral from both sides.
And just like that, we've got the integration by parts formula.
We don't usually write it this way, but if we say that f(x) is u and that g(x) is v,
then we can replace f(x) with u and g(x) with v, and then replace f'(x) with du and g'(x)
with dv.
Then we'll just rearrange slightly, and this is what we recognize as the typical integration
by parts formula.
So now we know where the integration by parts formula comes from, but why does it work?
Well the answer is that it doesn't always work.
Integration by parts is not going to help you solve every integral, and for many integrals
it's not even necessary.
But the reason we use it sometimes is because it can take an integral from one that we can't
evaluate, to a simpler integral that we can evaluate.
If we look at the formula, what we're literally doing is changing the integrand from u and
the derivative of v, to v and the derivative of u.
Well, if the integral on the right happens to be easier to evaluate then the integral
on the left, then integration by parts is a super helpful tool!
And isn't that what all the methods of integration do?
Substitution, partial fractions, trig substitution...
they all just reformat the integrand, without changing its value, so that the resulting
integrand is easier to integrate than the one that we started with.
And integration by parts is no different.
It's based on the product rule, and it works because it makes the integrand easier to evaluate.