Rearranging Exponentials and Logarithms#
When working with logarithms and exponentials the same rules for rearranging apply. We still use BODMAS in reverse order and the logarithms and exponentials are rearranged at the Orders stage. There are two rules that we utilise when rearranging these equations:
\(a^{\log_a(x)} = x\)
\(\log_a(a^x) = x\)
This also works if we are using \(\ln\) instead of \(\log\); it’s just different notation.
Important
When exponentiating or taking a logarithm, we must do the operation to the whole side of the equation.
Example
Make \(x\) the subject of the following equations:
\(y = 10^x - 1\)
\(\ln(x+2) = \ln(y) + \ln(2)\)
Solution:
As we are doing BODMAS in reverse,
We start be adding 1 to both sides: \(y + 1 = 10^x\)
Take the base-10 logarithm of both sides: \(\log_{10}(y+1) = \log_{10}(10^x)\)
The right hand side simplifies to \(x\): \(x = \log_{10}(y+1)\)
For the second example,
We can use laws of logarithms to get the right hand side all in one \(\ln\): \(\ln(x+2) = \ln(2y)\)
Exponentiate both sides: \(e^{ln(x+2)} = e^{\ln(2y)}\)
Simplify this: \(x+2 = 2y\)
Subtract 2 from both sides: \(x = 2y-2\).
Similar to other rearrangements, sympy.solve can help.
from sympy import symbols, Eq, solve
x, y = symbols('x y', positive=True, real=True)
eq = Eq(y, 10 ** x - 1)
solve(eq, x)
[log(y + 1)/log(10)]
from sympy import log
eq = Eq(log(x+2), log(y) + log(2))
solve(eq, x)
[2*y - 2]
The pH Equation
Rearrange the pH equation \(\textrm{pH} = -\log_{10}[\textrm{H}^+]\), so that \([\textrm{H}^+]\) is the subject of the formula.
Solution: First, we use the third law of logarithms to get:
We now take base-10 exponentials of both sides of the equation.
Logarithms and exponentials to the same base cancel.
With Python.
pH, H_conc = symbols('pH H_conc')
eq = Eq(pH, -log(H_conc))
solve(eq, H_conc)
[exp(-pH)]
Above, in Python, we use \(\ln\) in place of \(\log_{10}\), and hence we have a result that uses \(\exp\) instead of 10 to the power -pH.
The Arrhenius Equation
Rearrange the Arrhenius equation
so that \(T\) is the subject of the formula.
Solution: First we need to divide both side of the equation by \(A\).
The inverse of the exponential function is the natural logarithm. So we must take the natural logarithm of both sides of the equation:
Logarithms and exponentials to the same base cancel.
Here, we are working with \(\exp\), so there is no confusion/conversion.
from sympy import exp
k, A, E_a, R, T = symbols('k A E_a R T')
eq = Eq(k, A * exp(-E_a / (R * T)))
solve(eq, T)
[E_a/(R*log(A/k))]