Using Partial Limit $$\lim_{x \to 0} \cos(\pi/2\cos(x))/x^2$$
I tried to evaluate the limit this way,
$$\lim_{x \to 0} \cos(\pi/2\cdot1)/x^2$$  since $\cos0=1$
$$\lim_{x \to 0} \cos(\pi/2\cdot1)/x^2=\lim_{x \to 0} 0/x^2$$
Now apply L'Hospital's Rule twice,
$$\lim_{x \to 0} 0/2(x)=\lim_{x \to 0} 0/2=0$$
So,this way the answer is zero.
Can you please explain where am I doing wrong?
I will be thankful for help!
 A: Hint
Compose Taylor series
$$\cos(x)=1-\frac{x^2}{2}+O\left(x^4\right)$$
$$\cos \left(\frac{\pi}{2}   \cos (x)\right)=\sin \left(\frac{\pi  }{4}x^2+O\left(x^4\right)\right)$$ The next step is simple.
A: When both the numerator and denominator are zero, you have to differentiate both of them to obtain the correct limit. You can't straightly make the numerator $0$. Think about it, if you have
$$\lim_{x\rightarrow0}\frac{2x}{3x}$$
, and you make the numerator zero and differentiate the denominator, you will get zero, which clearly isn't correct.
What I suggest is that you differentiate both the numerator and the denominator to get 
$$\lim_{x\rightarrow0}\frac{\pi\sin(x)\sin(\pi/2\cos(x))}{4x}$$
Now differentiate again, and you get
$$\lim_{x\rightarrow0}\frac{\pi\left[\cos(x)\sin(\pi/2\cos(x))-\pi/2\sin(x)(\cos(\pi/2\cos(x)))\right]}{4}=\frac{\pi}{4}$$
A: Using $\frac{1-\cos(x)}{2}=\sin^2(x/2)$ and $\lim_{t\to 0}\frac{\sin(t)}{t}=1$, we can write
$$\begin{align}
\frac{\cos\left(\frac\pi2 \cos(x)\right)}{x^2}&=\frac{\sin\left(\pi \sin^2(x/2)\right)}{x^2}\\\\
&=\frac\pi4\underbrace{\left(\frac{\sin(x/2)}{x/2}\right)^2}_{\to1\,\,\text{as}\,\,x\to0}\underbrace{\left(\frac{\sin\left(\pi \sin^2(x/2)\right)}{\pi\sin^2(x/2)}\right)}_{\to 1\,\,\text{as}\,\,x\to0}\\\\
\end{align}$$
Therefore, we find that 
$$\lim_{x\to0}\frac{\cos\left(\frac\pi2 \cos(x)\right)}{x^2}=\frac\pi4$$
