Calculating the Limit $\lim\limits_{x\rightarrow 0} \frac{\cos^5{x} + ax + b}{x^2}$ I am studying for an entrance exam and would like somebody to confirm my answer or point out mistakes I made. Answers are greatly appreciated!

Find a and b so that the following Limit exists.
  $$ L = \lim_{x\rightarrow 0} \frac{\cos^5{x} + ax + b}{x^2} $$

My solution approach was using l'Hôpital's rule so I set a to 0 and b to -1.
-1 cancels the 1 from cos 0 so I get 0/0 then I can use l'Hôpital's rule. Having a = 0 I can use it again.
Is this approach right?
 A: Your approach is correct. Since $\lim_{x\rightarrow 0}\left( \cos
^{5}x+ax+b\right) =1+b$, for the limit $$L=\lim_{x\rightarrow 0}\frac{\cos
^{5}x+ax+b}{x^{2}}$$ to exist, $1+b$ must be $0$, which means $b=-1$. And
since  $$\lim_{x\rightarrow 0}\left( \frac{d}{dx}\left( \cos
^{5}x+ax-1\right) \right) =a,$$ for L to exist, $a$ must be $0$. The limit is
$$
L=\lim_{x\rightarrow 0}\frac{\frac{d}{dx}\left( \cos ^{5}x-1\right) }{\frac{d
}{dx}\left( x^{2}\right) }=\lim_{x\rightarrow 0}-\frac{5}{2}\left( \cos
^{4}x\right) \frac{\sin x}{x}=-\frac{5}{2}.
$$
A: If you can use the Maclaurin series for $\cos(x)=1-\frac{1}{2}x^2+O(x^4)$, then try using the binomial theorem to get the first two non-zero terms for $\cos^5(x)$.
A: Your approach is right, however in an exam i would reason as follows. The problem in your limit is the $x^2$ at the denominator. As long as you can factor it out from the fraction everything is allright. So try to write
$$\cos(x)=1-\frac{x^2}{2}+o(x^2)$$
and you can easily see that
$$\cos^5(x)=1+p(x)$$
where $p(x)$ is an infinite converging sum of monomials of degree at least $2$. Having noticed this, there is no way for your limit to exists unless $a=0$ and $b=-1$. This part of the reasinonig shows that, if you want your limit to exists, then necessarily $a=0,\: b=-1$. On the other hand, if $a=0,\: b=-1$, then a simple evaluation shows that
$$\lim_{x\to 0}\frac{\cos^5(x)-1}{x^2}=\lim_{x\to 0}-\frac{5\cos^4(x)\sin(x)}{2x}=\lim_{x\to 0}-\frac{5\cos^4(x)}{2}\cdot\frac{\sin(x)}{x}=-\frac{5}{2}.$$
Hope everything is clear.
A: HINT $\ $ If as $\rm\ x\to 0:\: $ $\rm\ f(x)\to f_0,\ \ f{\:\:'}(x)\to f_1,\ \ f(x)/x^2\to f_2\ $ for $\rm\:f_i \in\mathbb R\ $  then $\rm\ f_0 = 0 = f_1\:.$ 
Proof $\ $ If $\rm\ f_0\ne 0\ $ then $\rm\:f(x)/x^2\to\: f_0/0^+ = \infty\not\in\mathbb R\:.\:$ Thus $\rm\:f_0 = 0\:.\:$ Similarly $\rm\:f_1 = 0\:,\:\: $ else
$$\rm f_1 \ne 0\:\ \ \Rightarrow\ \ f_2\: =\  \lim_{x\:\to\: 0}\ \frac{f(x)}{x^2}\ =\ \lim_{x\: \to\: 0}\ \frac{\frac{f(x)-f(0)}{x}}{x}\ \to\ \frac{f_1}{0}\ =\ \pm \infty\ \not\in\: \mathbb R$$
$\ $
So for $\rm\ f(x)\: =\: cos^5(x)+a\:x+b\:,\ \ f(0) = 0\:\Rightarrow\: b=-1\:,\:$ and $\rm\ f{\:\:'}(x)\: =\: -5\ cos^4(x)\ sin(x)+a\ $ hence $\rm\: f{\:\:'}(0) = 0\:\Rightarrow\:a = 0\:.$
REMARK $\ $ If you know about Taylor series then it should be clear that the above amounts to computing a Taylor series approximant.
A: Something without l'Hospital. It is clear that $b=-1$ as mentioned above.
$$ L = \lim_{x\rightarrow 0} \frac{\cos^5{x} + ax -1}{x^2}=\lim_{x \to 0}\left( \frac{\cos^5 x-1}{x^2}+\frac{a}{x} \right)$$
But
$$\lim_{x \to 0} \frac{\cos^5 x-1}{x^2}=\lim_{x \to 0} \frac{\cos x-1}{x^2}(1+\cos x+...+\cos^4 x)=\frac{5}{4} \lim_{x \to 0} \frac{-2\sin^2 \frac{x}{2}}{\frac{x}{2}^2}=-\frac{5}{2}$$
Therefore, if $a \neq 0$ the limit does not exist.
