# GL(s,R)

## July 7, 2012

### The Usual Way Is Just Fine, Man.

Filed under: Tricks of the Trade — Adam Glesser @ 11:29 pm
Tags: ,

(with Professor Glesser)

As I mentioned in this much-maligned post, “my all-time favorite differentiation technique is logarithmic differentiation.” In that post, I give examples of two types of problems where the technique proves useful. The second type—where a variable function is raised to a variable power—is handled with the SPEC rule (essentially the sum of the power rule and exponential rule, with the chain rule used as per normal). Here is the example I gave of a function of the first type.
$y = \sqrt[3]{\dfrac{(3x-2)^2\sqrt{2x^3+1}}{x^4(x-1)}}$
Typically, I show the students how to use logarithmic differentiation in order to compute the derivative of this type of function (see the post linked to above for the full derivation). However, this is not how I compute it myself!

# Story Time

Like most everybody who takes calculus, I learned the quotient rule for differentiation:

$\left(\dfrac{f}{g}\right)' = \dfrac{g \cdot f' - f \cdot g'}{g^2}$

Or, in song form (sung to the tune of Old McDonald):

Low d-high less high d-low
E-I-E-I-O
And on the bottom, the square of low
E-I-E-I-O
[Note that when sung incorrectly as High d-low less low d-high, the rhyme will not work!]

At some point, I was given an exercise to show that
$\left(\dfrac{f}{g}\right)' = \dfrac{f}{g}\left(\dfrac{f}{f'} - \dfrac{g}{g'}\right).$
If you start from this reformulation, it is a simple matter of algebra to get to the usual formulation of the quotient rule. However, a couple of things caught my eye. First, the reformulation seemed much easier to remember: copy the function and then write down the derivative of each function over the function and subtract them; the order is the “natural” one where the numerator comes first.

## Story Within A Story Time

Actually, there is a reasonably nice way to remember the order of the quotient rule, at least if you understand the meaning of the derivative. Assume that both the numerator and denominator are positive functions. If the derivative of the numerator is increasing, then the numerator and the quotient are getting bigger faster, so the derivative of the quotient should also be getting bigger, i.e., $f'$ should have a positive sign in front of it. Similarly, if the derivative of the denominator is increasing, then the denominator is getting bigger faster, which means the quotient is getting smaller faster, and so the derivative of the quotient is decreasing, i.e., $g'$ should have a negative sign in front of it.

Secondly, the appearance of the original function in the answer screams: LOGARITHMIC DIFFERENTIATION. Let’s see why.

If $y = \dfrac{f}{g}$, then $\ln(y) = \ln\left(\dfrac{f}{g}\right) = \ln(f) - \ln(g)$. Differentiating both sides using the chain rule yields
$\dfrac{y'}{y} = \dfrac{f'}{f} - \dfrac{g'}{g},$
and so the result follows by multiplying both sides by $y$. This is one of my favorite exercises to give first year calculus students—before and after teaching them logarithmic differentiation*.

*Don’t you think that giving out the same problem at different times during the course is an underutilized tactic?

Being a good math nerd, I had to take this further. What if the numerator and denominator are, themselves, a product of functions? Assume that $f = f_1 \cdot f_2 \cdots f_m$ and that $g = g_1 \cdot g_2 \cdots g_n$. Setting $y = \dfrac{f}{g}$, taking the natural logarithm of both sides, and applying log rules, we get:

$\ln(y) =\ln(f_1) + \ln(f_2) + \cdots + \ln(f_m) -\ln(g_1) - \ln(g_2) - \cdots - \ln(g_n).$

Differentiating (using the chain rule, as usual) gives:

$\dfrac{y'}{y} = \dfrac{f'_1}{f_1} + \dfrac{f'_2}{f_2} + \cdots + \dfrac{f'_m}{f_m} - \dfrac{g'_1}{g_1} - \dfrac{g'_2}{g_2} - \cdots - \dfrac{g'_n}{g_n}.$

Multiplying both sides by $y$ now gives us the formula:

$y' = \dfrac{f}{g}\left(\dfrac{f'_1}{f_1} + \dfrac{f'_2}{f_2} + \cdots + \dfrac{f'_m}{f_m} - \dfrac{g'_1}{g_1} - \dfrac{g'_2}{g_2} - \cdots -\dfrac{g'_n}{g_n}\right).$

An immediate example of using this is as follows. Differentiate $y = \dfrac{\sin(x)e^x}{(x+2)\ln(x)}$. The usual way would involve the quotient rule mixed with two applications of the product rule. The alternative is to simply rewrite the function, and to work term by term giving:

$y' = \dfrac{\sin(x)e^x}{(x+2)\ln(x)}\left(\dfrac{\cos(x)}{\sin(x)} + \dfrac{e^x}{e^x} - \dfrac{1}{x+2} - \dfrac{1/x}{\ln(x)}\right),$

which immediately reveals some rather easy simplifications.

But we haven’t used all of the log rules yet! We haven’t used the exponential law. So, let’s assume that each of our $f_i's$ and $g_j's$ has an exponent, call them $a_i$ and $b_j$, respectively. In this case, using logarithmic differentiation, we get:

$\ln(y) = a_1\ln(f_1) + \cdots + a_m\ln(f_m) - b_1\ln(g_1) - \cdots - b_n\ln(g_n)$.

Differentiating, we get almost the same formula as above, but with some extra coefficients:

$y' = \dfrac{f}{g}\left(a_1\dfrac{f'_1}{f_1} + \cdots + a_m\dfrac{f'_m}{f_m} - b_1\dfrac{g'_1}{g_1} - \cdots - b_n\dfrac{g'_n}{g_n} \right).$

Look back to the example near the top of the post. If we rewrite it with exponents instead of roots, we get:

$y = \dfrac{(3x-2)^{2/3}(2x^3 + 1)^{1/6}}{x^{4/3}(x-1)^{1/3}}$.

Taking the derivative is now completely straight-forward.

$y' = \dfrac{(3x-2)^{2/3}(2x^3 + 1)^{1/6}}{x^{4/3}(x-1)^{1/3}}\left(\dfrac{2}{3}\cdot\dfrac{3}{3x-2} + \dfrac{1}{6}\cdot\dfrac{6x^2}{2x^3+1} - \dfrac{4}{3}\cdot\dfrac{1}{x} - \dfrac{1}{3}\cdot \dfrac{1}{x-1}\right).$

Again, there is some simplifying to be done.

An easier problem is one without a denominator! Let $y = \tan(2x)x^{3/4}(3x-1)^3$. Normally, one would use the product rule here, but why don’t we try our formula. It gives:

$y' = \tan(2x)x^{3/4}(3x-1)^3\left(\dfrac{2\sec^2(2x)}{\tan(2x)} + \dfrac{3}{4}\cdot \dfrac{1}{x} + 3\dfrac{3}{3x-1}\right).$

That was pretty painless, while the product rule becomes more tedious as the number of factors in the product increases.

Oh, and if you can’t imagine this being appropriate to teach to students, no less an authority than Richard Feynman encouraged his students to differentiate this way. At the very least, his support gives me the confidence to let you in on my little secret.

1. I like your formula very much, because it unifies the product, quotient, and power rules. Moreover, the formula can be proved using those rules, without recourse to logarithms. I also like the idea of giving the same problem at different times, and it would be worthwhile to prove the formula a second time using logarithms.

When I was learning calculus, I was uneasy about logarithmic differentiation, because it seemed to allow logarithms of negative numbers. For example, if y = x^3 then y’/y = 3/x, and this is valid even when x < 0, even though ln(x^3) is undefined when x < 0. Years later, I realized that you could avoid the problem by taking absolute values, but your formula neatly avoids the issue.

Comment by Dave Radcliffe (@daveinstpaul) — July 8, 2012 @ 10:51 am

• Thanks for the comments, Dave. I hadn’t thought about proving it without logarithms, but you’re right (up to including the chain rule). I think the stronger students would have a chance doing it without logarithms, and so it would make an excellent follow-up question (I have this bias against having them prove things the long way first and then the short way later; I always found it more natural to start with the short proof and then have somebody tell me to do it but without using whatever nice trick I was using).

The discussion about negatives and logarithms is one that I usually won’t bring up unless the students do. When I first started teaching, I initiated the conversation and I’m pretty sure I did significant permanent damage to them!

Comment by Adam Glesser — July 8, 2012 @ 1:02 pm

The Rubric Theme. Create a free website or blog at WordPress.com.