# Compute $\lim_{x \to 0} \frac{\sin(x)+\cos(x)-e^x}{\log(1+x^2)}$.

Question:

Compute $\lim_{x \to 0} \frac{\sin(x)+\cos(x)-e^x}{\log(1+x^2)}$.

Attempt: Using L'Hopital's Rule, I have come to $$\lim_{x \to 0} \frac{\cos(x)}{2x} - \lim_{x \to 0} \frac{\sin(x)}{2x} - \lim_{x \to 0} \frac{e^x}{2x}.$$ My thought was to use the power series representations of these functions. However, that' doesn't seem to get me anywhere. Am I on the wrong track using L'Hopital's?

• try using L'Hopital's rule again. – PhzksStdnt Nov 27 '14 at 20:39

Tricky computation: \begin{eqnarray*} \frac{\sin (x)+\cos (x)-e^{x}}{\log (1+x^{2})} &=&\frac{(\sin (x)-x)+(\cos (x)-1)-(e^{x}-1-x)}{\log (1+x^{2})} \\ &=&\frac{\frac{(\sin (x)-x)}{x^{2}}+\frac{(\cos (x)-1)}{x^{2}}-\frac{% (e^{x}-1-x)}{x^{2}}}{\frac{\log (1+x^{2})}{x^{2}}}. \end{eqnarray*} Now we use l'Hospital's rule to compute each of the four limits separatly

$\lim_{x\rightarrow 0}\frac{(\sin (x)-x)}{x^{2}}\overset{L^{\prime }HR}{=}% \lim_{x\rightarrow 0}\frac{(\cos (x)-1)}{2x}\overset{L^{\prime }HR}{=}% \lim_{x\rightarrow 0}\frac{-\sin (x)}{2}=\frac{-\sin (0)}{2}=0.$

$\lim_{x\rightarrow 0}\frac{(\cos (x)-1)}{x^{2}}\overset{L^{\prime }HR}{=}% \lim_{x\rightarrow 0}\frac{-\sin (x)}{2x}\overset{L^{\prime }HR}{=}% \lim_{x\rightarrow 0}\frac{-\cos (x)}{2}=\frac{-\cos (0)}{2}=-\frac{1}{2}$

$\lim_{x\rightarrow 0}\frac{(e^{x}-1-x)}{x^{2}}\overset{L^{\prime }HR}{=}% \lim_{x\rightarrow 0}\frac{e^{x}-1}{2x}\overset{L^{\prime }HR}{=}% \lim_{x\rightarrow 0}\frac{e^{x}}{2}=\frac{e^{0}}{2}=\frac{1}{2}$

$\lim_{x\rightarrow 0}\frac{\log (1+x^{2})}{x^{2}}\underset{x^{2}=y}{=}% \lim_{y\rightarrow 0^{+}}\frac{\log (1+y)}{y}\overset{L^{\prime }HR}{=}% \lim_{y\rightarrow 0^{+}}\frac{1/(1+y)}{1}=1.$

Therefore \begin{eqnarray*} \lim_{x\rightarrow 0}\frac{\sin (x)+\cos (x)-e^{x}}{\log (1+x^{2})} &=&\frac{% \lim_{x\rightarrow 0}\frac{(\sin (x)-x)}{x^{2}}+\lim_{x\rightarrow 0}\frac{% (\cos (x)-1)}{x^{2}}-\lim_{x\rightarrow 0}\frac{(e^{x}-1-x)}{x^{2}}}{% \lim_{x\rightarrow 0}\frac{\log (1+x^{2})}{x^{2}}} \\ &=&\frac{0+(-\frac{1}{2})-(\frac{1}{2})}{1}=-1. \end{eqnarray*}

• Tricky, indeed! This is a more explicit way of doing it than others have suggested, but the exposition is much appreciated. – mathjacks Nov 27 '14 at 21:16
• you are welcome! – Idris Addou Nov 27 '14 at 21:20

Recall that, for $x$ near $0$, you have \begin{align} &e^x =1+x+\dfrac{x^2}{2}+\mathcal{O}(x^3)\\ &\cos x = 1-\dfrac{x^2}{2}+\mathcal{O}(x^3)\\ & \sin x = x+\mathcal{O}(x^3)\\ \end{align} giving $$\cos x+\sin x-e^x =- x^2+\mathcal{O}(x^3)$$ Since \begin{align} &\ln (1+ x^2) = x^2+\mathcal{o}(x^3) \end{align} then $$\lim_{x \to 0} \frac{\sin(x)+\cos(x)-e^x}{\log(1+x^2)}=\lim_{x \to 0} \frac{-x^2}{x^2}=-1.$$

• I'm not familiar with the Big-O and little-o notation in how you're using it, though I appreciate that your answer is different from the others. Can you explain the notation so I can understand better? – mathjacks Nov 27 '14 at 21:12
• @flapjackery Please, have a look at this:math.columbia.edu/~nironi/taylor2.pdf Thank you. – Olivier Oloa Nov 27 '14 at 21:37
• Maybe in a near futur you will study a chapter in the infinite series course entitled ''Taylor expansion'' or Taylor series'' at that time it will be very clear what Olivia did. But if I have to give a short explanation, i tell you that in that course we learn how to find the nearest polynomiale to most functions, If it exists (of course). For example, the polynomial of degree 2 which is the much close to the function $e^x$ is $1+x+(x^2)/2$ and so on for the other functions, next we replace each function by the appropriate polynomial, the computation will simplifies and the limit is obtained. – Idris Addou Nov 27 '14 at 21:41

we get by the rule of L'Hospital $$\lim_{x \to 0}\frac{\cos(x)-\sin(x)-e^x}{\frac{2x}{1+x^2}}$$ $$\lim_{ x\to 0}\frac{(1+x^2)(\cos(x)-\sin(x)-e^x}{2x}$$ $$\lim_{x \to 0}\frac{2(\cos(x)-\sin(x)-e^x)+2x(-\sin(x)-\cos(x)-e^x)}{2}=0$$

• Thanks for your helpful answer. I think you may have made an error in the last step though, as I believe the limit equals -1, not 0. – mathjacks Nov 27 '14 at 21:13
• One can also remove the $(1+x^2)$ factor from the numerator, because its limit is $1$. So the limit with the factor exists if and only if the limit without it exists and they're equal. However, the derivative of the numerator is completely wrong. – egreg Nov 27 '14 at 21:30

Here's how I would remake the question: $$lim \left( {cos x \over 2x}-{e^x \over2x} \right)- lim {sinx \over 2x}$$ Use L'hopital's rule for the first and you should get negative infinity. The value of the second is equal to 1/2, so the limit is negative infinity.

• I think you may have misread the question. The limit should be $-1$. Though your suggestion in the comments was helpful, I did need to apply l'hopital's again. – mathjacks Nov 27 '14 at 21:11

You made a mistake when you looked for derivative. When you apply L'Hopital's Rule you should get $$\lim_{x \to 0} \frac{\cos(x)-\sin(x)-e^x}{\frac{2x}{1+x^2}}$$ witch becomes $$\lim_{x \to 0} \frac{(x^2+1)(\cos(x)-\sin(x)-e^x)}{2x}$$ and when you apply L'Hopital's Rule again you should get $$\lim_{x \to 0} \frac{2x(\cos(x)-\sin(x)-e^x)+(1+x^2)(-\sin(x)-\cos(x)-e^x)}{2}=-1$$ Sorry for that mistake.

• You are using the product rule in the numerator to get to the last step, right? I think you might be missing a factor of $(1+x^2)$? – mathjacks Nov 27 '14 at 21:14
• You're right! What I computed works for -cos x, not +. Sorry about that. – PhzksStdnt Nov 27 '14 at 21:40

Computation with l'Hospital's rule no trickly: \begin{eqnarray*} &&\lim_{x\rightarrow 0}\frac{\sin (x)+\cos (x)-e^{x}}{\log (1+x^{2})}\left. \overset{L^{\prime }HR}{=}\right. \lim_{x\rightarrow 0}\frac{\cos (x)-\sin (x)-e^{x}}{\frac{2x}{1+x^{2}}} \\ &&\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left. =\right. \lim_{x\rightarrow 0}\left( 1+x^{2}\right) \lim_{x\rightarrow 0}\left( \frac{\cos (x)-\sin (x)-e^{x}}{2x}\right) \end{eqnarray*} The first limit equals $+1.$ To compute the second limit we continue using l'Hospital's rule: $$\overset{L^{\prime }HR}{=}\lim_{x\rightarrow 0}\left( \frac{-\sin (x)-\cos (x)-e^{x}}{2}\right) =\frac{-0-1-1}{2}=-1.$$ Thereore $$\lim_{x\rightarrow 0}\frac{\sin (x)+\cos (x)-e^{x}}{\log (1+x^{2})}=1\times (-1)=-1.$$

Remark: If we have keeped the factor $1+x^{2}$ with the second one, the computation would be much more complicated; indeed, this factor has a contribution in complicating the computation. So putting it a side, it do note creat trouble!

If we have to keep it look the computation looks like this \begin{eqnarray*} &&\lim_{x\rightarrow 0}\frac{\sin (x)+\cos (x)-e^{x}}{\log (1+x^{2})}\left. \overset{L^{\prime }HR}{=}\right. \lim_{x\rightarrow 0}\frac{\cos (x)-\sin (x)-e^{x}}{\frac{2x}{1+x^{2}}} \\ &&\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \left. =\right. \lim_{x\rightarrow 0}\frac{\left( 1+x^{2}\right) \left( \cos (x)-\sin (x)-e^{x}\right) }{2x} \\ &&\ \ \ \ \ \ \ \ \ \ \ \left. =\right. \lim_{x\rightarrow 0}\frac{\cos x-\sin x-e^{x}+x^{2}\cos x-x^{2}\sin x-x^{2}e^{x}}{2x} \\ &&\ \ \ \ \ \ \ \ \ \ \ \left. =\right. \lim_{x\rightarrow 0}\frac{-\sin x-\cos x-e^{x}-e^{x}x^{2}-x^{2}\sin x-x^{2}\cos x-2e^{x}x-2x\sin x+2x\cos x}{% 2} \\ &&\ \ \ \ \ \ \ \ \ \ \ \left. =\right. \frac{-0-1-1-0-0-0-0-0+0}{2} \\ &&\ \ \ \ \ \ \ \ \ \ \ \left. =\right. \frac{-2}{2} \\ &&\ \ \ \ \ \ \ \ \ \ \ \left. =\right. -1. \end{eqnarray*}