Calculus Limit Queston This question was on my mastery exam today and I guessed on it.
$$\lim_{x\to0} \frac{k+\cos(mx)}{x^2} = -2$$
What is $k + m^2$?
I got $m^2 = 4$, but how do I find the value of $k$?
 A: Taylor expand $\cos(mx) = 1 - \frac{1}{2}m^2x^2 + O(x^4)$. Then,
$$
\frac{k+\cos(mx)}{x^2} = \frac{k+1}{x^2}-\frac{1}{2}m^2 + O(x^2)
$$
So, if the limit is $-2$, what must $k$ be?
A: Hint: You probably figured out that $m^2=4$ from L'Hopital's Rule, right? Well, L'Hopital's Rule can only be applied when the fraction is in an "indeterminate form." In this case, since the denominator is going to zero as $x\rightarrow 0$, then the numerator must also be zero.
Therefore, solve for $k$ in
$$
\lim_{x\rightarrow 0} (k+\cos(mx))=0
$$
A: As $x\rightarrow 0$, numerator goes to $k+1$ and denumerator goes to $0$. In order the limit to be exist $k+1$ must be zero, so $k=-1$. 
A: First we note that $m \neq 0$ otherwise the limit will not be $-2$. If $k = m = 0$ then limit is zero and if $m = 0, k \neq 0$ then limit does not exist (it is $\infty$ or $-\infty$).
Since $$\lim_{x \to 0}\frac{k + \cos mx}{x^{2}} = -2$$ it follows that $$\lim_{x \to 0}\{k + \cos mx\} = \lim_{x \to 0}x^{2}\cdot\frac{k + \cos mx}{x^{2}} = 0\cdot (-2) = 0$$ and this means that $k + 1 = 0$ so that $k = -1$
Next
$\displaystyle \begin{aligned}\lim_{x \to 0} \frac{k + \cos mx}{x^{2}} &= \lim_{x \to 0} \frac{-1 + \cos mx}{x^{2}}\\
&= \lim_{x \to 0} \frac{-2\sin^{2}(mx/2)}{x^{2}}\\
&= -2\lim_{x \to 0} \frac{\sin^{2}(mx/2)}{(mx/2)^{2}}\frac{(mx/2)^{2}}{x^{2}}\\
&= -\frac{m^{2}}{2}\end{aligned}$
and hence $m^{2} = 4$ so that $k + m^{2} = 3$. Note that although a trivial matter it is necessary to consider the case of $m = 0$ and dispose it off.
