Taking logarithms is the inverse of [[Exponents|exponentiation]]. That is $\log_b$ of some number $x$ maps to the number $y$ such that $b^y = x$. We call $b$ the *base* of the logarithm. If the base is not specified (ie we just have an expression such as $\log x$, then the base is assumed to be 10. $\ln$ is the *natural log* function, which is the same as log to the base $e$.
Given this definition, we can deduce (and prove) some useful properties of logarithms. In the proofs below, we are assuming all variables $x,y,b$ and $c$ are real numbers (ie $\{b,c,x,y \in \mathbf{R}\}$). It probably would work for complex numbers also and in fact I don’t see why any field wouldn’t be ok but idk.
## Log properties
$
\begin{align*}
\log_b(xy) &= \log_b x + \log_b y \tag{1} \\
\log_b\left(\frac{x}{y}\right) &= \log_b x - \log_b y \tag{2} \\
\log_b\left(x ^y \right) &= y \log_b x \tag{3}\\
\log_b c &= \frac{1}{\log_c b} \tag{4}\\
\log_b x &= \frac{\log_c x }{\log_c b} \tag{5}\\
\end{align*}
$
# Proofs
## Note about proofs
I am just learning and these proofs are work that I have done to improve my own skills. They may well not be perfect. If you're doing homework or something, use them at your potential peril. In particular, the proofs of $\log_n x \in \mathbf{C} \; \forall x < 0$ and $\log_n x \in \mathbf{R} \; \forall x > 0$ should be taken with a healthy pinch of salt as I don't currently have sufficient depth of knowledge and understanding to undertake these but have done my best effort anyway. I'll probably laugh at these initial attempts when I eventually study real analysis and get good enough to do them properly.
## 1. Proof that $\log_b (xy) = \log_b x + \log_b y$
This proof relies on the [[Exponents#2. Product Rule|product rule]] for exponents, which we have already proven.
$
\begin{align*}
\text{Let:} \\
m &= \log_b x \\
n &= \log_b y \\[8pt]
\text{Then } b^m &= x \\
b^n &= y \\[8pt]
\text{Thus }
xy &= b^m \cdot b^n \\
&= b^{m+n} & \text{...product rule for exponents}\\
\log_b (xy) &= \log_b\left(b^{m+n}\right)\\
&= m+n. \\[8pt]
\text{But } m + n &= \log_b x + \log_b y \\[8pt]
\text{Therefore } \log_b (xy) &= \log_b x + \log_b y \quad \square \tag{1}
\end{align*}
$
## 2. Proof that $\log_b\left(\frac{x}{y}\right) = \log_b x - \log_b y$
This proof relies on the [[Exponents#4. Quotient Rule|quotient rule]] for exponents, which we have already proven.
$
\begin{align*}
\text{Let:} \\
m &= \log_b x \\
n &= \log_b y \\[8pt]
\text{Then } b^m &= x \\
b^n &= y \\[8pt]
\text{Thus } \frac{x}{y} &= \frac{b^m}{b^n} \\
&= b^{m-n} & \text{...quotient rule for exponents}\\
\log_b \left( \frac{x}{y} \right) &= \log_b \left(b^{m-n}\right) \\
&= m-n.\\[8pt]
\text{But } m - n &= \log_b x - \log_b y \\[8pt]
\text{Therefore } \log_b\left(\frac{x}{y}\right) &= \log_b x - \log_b y \quad \square \tag{2}
\end{align*}
$
## 3. Proof that $\log_b\left(x ^y \right) = y \log_b x$
This proof relies on the [[Exponents#3. Power Rule|power rule]] for exponents, which we have already proven.
$
\begin{align*}
\text{Let } m &= \log_b x \\[8pt]
\text{Then } b^m &= x \\
\left(b^m\right)^y &= x^y \\
b^{my} &= x^y. & \text{...power rule for exponents}\\[8pt]
\text{So } \log_b\left(x^y \right) &= \log_b\left(b^{my}\right) \\
&= my\\[8pt]
\text{But } m &= \log_b x \\
\text{therefore } \log_b\left(x ^y \right) &= y \log_b x \quad \square \tag{3}
\end{align*}
$
## 4. Proof that $\log_b c = \frac{1}{\log_c b}$
$
\begin{align*}
\text{Let } m &= \log_b c\\[8pt]
\text{Then } b^m &= c \\
\log_c \left(b^m \right) &= \log_c c \\
m \log_c b &= \log_c c &\text{...from (3)}\\
m &= \frac{\log_c c}{\log_c b} \\[8pt]
\text{But } m &= \log_b c\ \text{ and } \log_c c = 1\\
\text{So } \log_b c &= \frac{1}{\log_c b} \quad \square \tag{4}
\end{align*}
$
## 5. Proof that $\log_b x = \frac{\log_c x }{\log_c b}$
$
\begin{align*}
\text{Let } m &= \log_b x\\[8pt]
\text{Then } b^m &= x \\
\log_c\left(b^m\right) &= \log_c x \\
m \log_c b &= \log_c x &\text{...from (3)}\\
\text{So }m &= \frac{\log_c x}{\log_c b} \\[8pt]
\text{Therefore } \log_b x &= \frac{\log_c x}{\log_c b} \quad \square \tag{5} \\
\end{align*}
$
## The logarithm of a positive real number is real
$\log_b x = y \implies y\in \mathbf{R} \text{ if } x \in \mathbf{R} \text{ and } x > 0$
### Proof
#### Sketch of proof
Let $z$ be the representation of $x$ in the complex plane. That is
$
\begin{align*}
z &= r\cos \theta + ri\sin \theta \\
&= r(\cos \theta + i\sin \theta) \\
&= re^{i\theta}\\[8pt]
\ln z &= \ln(re^{i\theta}) \\
&= \ln r + \ln(e^{i\theta}) \\[8pt]
\text{But } \theta &= 0 & \text{...since } x \text{ sits on the positive real axis.}\\
\text{so } e^{i\theta} &= e^0 = 1\\
\ln(e^{i\theta}) &= \ln 1 = 0 \\[8pt]
\text{therefore }\ln z &= \ln r
\end{align*}
$
Since $\ln z$ has no imaginary part, this must also be true of $\ln x$ and therefore $\ln x$ must always be real if $x$ is real and positive. (Note: this feels like pulling myself up by my own bootstraps. $\ln r$ is just the same thing as $\ln x$)
But $\log_b x = \frac{\ln x}{\ln b}$ from (5). Since we have shown that $\ln x$ is real, $\ln b$ must similarly be real, therefore it follows that $\frac{\ln x}{\ln b}$ must also be real. Therefore $\log_b x$ is real if $x>0$ and $b>0$.
*Note*: I'm not quite sure of this proof. Revisit when I understand Euler's formula properly.
I asked GPT-4 and it returned a proof based on [continuity](https://chat.openai.com/share/3be29006-2ffe-42e8-9aec-15534c302bdc).
## The logarithm of a negative real number has no real solution
$\log_b x = y \implies y\in \mathbf{C} \text{ if } x,b \in \mathbf{R}, b > 0 \text{ and } x < 0$
That is, there is no real number $y$ such that $b^y = x$ if $x$ is negative unless $b$ is also negative.
### Intuition
If $b$ is positive, it’s clear that $b^y$ must always be positive for all real values of $y$.
If $y>0$, $b^y$ is positive and grows more positive as $y$ grows.
If $y<0$, $b^y$ is positive but gets closer and closer to 0 as $y$ grows.
If $y=0$, $b^y = 1$.
In all cases, $b^y$ will always be
gt;0$. Therefore $\log_b x$ where $x<0$ does not exist in the real numbers.
### Proof
*TODO*
#### Sketch of possible proof
Consider the complex numbers, and for now only consider natural logarithms (ie base $e$). The coordinates of any number in the complex plane are given by
$\begin{align*}
z &= r\cos \theta + ri\sin \theta \\
&= r(\cos \theta + i\sin \theta) \\
&= re^{i\theta}\\
\end{align*}
$
Where $r$ is the radius from the origin of the complex plane and $\theta$ is the angle with the positive real axis. This is known as [Euler's formula](https://en.wikipedia.org/wiki/Euler%27s_formula). Because they have no imaginary part, for all positive real numbers, $\theta$ is $0$ and all negative real numbers $\theta = \pi$ (in radians).
Having got to the above, to take the logarithm of a negative real number, we can see that
$
\begin{align*}
\ln z &= \ln (re^{i\theta}) \\
&= \ln(r) + \ln(e^{i\theta}) \\
&= \ln(r) + i\theta \\
\end{align*}
$
But if you represent the number in the complex plane, the reals sit on the x-axis. Since we are saying that $x<0$, then $x$ sits on the axis to the left of the origin, and therefore $\theta = \pi$ and since $r$ is the distance from the origin, then $r = |x|$.
From this it follows that $\ln x = ln(|x|) + i\pi$ where $\{x<0, x\in \mathbf{R}\}$. Since $x$ is real and we know (although we haven’t yet properly proved) that $\ln \alpha$ is real wherever $\alpha>0$, we know that $\ln(|x|)$ must be real.
However we have obtained a constant imaginary term ($i\pi$) which is clearly non-zero, and since $\ln(|x|)$ is real we know it can never cancel this term. Therefore it follows that $\ln x$ is always complex if $x<0$.
But $\log_b x = \frac{\ln x}{\ln b}$ from (5). If $\ln x$ is complex and $\ln b$ is real, then $\frac{\ln x}{\ln b}$ must be complex, so we know that $\log_b x$ is complex if $x<0$ and $b>0$.
*Note*: This is not a proper proof because I don’t know enough analysis to really understand Euler’s formula. The steps given here seem a reasonable enough approach though.
## Further references
Some sample exercises and further explanation can be found at [rapidtables](https://www.rapidtables.com/math/algebra/Logarithm.html)