Differentiating Exponential and Logarithmic Functions#
Differentiaing Exponentials#
The exponential function \(e^x\), when differentiated, gives itself. This is shown as the rule below:
We can also differentiate when the \(x\) has a coefficient, for example \(y=e^{4x}\), and also when the exponential is multiplied by a constant, for example \(y=3e^x\). We combined these into the rule below:
Example
Differentiate the following with respect to \(x\):
\(y=e^2x\)
\(y=8\exp{\left(-\frac{x}{3}\right)}\)
Solution:
Using the rule:
note \(y=e^2x\), so \(a=1\) and \(b=2\), hence \(\frac{dy}{dx}=2e^{2x}\).
Using the rule:
note \(y=8\exp{\left(-\frac{x}{3}\right)}\), so \(a=8\) and \(b=-\frac{1}{3}\), hence
We can check these results with sympy
.
from sympy import symbols, diff, exp
x = symbols('x')
diff(exp(2 * x))
diff(8 * exp(-x / 3))
Differentiating Logarithms#
We differentiate logarithmic functions using the rule shown below:
We can differentiate when the \(x\) has a coefficient, for example \(y=\ln{(4x)}\), and also when the logarithmic function has a coefficient, for example \(y=3\ln{(x)}\). We combine these into the rules below:
Example
For \(y=a\ln{(bx)}\), find \(\frac{dy}{dx}\).
Solution: Using laws of logarithms, we can write \(y=a\ln{(bx)}\) as:
Now differentiating this as a sum gives:
Now, as \(\frac{d}{dx}\left[\ln{(x)}\right] = \frac{1}{x}\) and \(\frac{d}{dx}\left[\ln{(b)}\right] = 0\), as \(\ln{(b)}\) is a constant, so we have:
Example
Differentiate:
\(y = \ln{(3x)}\)
\(y = -\frac{4}{5}\ln{\left(\frac{x}{2}\right)}\)
Solution:
We use the rule:
Note that we have \(y=\ln{(3x)}\), so \(a=1\) and \(b=3\). Hence \(\frac{dy}{dx}=\frac{1}{x}\).
We use the rule:
Note that we have \(y=-\frac{4}{5}\ln{\left(\frac{x}{2}\right)}\), so \(a=-\frac{4}{5}\) and \(b=\frac{1}{2}\). Hence \(\frac{dy}{dx} = -\frac{4}{5}\times \frac{1}{x} = -\frac{4}{5x}\).
Again, sympy
can be used to show this also.
from sympy import log
diff(log(3 * x))
diff(-4 / 5 * log(x / 2))