TITLE: Calculating the Limit $\lim\limits_{x\rightarrow 0} \frac{\cos^5{x} + ax + b}{x^2}$
QUESTION [6 upvotes]: 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?

REPLY [2 votes]: 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.