How to bound the error of an approximation for ln|k+x|?

121 Views Asked by At

$$\forall x\in\left(-1,1\right):\space\ln\left|1+x\right|=\int\frac{1}{1+x}\space dx=\int\sum_{n=0}^{\infty}\left(-x\right)^n\space dx=x-\frac{x^2}{2}+\frac{x^3}{3}\dots=\sum_{n=1}^{\infty}\left(-1\right)^{n-1}\cdot\frac{x^n}{n}$$

This is well known. I have two questions here. Firstly, I noticed that this is a convergent alternating series, and so the error of an approximation of degree $n$ is dominated by term $n+1$: $\xi_n(x)=\left|\frac{x^{n+1}}{n+1}\right|$ (I think!). However, when plotting this on Desmos, with $x\in\left(-1,1\right)$ of course, I noticed that the error predicted by this remainder function was not always an upper bound of the actual difference between the polynomial and the natural logarithm; the real error was greater than my "upper bound" sometimes, especially for low-degree approximations - the approximation at degree $1$ is visibly terrible, since it's a straight line, and the error is far greater than $\left|\frac{x^2}{2}\right|$ for $x$ near $-1$.

Secondly, I wondered if this was a useful approximation technique for $\ln\left|k+x\right|,\space\forall k>0$ - or maybe even $\forall k\in\mathbb{R}$? I'm not sure. Anyway, I attempted this in much the same way: $$\forall x\in\left(-\left|k\right|,\left|k\right|\right):\space\ln\left|k+x\right|=\int\frac{1}{k+x}\space dx=\int\frac{\frac{1}{k}}{1+\frac{x}{k}}\space dx=\int\sum_{n=0}^{\infty}\frac{1}{k}\cdot\left(-\frac{x}{k}\right)^n\space dx$$ $$\int\frac{1}{k}-\frac{x}{k^2}+\frac{x^2}{k^3}\dots\space dx=\frac{x}{k}-\frac{x^2}{2k^2}+\frac{x^3}{3k^3}\dots=\sum_{n=1}^{\infty}\left(-1\right)^{n-1}\cdot\frac{x^n}{n\cdot k^n}$$

The interval of convergence is $\left(-\left|k\right|,\left|k\right|\right)$ since $\left|-\frac{x}{k}\right|<1$, I think. Likewise, an error bound on this approximation fails miserably... and after plotting this on Desmos, I note that my approximation is terrible! It doesn't work at all :)

EDIT: This is despite my thought that $$\forall x,k>0,x<k:\lim_{n\to\infty}\xi_{n,k}(x)\space\left|\frac{x^{n+1}}{\left(n+1\right)k^{n+1}}\right|=0$$

Many thanks if anyone can clear up how to properly bound this!

1

There are 1 best solutions below

8
On BEST ANSWER

First question

For $g(x)=x \in (-1,0)$, $$\sum_{n=1}^{\infty}\left(-1\right)^{n-1}\cdot\frac{x^n}{n}$$ is not an alternating series! $x^n$ itself has alternating signs and $g(x)$ tends to approach the harmonic series as $x \to 1$ which is diverging. This is coherent with what you found in Desmos.

Second question

If your goal is to evaluate $\ln(k+x)$, I would better use $\ln \frac{1}{x} = - \ln x$ to only deal with $x \gt 1$ and then $$\ln(a+x) = \ln a + \ln \left(1 + \frac{x}{a}\right).$$