Does anyone know a closed form expression for the Taylor series of the function $f(x) = \log(x)$ where $\log(x)$ denotes the natural logarithm function?
-
1http://www.wolframalpha.com/input/?i=taylor+log%28x%29 – Amzoti Nov 29 '13 at 00:40
-
1It is easy to find a closed-form expression for $f^{(n)}(a)$ for any $a>0$ you wish, then let $c_n = f^{(n)}(a)/n!$, and $f(x)=\sum_{n=0}^\infty c_n (x-a)^n$ for $|x-a|<a$. – Stefan Smith Nov 29 '13 at 00:46
-
the Taylor series for ln(x) is relatively simple : 1/x , -1/x^2, 1/x^3, -1/x^4, and so on iirc. log(x) = ln(x)/ln(10) via the change-of-base rule, thus the Taylor series for log(x) is just the Taylor series for ln(x) divided by ln(10). – correcthorsebatterystaple Mar 18 '24 at 14:35
4 Answers
Abromowitz & Stegun gives a number of forms.
Among these, the bilinear expansion is known for its used in digital filter theory:
$$\log(z) = 2\left[\left({z-1\over z+1}\right)+ {1\over3} \left({z-1\over z+1}\right)^3 + {1\over5} \left({z-1\over z+1}\right)^5+ \cdots\right],$$
for $\Re z > 0.$
- 23,601
- 7
- 53
- 88
- 351
The Taylor series centered at $1$ can be easily derived with the geometric series
$$\sum_{n=0}^\infty x^n=\frac{1}{1-x}$$
We start with the derivative of $\ln(x)$, which is given by $1/x$ for every $x>0$. This can be rewritten as
$$\frac{1}{1-[-(x-1)]}$$
so if $|-(x-1)|<1$, i.e. $|x-1|<1$, this can be expanded as a geometric series:
\begin{align} \frac{1}{1-[-(x-1)]} &= \sum_{n=0}^\infty [-(x-1)]^n\\ &=\sum_{n=0}^\infty (-1)^n(x-1)^n \end{align}
It follows that $(\ln)'(t)=\sum_{n=0}^\infty (-1)^n(t-1)^n$ holds whenever $|t-1|<1$. We can then get a series expression for $\ln(x)$ by integrating this identity from $1$ to $x$:
\begin{align} \ln(x)-\ln(1) &= \sum_{n=0}^\infty (-1)^n\frac{\left(x-1\right)^{n+1}}{n+1}-\sum_{n=0}^\infty (-1)^n\frac{(1-1)^{n+1}}{n+1}\\ &= \sum_{n=1}^\infty (-1)^{n-1}\frac{\left(x-1\right)^n}{n}-\sum_{n=1}^\infty (-1)^{n-1}\frac{0^{n}}{n}\\ &= \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}\left(x-1\right)^n\\ &= \left(x-1\right)-\frac{\left(x-1\right)^2}{2}+\frac{\left(x-1\right)^3}{3}-\frac{\left(x-1\right)^4}{4}+\cdots \end{align}
What if we want a Taylor series centered at a point other than $1$, say at $a>0$? You can always do this directly by computing the derivatives of $\ln(x)$ at $a$, but an easier method is to leverage the series we just derived and the identity
$$\ln\left(\frac{x}{y}\right)=\ln(x)-\ln(y)$$
To see this, evaluate $\ln$ at $x/a$, where $x$ is any positive real number. If $|x-a|<a$, we will have that $|x/a-1|<1$, so the Taylor series centered at $1$ will converge to $\ln(x/a)$. We can then write
\begin{align} \ln\left(\frac{x}{a}\right) &= \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}\left(\frac{x}{a}-1\right)^n\\ &= \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}\left(\frac{x-a}{a}\right)^n\\ &= \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}\frac{(x-a)^n}{a^n}\\&= \sum_{n=1}^\infty \frac{(-1)^{n-1}}{na^n}(x-a)^n\\ \end{align}
From $\ln(x/a)=\ln(x)-\ln(a)$, we immediately get
\begin{align} \ln(x) &= \ln(a)+\sum_{n=1}^\infty \frac{(-1)^{n-1}}{na^n}(x-a)^n\\ &= \ln(a)+\frac{1}{a}(x-a)-\frac{1}{2a^2}(x-a)^2+\frac{1}{3a^3}(x-a)^3-\frac{1}{4a^4}(x-a)^4+\cdots \end{align}
- 6,553
$$-\log(1-x) = x + \frac{x^2}{2} + \frac{x^3}{3} + \dots \qquad (|x|<1)$$
There is no expansion around $x=1$ because the log is singular at $0$.
- 507
- 55,975
-
4
-
1@Kurtoid No because when you plug in $1-x$ into the alternating sign expansions, for odd exponents a negative sign is introduced, for evens nothing changes, so $\log(1-x)$ is simply just $-x - \frac{x^2}2 - \frac{x^3}3 - \dots$ – crxyz Nov 28 '24 at 17:44
-
I found this expansion particularly useful in expansion of cumulant generating function of the negative binomial distribution here https://stats.stackexchange.com/a/661355/340862 – Mewbacca Feb 14 '25 at 01:52
For $x \in \mathbb{R}$ satisfying $0 < x < 2$,
$$f(x) = \ln(x) = \left(x-1\right)-\frac{1}{2}\left(x-1\right)^2 + \frac{1}{3} \left(x-1\right)^3-\frac{1}{4} \left(x-1\right)^4 + \cdots$$ $$ f(x) = \displaystyle\sum\limits_{n=1}^{\infty} \left[\frac{\left(-1\right)^{n+1}}{n}\left(x-1\right) ^n\right] $$
- 18,311