Supposed method of integration: “long dividing” by $d$

I came across this seemingly interesting, but poorly exemplified, method of integrating:

Since integration is the inverse of differentiation, you can think of integration as “dividing” by $$d$$.

J. P. Ballantine  shows that you can formally divide by $$d$$ and get the correct integral. For example, he arrives at $$\int x^2 \sin x\,dx=(2-x^2)\cos x + 2x\sin x + C$$ using long division! J. P. Ballantine. Integration by Long Division. The American Mathematical Monthly, Vol. 58, No. 2 (Feb., 1951), pp. 104-105

Surely the claim that this is rigorous is questionable. However, it would be fascinating to understand how to follow this method and maybe even understand why it works; the example has no explanation, and I can’t put the steps together via reverse engineering.

Could someone shed some light on this technique?

addendum: An additional example would really complete the perfect response $$\ddot\smile$$

• "Formal" doesn't mean rigorous here, it means based on form; messing around with the symbols without worrying too much about whether they mean anything. Euler famously did this sort of thing a lot. Nov 1 '18 at 19:45
• @QiaochuYuan Gotcha! Thank you for specifying that; that distinction makes a lot more sense than what I thought. I’ve made a revision ;) Nov 1 '18 at 19:46

I managed to "reverse engineer" the steps and I am going to go through them for you!

First, write the function you wish to integrate on the left

$$x^2 \sin x\ dx$$

Now find a function such that, when you differentiate it, the $$x^2 \sin x$$ comes up. Ah! When you differentiate $$-x^2 \cos x$$ you get $$x^2 \sin x - 2x \cos x$$, so it has the bit you want and the other bit seems "smaller" in the sense of "degree" or something. Just write that $$-x^2 \cos x$$ on the side, differentiate it and subtract the derivative, getting: Now it's like we found an anti-derivative for the function we want to integrate, but in doing so we got the extra term $$2x \cos x$$ that we need to cancel... Think of something that, when differentiated, arrives at $$-2x \cos x$$... Ah! When you differentiate $$2x \sin x$$, you get the $$2x \cos x$$ and an extra $$2 \sin x$$. Write the $$2x \sin x$$ on the right, differentiate it, and subtract from whatever you had, getting: and you keep going. The point being, you are always trying to come up with something (in some sense, smaller) that counters the leftovers you have from finding the anti-derivatives of the other terms!

Was I clear enough?

Let us integrate $$x \log x$$ just for the fun of it. Can you come up with something that, when differentiated, gives $$x \log x +$$ something? Of course you can, just notice that $$(\frac12x^2\log x)' = x\log x + \frac12 x$$

So we now have to deal with the extra $$-\frac12 x$$.

Can you come up with something that cancels that $$-\frac12 x$$? Of course you can, because $$-\frac14 x^2$$ does it! We now get

$$0$$

meaning we are done and

$$\int x \log x = \frac12 x^2 \log x - \frac14 x^2 + C$$

• It’s like only doing half of the product rule! isn’t it? Nov 1 '18 at 20:00
• “$x\log x +\text{something}$”: That’s the key point right there. If you don’t mind, I’m going to ruminate on that for a bit, then I’ll probably come back and mark this answer $\color{green}{\checkmark}$—but first I’ll let other people contribute their fair shares too $\ddot\smile$ Nov 1 '18 at 20:05
• sure thing @ChaseRyanTaylor . I tried to include a picture of the division process but I couldn't. Do you want me to further develop my answer?
– RGS
Nov 1 '18 at 20:07
• @RGS I followed it just fine. And actually, I think “long division” is a misleading name. The subtraction pattern is a way to keep track of the terms you have left to reconcile, like you do with place values / partial fractions in long division, but whence the author got this “‘dividing’ by $d$” notion is beyond me. . . . Nov 1 '18 at 20:10
• @ChaseRyanTaylor sorry nobody chipped in in the meantime
– RGS
Nov 12 '18 at 9:39