Let’s begin by revisiting
Pattern 12.3.10. If function
\(q(t)\) is a vertical scaling of another function
\(p(t)\text{,}\) with
\(q(t) = k p(t)\text{,}\) then when computing
\(dq/dt\) at a particular point
\(t = t^\ast\) we have
\begin{align*}
\dqdt \amp = \frac{q(t^\ast + dt) - q(t^\ast)}{dt} \\
\amp = \frac{k p(t^\ast + dt) - k p(t^\ast)}{dt} \\
\amp = k \frac{p(t^\ast + dt) - p(t^\ast)}{dt} \\
\amp = k \ddt{p} \text{.}
\end{align*}
What if the scale factor \(k\) isn’t actually constant, but itself is varying?
\begin{equation*}
q(t) = k(t) p(t)
\end{equation*}
Over the very short time interval \(t^\ast \le t \le t^\ast + dt\) (or \(t^\ast + dt \le t \le t^\ast\text{,}\) if \(dt\) is negative), we might assume that \(k(t)\) is approximately constant:
\begin{align*}
k(t) \amp \approx k^\ast = k(t^\ast)
\amp
\amp\text{for all}
\amp
t^\ast \amp \le t \le t^\ast + dt\text{.}
\end{align*}
Then a small variation in \(t\) causes a small variation in \(p(t)\text{,}\) which causes a variation of approximately
\begin{equation*}
k^\ast \, \ddt{p}
\end{equation*}
in \(q(t)\text{.}\) But \(k(t)\) isn’t actually constant — a small variation in \(k(t)\) also causes a small variation in \(q(t)\text{.}\) So what if we turn this around, and consider
\begin{equation*}
q(t) = p(t) k(t)
\end{equation*}
as a vertical scaling of \(k(t)\) with varying scale factor \(p(t)\text{?}\) Then just as before, we might now assume that \(p(t)\) is approximately constant:
\begin{align*}
p(t) \amp \approx p^\ast = p(t^\ast)
\amp
\amp\text{for all}
\amp
t^\ast \amp \le t \le t^\ast + dt\text{.}
\end{align*}
And then a small variation in \(t\) causes a small variation in \(k(t)\text{,}\) which causes a variation of approximately
\begin{equation*}
p^\ast \, \ddt{k}
\end{equation*}
in \(q(t)\text{.}\) To get the total variation in \(q(t)\text{,}\) we should add these variations together:
\begin{equation*}
\dqdt = k^\ast \, \ddt{p} + p^\ast \, \ddt{k} \text{.}
\end{equation*}
Since this is true at all points \(t = t^\ast\text{,}\) we may as well just write
\begin{equation*}
\dqdt = k(t) \, \ddt{p} + p(t) \, \ddt{k} \text{.}
\end{equation*}
Justification.
First, we have
\begin{equation*}
q(t + dt) = f(t + dt) g(t + dt) \text{.}
\end{equation*}
To compute \(dq/dt\text{,}\) we compute the difference of \(q(t + dt)\) and \(q(t)\text{,}\) and divide by \(dt\text{.}\) But in that difference calculation, the result won’t change if we “vertically shift” both terms by the same amount:
\begin{equation*}
\bigl[ q(t + dt) - C \bigr]
- \bigl[ q(t) - C \bigr]
= q(t + dt) - q(t)\text{.}
\end{equation*}
Using \(C = f(t + dt) g(t)\text{,}\) we have
\begin{align*}
q(t + dt) - C \amp = f(t + dt) g(t + dt) - f(t + dt) g(t)\\
\amp = f(t + dt) \bigl[ g(t + dt) - g(t) \bigr]\\
\\
q(t) - C \amp = f(t) g(t) - f(t + dt) g(t)\\
\amp = \bigl[ f(t) - f(t + dt) \bigr] g(t)\text{.}
\end{align*}
By the algebra rules of fractions, we may divide each of these by \(dt\) before subtracting:
\begin{align*}
\frac{q(t + dt) - C}{dt} \amp = f(t + dt) \cdot \frac{g(t + dt) - g(t)}{dt} \\
\amp = f(t + dt) \cdot \ddt{g} \\
\\
\frac{q(t) - C}{dt} \amp = \frac{f(t) - f(t + dt)}{dt} \cdot g(t) \\
\amp = - \ddt{f} \cdot g(t) \text{.}
\end{align*}
So then we have
\begin{align*}
\frac{q(t + dt) - q(t)}{dt} \amp = \frac{q(t + dt) - C}{dt} - \frac{q(t) - C}{dt} \\
\amp = f(t + dt) \cdot \ddt{g} - \left( - \ddt{f} \cdot g(t) \right) \\
\amp = f(t + dt) \cdot \ddt{g} + \ddt{f} \cdot g(t)
\end{align*}
Finally, since \(f\) is assumed to be differentiable, it must be continuous, and so
\begin{equation*}
dt \approx 0 \qquad\implies\qquad f(t + dt) \approx f(t) \text{.}
\end{equation*}
From this, we have
\begin{equation*}
\dqdt = f(t) \cdot \ddt{g} + \ddt{f} \cdot g(t) \text{,}
\end{equation*}
as required.
We can also combine the product rule with logarithmic differentiation to tackle derivatives that would have been more difficult to compute before.
Example 17.1.5. An exponential functin with a varying base.
Consider
\begin{align*}
q(t) \amp = \bigl[\cos(t)\bigr]^t \amp -\frac{\pi}{2} \amp \lt t \lt \frac{\pi}{2} \text{.}
\end{align*}
(We restrict the domain to ensure the base is always positive.)
We can’t apply
Pattern 12.4.3, because the exponent is varying. We can’t apply
Pattern 12.5.7 directly, because the base is varying. So instead we’ll take the logarithm of each side so that we can turn that varying exponent into a factor:
\begin{gather*}
q = \bigl[\cos(t)\bigr]^t \\
\ln(q) = t \ln\bigl[\cos(t)\bigr]
\end{gather*}
(We haven’t bothered with the absolute value brackets this time, since we have already restricted the domain so that \(q\) is always positive.)
Now we differentiate both sides:
\begin{gather*}
\opddt \, \bigl[\ln(q)\bigr] = \opddt \Bigl[ t \ln\bbrac{\cos(t)} \Bigr] \\
\frac{1}{q} \cdot \dqdt
= t \cdot \opddt \Bigl[ \ln\bbrac{\cos(t)} \Bigr]
+ \ddt{t} \cdot \ln\bbrac{\cos(t)}\\
\frac{1}{q} \cdot \dqdt
= t \cdot \frac{1}{\cos(t)} \cdot \opddt \bbrac{\cos(t)}
+ 1 \cdot \ln\bbrac{\cos(t)}\\
\frac{1}{q} \cdot \dqdt
= \frac{t}{\cos(t)} \cdot \bbrac{- \sin(t)}
+ \ln\bbrac{\cos(t)}\\
\frac{1}{q} \cdot \dqdt = \ln\bbrac{\cos(t)} - t \tan(t) \text{.}
\end{gather*}
Isolating \(dq/dt\) and subsituting back in for \(q\text{,}\) we have
\begin{equation*}
\dqdt = \bigl[\cos(t)\bigr]^t \cdot \Bigl[\ln\bbrac{\cos(t)} - t \tan(t)\Bigr] \text{.}
\end{equation*}