It was repeated integration by parts. Up front, I’m going to have to set some terminology: I(f(x)) means the indefinite integral of f(x)dx. Also, f'(x) means the derivative of f(x)dx, as does d(f(x))/dx. That should be all I need. Also, all integrations and derivations are with respect to x, and all functions are of one variable. Also, I’m going to assume that you know that whenever you take an integral, you have to add a constant.

**The Law**

So, the law of integration by parts is the tool that makes the important parts happen. As you may know, the multiplication rule of derivatives says this:

`d(h(x)g(x))/dx = h'(x)g(x) + h(x)g'(x)`

Integrate both sides:

`h(x)g(x) = I(h'(x)g(x) + h(x)g'(x))`

An integral of sums is a sum of integrals:

`h(x)g(x) = I(h'(x)g(x)) + I(h(x)g'(x))`

`I(h(x)g'(x)) = h(x)g(x) - I(h'(x)g(x)`

That last step is the law of integration by parts. If you have something that’s very hard to integrate, but it’s the product of two functions, one of which is easy to integrate and the other is easy to differentiate, that’s when you use this. Here’s an example:

**An Example**

Find the integral:

`I(-x * cos(x))`

let h'(x) be -cos(x) and f(x) be x. Then you have:

` I(-x * cos(x)) = x*sin(x) - I(sin(x))`

And since the integral of sin(x) is easy, you get this:

` I(-x*cos(x)) = x*sin(x) + cos(x)`

Integral found!

Now, there’s a very cool little trick you can use where you do integration by parts twice. This is my favorite part of calculus.

**The trick where you use the law twice and the answer pops out**

You want to integrate this:

1) `I(e^x * sin(x))`

Step one is apply the law of integration by parts:

2) `I(e^x * sin(x)) = - e^x * cos(x) + I(e^x * cos(x))`

Now you use the law of integration by parts again on the last part:

3) `I(e^x * cos(x)) = e^x * sin(x) - I(e^x * sin(x))`

Substitute the right half into line 3 into line 2:

`I(e^x * sin(x)) = e^x * sin(x) - e^x * cos(x) - I(e^x * sin(x))`

Add `I(e^x*sin(x))`

to both sides and divide by 2:

`I(e^x * sin(x)) = (1/2)(e^x)(sin(x)-cos(x))`

Integration accomplished!

As a bonus, here’s a little trick a professor showed me once. If you took calculus, you know that `I(x^-1) = ln(|x|)`

. But what if we tried to evaluate this integral with the law of integration by parts?

**The trick where 1=0**

Here’s the law again:

`I(h(x)g'(x)) = h(x)g(x) - I(h'(x)g(x)`

So, let `(x^-1)`

be `h(x)`

and let `1`

be `g'(x)`

.

`I(1 * x^-1) = x * x^-1 - I(-x^(-2) * x)`

Which simplifies down a lot:

`I(x^-1) = 1 + I(x^-1)`

Which simplifies further:

`0 = 1`

Little known fact: this is what sank the Titanic.