# Taylor expansion and error?

This came up in a part of the proof.

$-\log(1-x)$ is $x$ and then want to calculate the error of this.

The idea is that taylor series of $-\log(1-x)=x+\dfrac{x^2}{2}+\dfrac{x^3}{3}+...$ We have $|x|<1$.I know how to calculate Taylor expansion, however can't see the justification from saying it is x. Next it says what is the error of this.

Well, it has

$x\leq \int_{1-x}^{1} \dfrac{dt}{t} \leq \dfrac{1}{1-x} x$

However, can't understand how this is true.

This is due to trying to prove that $0 \leq \sum_{p\leq N} ((-log(1- \dfrac{1}{p})-\dfrac{1}{p}) \leq \sum_{p \leq N} \dfrac{1}{p(p-1)}$

• Please dpn't start the question in the title. Keep the body of the question self-contained. – Asaf Karagila Feb 4 '12 at 0:48
• @AsafKaragila okay I edited it. – simplicity Feb 4 '12 at 0:53

Notice that the interval of integration in $\displaystyle\int_{1-x}^{1}\frac{\mathrm{d}t}{t}$ is $[1-x,1]$ which has a length of $x$. Note also that the integrand is between $\dfrac{1}{1-x}$ and $1$. Thus, the integral is going to be between the length of the interval times the minimum and maximum of the integrand. That is, $$x\le\int_{1-x}^{1}\frac{\mathrm{d}t}{t}\le\frac{x}{1-x}$$ You could also use the Mean Value Theorem, noting that $$\frac{\log(1)-\log(1-x)}{x}=\frac{1}{\xi}$$ for some $\xi$ between $1$ and $1-x$, again giving $$x\le-\log(1-x)\le\frac{x}{1-x}$$

It is not exactly equal to $x$ except when $x=0$. What was likely meant is that if $|x|$ is not far from $0$, then $-\log(1-x)$ is approximately equal to $x$.

One formal way of putting it is that $$\lim_{x\to 0} \frac{-\log(1-x)}{x}=1.$$

Take for example $x=0.1$. The calculator gives that $-\log(0.9)\approx 0.1053605$, so for $x=0.1$, $-\ln(1-x)$ is indeed fairly close to $x$. The second term of the Taylor Series tells you roughly how big the error is when you approximate $-\log(1-x)$ by $x$. Note that if $x=0.1$, then $x^2/2=0.005$. The actual error is approximately $0.0053605$.

Sometimes, in modelling physical situations, when we know that $|x|$ is close to $0$, we replace $-\ln(1-x)$ by $x$. That does not mean that the two are strictly equal, only that for our purposes the approximation is good enough.

The equation of the tangent line to $y=-\log(1-x)$ at $x=0$ turns out to be $y=x$. Recall that the tangent line to $y=f(x)$ at $x=a$ kisses the curve $y=f(x)$ at $x=a$. So if $x$ is near $0$, then $-\log(1-x)$ is very close to $x$. We call $x$ the linear approximation to $y=-\log(1-x)$ near $x=0$. Similarly, $x+\frac{x^2}{2}$ is the quadratic approximation.

Added: Your edit shows some uncertainty about the inequalities $$x\leq \int_{1-x}^{1} \frac{dt}{t} \leq \dfrac{1}{1-x} x.$$ That uncertainty is reasonable, particularly for negative $x$. For geometric clarity we should treat the cases $x>0 and$x<0 separately.

First assume that $x$ is positive.

On our interval from $1-x$ to $1$, the function $\dfrac{1}{t}$ is always $\ge 1$. So the integral (area) is bigger than or equal to $1$ times the length of the interval, which is $x$. That proves the inequality on the left. (It is good to draw a picture.)

Similarly, on our interval, $\dfrac{1}{t}$ is always less than or equal to $\dfrac{1}{1-x}$. So the integral is less than or equal to $\dfrac{1}{1-x}$ times the length of the interval. That yields the inequality on the right.

Next assume that $x$ is negative. It is all too easy to make mistakes with negative numbers, so we temporarily let $w=-x$. Then $w$ is positive.

We are looking at the integral from $1-x$ to $1$, so from $1+w$ to $1$. This is is going the wrong way. But $$\int_{1+w}^1 \frac{dt}{t}=-\int_1^{1+w}\frac{dt}{t}.$$ By an argument close to the one given above for the case $x>0$, we find that $$\frac{w}{1+w}\le \int_1^{1+w}\frac{dt}{t}\le w.$$ "Multiply" the inequality by $-1$. That reverses the inequality, and we obtain $$-w\le \int_1^{1+w}-\frac{dt}{t}\le -\frac{w}{1+w}.$$ Finally, replace $w$ by $-x$, and interchange the bounds on the integral. We get $$x\leq \int_{1-x}^{1} \frac{dt}{t} \leq \frac{x}{1-x}.$$

The inequality you give is an elementary property of the natural logarithm

$$1 - \frac{1}{x} \leqslant \log x \leqslant x - 1$$

The equality holds for $x=1$. This changing $x$ to $1-x$ gives

$$1 + \frac{1}{{x - 1}} \leqslant \log \left( {1 - x} \right) \leqslant - x$$

And multiplying by $-1$ gives

$$\frac{x}{{1 - x}} \geqslant - \log \left( {1 - x} \right) \geqslant x$$

which is the desired result.

Here you have an image. The blue plot is the logarithm.

You can find a proof of this first inequality in Edmund Landau's book Integral and Differential Calculus.