How do I know how many terms of the power series should I develop to evaluate a limit?
Example: Given this limit: $L:=\displaystyle\lim_{x\to0}\left(\frac{\ln(1+x)}x-e^{-x/2}\right)\frac1{\cosh x - 1}$
I would expand the power series for each elementary function just to the first/second power: $$\ln(1+x) = x + o(x)$$ $$e^{-x/2} = 1 - x/2 + o(x)$$ $$\cosh x = 1+ x^2/2 + o(x^2)$$
and then: $\displaystyle L=\lim_{x\to0}\left(\frac{x + o(x)}x-(1-x/2 + o(x))\right)\frac1{1+x^2/2 + o(x^2) - 1}=\lim_{x\to0}\frac x2\frac 1{x^2/2}=\infty$ which of course is wrong.
If instead I did: $$\ln(1+x)=x-x^2/2+x^3/3+o(x^3)$$ $$e^{-x/2}=1-x/2+x^2/8+o(x^2)$$ $$\cosh x = 1 + x^2/2 + o(x^2)$$
I would get $L=5/12$ which is the correct result.
So the question is, how do I know how many terms should I compute to obtain the correct result for a given limit?
It turns out you already gave us the answer: You must expand up to the first non-zero order (order > 0) of each bracketed term in a product. One must take care if there is a sum involved. If you have a sum of infinite sums then you must consider them together. For instance,
$\Sigma_{n=0}^\infty a_nx^n+\Sigma_{m=0}^\infty b_mx^m=\Sigma_{n=0}^\infty(a_n+b_n)x^n$
In the case above, as you noted, we have $\ln(1+x)/x=1-x/2+x^2/3+...$ and $e^{-x/2}=1-x/2+x^2/8+...$.
Thus, $(\ln(1+x)/x-e^{-x/2})=(1/3-1/8)x^2+...$. Therefore the first non-zero order inside this bracketed term is the 2nd order and is the one up to which you must expand.