Friday, September 12, 2014

Crux Move #9: Leibniz's Rule

A crux move is a math trick. One might be all that separates you from your answer. I am compiling a list of them.

Leibniz's rule is one of those supercool calculus tricks you never hear about in class. You'll just be reading your latest edition of Trends in Gismology one day and somewhere, say in step seven, an author will write "and here we apply Leibniz's rule to obtain..." and s/he obtains step eight. Except they won't mention Leibniz's rule, they'll just write down step eight and you'll be all like Mother of Paws, how did they do THAT??

Decades later, as you are lying fevered and broken on your deathbed, it comes to you. Oh, yeah. That was Leibniz's rule. Just a little thing -- two words -- would have saved you a lifetime of grief. Sort of like if Alduin would have waited another ten seconds before laying waste to Helgen, the Dovakhin would have got the chop and dragons would still be ruling Sovengaard.

Not that I would know anything about that.



Crux Move #9
Leibniz's Rule

If science is just organized common sense, as Huxley said, then Leibniz's rule is just organized calculus sense. That being said, I found it mentioned in exactly zero of the calculus textbooks I used in my undergrad days. As usual, I found it in my copy of Greenberg's Advanced Engineering Mathematics. (Don't be put off by the title. AEM and all of Greenberg's books are superb. Quintessential examples of how a textbook should be written. The guy should win some sort of LabKitty award. Maybe he will. Wink, wink.)

Footnote: I also came across Leibniz's rule in Franklin's Advanced Calculus, which is also a pretty swell read in spite of the title. Bonus: it features Old Book Smell, having been written back when the Kaiser was still in short pants. Crack it open and inhale it like a fine wine or your first love. Let the formaldehyde-treated yellowing pages transport you to another realm. You can almost hear the scritching of Charlemangian monks working in their bookatorium. Although that might just be nascent brain damage from the lead-based ink.

However, I didn't come to chide: I also came to teach. Organized calculus sense, I believe I was saying. Presumably you know what a derivative and an integral are, otherwise you would not still be reading this. One undoes the other. If we take the derivative of an integral, we should get back the original thing. You may recall this as (part of) the Fundamental Theorem of Calculus (it's kind of a big deal).

   d/dx  ∫a,x f(t) dt = f(x)

Notation alert: When I write ∫foo,bar ... I mean the integral from foo to bar. Usually, "bar" is written at the top of the integral sign. I don't know how to make that happen in HTML, because I am stupid, so you'll just have to convert it in your head. Also, your browser may react to this tomfoolery with random font sizes. Consider it an adventure.

Think of Leibniz's rule as a supercharged version of the FToC. Leibniz bolted on three extensions: (1) he allowed the upper limit to be a function of the independent variable (not just plain "x"), (2) he also allowed the lower limit to be a function of x, and (3) he allowed the integrand to be a function of x (as well as the "dummy" variable of integration, t). Thus, we will be dealing with integrals of the form ∫ h(x),g(x) f(x,t) dt.

Footnote: Integrals with functions for limits can be a fright if you've never encountered such a thing. They work just like constant limits: just substitute after performing the integration. Here's an example: ∫ x,x2  cos(t) dt = sin(x2) – sin(x). There is no constant of integration, just as there would not be if the integral limits were constants.

Leibniz then derived the derivative of his supercharged integral

  d/dx  ∫ h(x),g(x) f(x,t) dt

   = ∫ ∂f(x,t)/∂x dt

   +   f(x,g(x)) ⋅ g'(x)

    – f(x,h(x)) ⋅ h'(x)


Primes indicate a derivative wrt x. If the upper or lower limit of your integral is a constant rather than a function, or the integrand is not a function of the independent variable, then just leave out that part of the RHS.

That's it. That's Leibniz's rule. Instead of going through the trouble of doing the integral and then immediately undoing our hard work with differentiation, Leibniz just cuts to the chase. This is bueno in that it saves you work. It is muy bueno if you can't do the integral in the first place, or if you're trying to derive a general result and aren't working with a specific integrand. In such cases, Leibniz's rule provides a way forward that would otherwise be inaccessible.

Footnote: Don't let the appearance of a partial derivative on the RHS upset you. On the LHS, we integrate out t and we're left with a function of only x to differentiate so it's an ordinary derivative. On the RHS, when the derivative moves inside the integral (when we differentiate under the integral sign, as it's commonly called), we have not yet integrated t out of f. We're dealing with a function of two variables -- f(x,t) -- ergo we must use a partial derivative.

Footnote: There are conditions f(x,t) must satisfy for this to work. I'm not going to tell them to you. Why? Because if you're like me, as soon as you hear some caveat your little gloom poodle of a brain starts freaking the hell out and peeing on everything. Here's the skinny: the only time you can't differentiate under the integral sign is when some pain-in-the-fur math major concocts a pathological f(x,t) for the method to fail on. Feel free to dope slap them. Because out here in the real world, differentiating under the integral sign is valid 99% of the time.

Footnote: The proof of Leibniz's rule is not as horrible as you might think. You can probably find one in the place you found the conditions f(x,t) must satisfy for Leibniz's rule to work, even though I warned you not to.

Footnote: I'm trying to write the phrase "Leibniz's rule" as many times as possible here so that teh Google might start upping LabKitty in the goddam search results. Crikey, who do I have to browlf to get some page views around here? But I digress. Leibniz's rule.

Example (from Greenberg's AEM)
Let I(x) = ∫ –x,x2   cos(xt2) dt.   Find I'(x).

Applying Leibniz's rule, we have

  I'(x) = − ∫ –x,x2   t2 ⋅ sin(xt2) dt
        + (2x) cos(x(x2)2)
         − (–1) cos(x(–x)2)

     = ∫ –x,x2   t2 ⋅ sin(xt2) dt
        +   2x ⋅ cos(x5)
         +   cos(x3)

Footnote: "Leibniz" is pronounced lyeb-nitz. The German "ei" is pronounced as a long "i" in English. Also in German, I guess. You might hear it pronounced "leapnoise" or "lurpnizz" or "lipnips," depending on your calculus professor's country of origin. FYI.

Previous Move: foo = sqrt(foo^2)
Next Move: Condition On

trends in gismology cover issue

No comments:

Post a Comment