2
$\begingroup$

$$\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!

$\endgroup$
9
  • $\begingroup$ Can you write down the bounds of your intervals? You may discover errors doing so. $\endgroup$ – mathcounterexamples.net Apr 28 at 6:40
  • $\begingroup$ @mathcounterexamples.net Are they not $x \in (0,|k|)$? $\endgroup$ – FShrike Apr 28 at 7:02
  • $\begingroup$ May I ask you to write the bounds yourself and compute properly the integral... rather than answering my question with another question? You'll discover your error by yourself then! $\endgroup$ – mathcounterexamples.net Apr 28 at 7:55
  • $\begingroup$ @mathcounterexamples.net after some empirical observations on Desmos I have deduced that my infinite sum is exactly equal not to $\ln\left|k+x\right|$ but instead to $\ln\left|\frac{k+x}{k}\right|$! $\endgroup$ – FShrike Apr 28 at 21:04
  • $\begingroup$ I believe that this is due to the algebraic rearrangement of $\frac{1}{k+x}$ to $\frac{1/k}{1+x/k}$ by multiplying both numerator and denominator by $\frac{1}{k}$, since $\frac{1}{k}$ is the difference between the failed approximation and the accurate one! However, a slight niggling doubt remains, since the two multiplications cancel, so the algebraic effect is nil - no? $\endgroup$ – FShrike Apr 28 at 21:11
2
$\begingroup$

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).$$

$\endgroup$
8
  • $\begingroup$ Beat me to it. Excellent answer +1 $\endgroup$ – Alann Rosas Apr 27 at 19:15
  • $\begingroup$ The first response makes total sense and yes, I now realise that the series could never approximate the asymptote at $x=-1$. With regards to the second response, I do not understand the derivation there; shouldn't the second term be $\ln\left(1+\frac{x}{a}\right)$? Plus, my geometric series attempt for $\ln\left|k+x\right|$ was clearly wrong - but why? Do I just need a ridiculous number of terms to make it work, but if so, then why does the alternating bound fail even for positive $k, x$? $\endgroup$ – FShrike Apr 27 at 19:45
  • 1
    $\begingroup$ Thanks for spotting the typo. And yes, the approximation is very poor especially when $x$ is close to $k$ and even worse when close to $-k$. $\endgroup$ – mathcounterexamples.net Apr 27 at 19:53
  • $\begingroup$ @mathcounterexamples.net - poor due to an error in my workings, an error in my estimation of the error bound (because the alternating bound for my expansion actually goes to $\frac{1}{n}$ as $x\to k$) or some other reason? $\endgroup$ – FShrike Apr 27 at 20:00
  • $\begingroup$ I mean to say: my bound predicts a very good accuracy for high $n$, so why is the accuracy atrocious? $\endgroup$ – FShrike Apr 27 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.