# Two similar method to calculate one equation get different answer

Method1:$$\lim_{x\rightarrow0}({\frac{e^x+xe^x}{e^x-1}}-\frac1x)=\lim_{x\rightarrow0}({\frac{e^x+xe^x}{x}}-\frac1x)=\lim_{x\rightarrow0}(\frac{e^x+xe^x-1}{x})=\lim_{x\rightarrow0}(2e^x+xe^x)=2$$ Method2:$$\lim_{x\rightarrow0}({\frac{e^x+xe^x}{e^x-1}}-\frac1x)=\lim_{x\rightarrow0}{\frac{xe^x(1+x)+1-e^x}{x(e^x-1)}}=\lim_{x\rightarrow0}{\frac{xe^x(1+x)+1-e^x}{x^2}}=\lim_{x\rightarrow0}{\frac{3xe^x+x^2e^x}{2x}}=\lim_{x\rightarrow0}{\frac{3e^x+xe^x}{2}}=\frac32$$ I know there are something wrong when I use Taylor series but I don't know exactly. And is there any method to use Taylor Series correctly when I calculate a infinite related equation? Any hints or answers are going to be appreciated.

In method $1$, you wrote

$$\lim_{x\to 0}({\frac{e^x+xe^x}{e^x-1}}-\frac1x)=\lim_{x\to 0}({\frac{e^x+xe^x}{x}}-\frac1x)$$

This is incorrect. The correct way forward is

\begin{align} \lim_{x\to 0}({\frac{e^x+xe^x}{e^x-1}}-\frac1x)&=\lim_{x\to 0}\left({\frac{e^x+xe^x}{x(1+\frac12x+O(x^2))}}-\frac1x\right)\\\\ &=\lim_{x\to 0}\frac{e^x+xe^x-(1-\frac12 x+O(x^2))}{x(1+\frac12 x+O(x^2))}\\\\ &=\lim_{x\to 0}\left(2e^x+xe^x-\frac12+O(x)\right)\\\\ &=\frac32 \end{align}

• Thank you Dr.MV. And how to choose the correct power when I expand a function to a Taylor Series?(Or how to estimate the error?) Aug 5, 2015 at 5:20
• @user229922 You're very welcome. It was my pleasure to help! When expanding, you need to keep the requisite number of terms in the expansion. And it's actually a good idea to write, for just an example, $e^x=1+x +\frac12 x^2+O(x^3)$. This is a precise expression and if we need the higher order terms later in a particular development, we can see that need at that stage in the development. Aug 5, 2015 at 5:44
• It is better to replace $e^{x} - 1$ by $x + (x^{2}/2) + O(x^{3})$ or by $x + (x^{2}/2) + o(x^{2})$ because these expressions are equal to each other, but the way you have written in answer, its kind of creepy. There is no way to replace $e^{x} - 1$ with $x + (x^{2}/2)$ because these are not equal. In mathematics it is better to be precise rather than using something crude when a precise option is available. Aug 5, 2015 at 7:51
• @paramanamdsingh5 Did you not read my attached comment? I suggest you do so. That said, the equality as written is correct under the limit sign. Carrying extra terms is superfluous in the limit. The preciseness of carrying terms was addressed in my comment. What value does rewriting that sentiment have? Aug 5, 2015 at 13:41
• When you are calculating limit step by step there has to be a precise rule/theorem which allows you to go from one step to another. Here there is no theorem which allows you to replace $e^{x} - 1$ by $x + x^{2}/2$. The way you have done the replacement is equivalent to implicit use of the following result $$\lim_{x \to 0}\frac{e^{x} + xe^{x}}{e^{x} - 1} - \dfrac{e^{x} + xe^{x}}{x(1 + x/2)} = 0$$ It would be better if you use the error term $O(x^{3})$ and show that after some algebra you get $\frac{3}{2} + O(x)$ and the error term vanishes as $x \to 0$. Aug 6, 2015 at 11:28

Method 2 is correct, but Method 1 is wrong. What you have done is noted that when $x \approx 0$, $e^x \approx 1+x$ and then that $$\frac{e^x + xe^x}{e^x-1} \approx \frac{e^x + xe^x}{x}$$ which is correct. But it does not follow that $$\frac{e^x + xe^x}{e^x-1} - \frac{1}{x} \approx \frac{e^x + xe^x}{x} - \frac{1}{x}$$ for the same reason that you can't use $$\lim_{x\rightarrow 0}(f(x) + g(x)) = \lim_{x\rightarrow 0}f(x) + \lim_{x\rightarrow 0}g(x)$$ when one or both limits do not exist.

Essentially, you have made a correct calculation but then, as it were, subtracted something that doesn't exist from both sides.

• Although the method 1 is wrong, the explanation you give for its "incorrectness" is itself incorrect. The situation remains same when you replace $e^{x} - 1$ with $x + x^{2}/2$ and it gives right answer (see answer by Dr MV) whereas according to your explanation it should not work. The correct explanation for "incorrectness" of method 1 is given in my answer. Aug 5, 2015 at 8:19
• @ParamanandSingh The explanation given by Flounderer looks reasonable to me. He said that I can't do it like method 1 because I can't use $$\lim_{x\rightarrow 0}(f(x) + g(x)) = \lim_{x\rightarrow 0}f(x) + \lim_{x\rightarrow 0}g(x)$$ when one or both limits do not exist. Aug 5, 2015 at 10:08
• @user229922: The theorem about $f(x) + g(x)$ can not be used when one or both of the limits does not exist. This is correct. But this fact is not the reason for failure of method 1. If you see Dr. MV answer he uses the same technique to replace $e^{x} - 1$ with $x + x^{2}/2$ instead of $x$ and works out the limit. Thus $$\frac{e^x + xe^x}{e^x-1} \approx \frac{e^x + xe^x}{x + (x^{2}/2)}$$ and also $$\frac{e^x + xe^x}{e^x-1} - \frac{1}{x} \approx \frac{e^x + xe^x}{x + (x^{2}/2)} - \frac{1}{x}$$ and the last expression has limit $3/2$. Aug 5, 2015 at 11:04

I wonder how one manages to go from $$\lim_{x \to 0}\left(\frac{e^{x} + xe^{x}}{e^{x} - 1} - \frac{1}{x}\right)$$ to $$\lim_{x \to 0}\left(\frac{e^{x} + xe^{x}}{x} - \frac{1}{x}\right)$$ There is no theorem in calculus which justifies this. It is like writing $1 + 2 = 1 + 3 = 4$.

The second approach works and is justified as follows \begin{align} \lim_{x \to 0}\frac{xe^{x}(1 + x) + 1 - e^{x}}{x(e^{x} - 1)} &= \lim_{x \to 0}\frac{xe^{x}(1 + x) + 1 - e^{x}}{x^{2}}\cdot\frac{x}{e^{x} - 1}\notag\\ &= \lim_{x \to 0}\frac{xe^{x}(1 + x) + 1 - e^{x}}{x^{2}}\cdot 1\notag\\ &= \lim_{x \to 0}\frac{xe^{x}(1 + x) + 1 - e^{x}}{x^{2}}\notag \end{align} It is better to write all the steps above so that there is no mystery involved.

While calculating limits one is allowed to use any transformation to replace one expression by another if these two are equal (this is obvious, you can replace $a$ by $b$ if $a = b$). Apart from this obvious replacement one can make use of rules of limits or any standard theorems in calculus. No other transformations are allowed. They may sometimes generate correct answer but with no guarantee and it will only add to confusion and mystery.

Thus you can't replace $e^{x} - 1$ by $x$ because these are not equal (unless $x = 0$). In the second approach it looks like $e^{x} - 1$ is replaced by $x$ but in reality it is a typical use of limit theorems (the way I have shown above) which finally looks like a replacement.

Similarly the other answer by Dr. MV is wrong because it replaces (answer by Dr. MV is now edited to fix the problem mentioned, hence the strikethrough) it is wrong to replace $e^{x} - 1$ by $1 + x + (x^{2}/2)$. These are not equal and hence it is incorrect. This procedure gives correct answer by good luck. It is better to replace $e^{x} - 1$ by $x + (x^{2}/2) + O(x^{3})$ or by $x + (x^{2}/2) + o(x^{2})$ because these are all equal. You can also replace $e^{x} - 1$ by $x + O(x^{2})$ or $x + o(x)$ because these are also equal, but these will not help you to get the answer because it won't be possible to get rid of $o$ and $O$ symbols.