Solving $\lim_{x\to0}\frac{\cos\left(\frac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))}$ 
I've been asked to solve the limit.
$$\lim_{x\to0}\frac{\cos\left(\frac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))}$$


Here's my approach:
$$\lim_{x\to0}\frac{\cos\left(\frac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))}$$
Using the identity, $\cos(x) =\sin(90^{\circ} - x)$
\begin{aligned}\implies \lim_{x\to0}\frac{\cos\left(\frac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))} 
& = \lim_{x\to0}\frac{\sin\left(\frac{\pi}{2} - \frac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))}
\\& = \lim_{x\to0}\dfrac{\left(\dfrac{\pi}{2} - \dfrac{\pi}{2\cos(x)}\right)\cdot\dfrac{\sin\left(\frac{\pi}{2} - \frac{\pi}{2\cos(x)}\right)}{\left(\frac{\pi}{2} - \frac{\pi}{2\cos(x)}\right)}}{\sin(\sin(x^2))}
\\ & = \lim_{x\to0}\dfrac{\left(\dfrac{\pi}{2} - \dfrac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))}\cdot \underbrace{\lim_{x\to0}\dfrac{\sin\left(\frac{\pi}{2} - \frac{\pi}{2\cos(x)}\right)}{\left(\frac{\pi}{2} - \frac{\pi}{2\cos(x)}\right)}}_{1}
\\ & = \dfrac{\lim\limits_{x\to0}\dfrac{\pi}{2}\left(\dfrac{\cos(x) - 1}{\cos(x)}\right)}{\underbrace{\lim\limits_{x\to0}\dfrac{\sin(\sin(x^2))}{\sin(x^2)}}_1\cdot\sin(x^2)}
\\ & =\dfrac{\lim\limits_{x\to0}\dfrac{\pi}{2}\left(\dfrac{\cos(x) - 1}{\cos(x)}\right)}{\underbrace{\lim\limits_{x\to0}\dfrac{\sin(x^2)}{x^2}}_1\cdot x^2}
\\ & =  \color{blue}{\boxed{\lim\limits_{x\to0}\dfrac{\pi}{2x^2}\left(\dfrac{\cos(x) - 1}{\cos(x)}\right)}}
\end{aligned}
Now, I'm unable to think of anything to do with this boxed part. Can anyone check my above method and tell me what to do further with this question? Any other shorter method is also most welcomed!
 A: $$
\frac{\cos x - 1}{x^2}
 = \frac{\cos x - 1}{x^2} \times \frac{\cos x + 1}{\cos x + 1}
 = \frac{\cos^2 x - 1}{x^2(\cos x + 1)}
 = \frac{-\sin^2 x}{x^2} \times \frac{1}{\cos x + 1}
$$
and the left fraction can be computed since $\sin(x)/x \to 1$...
A: You have $\sin(x^2)=x^2+o(x^2)$ and therefore also
$$
\sin(\sin(x^2))=x^2+o(x^2)
$$
Thus you need the Taylor expansion of
$$
\cos\Bigl(\frac{\pi}{2\cos x}\Bigr)
$$
up to degree $2$. Consider $f(x)=1/\cos x$. Then $f(0)=1$ and
$$
f'(x)=\frac{\sin x}{\cos^2x},\qquad f'(0)=0
$$
and
$$
f''(x)=\frac{\cos^3x+2\sin^2x\cos x}{\cos^4x}=\frac{\cos^2x+2\sin^2x}{\cos^3x},\qquad f''(0)=1
$$
Hence
$$
\frac{\pi}{2\cos x}=\frac{\pi}{2}+\frac{\pi}{4}x^2+o(x^2)
$$
and therefore
$$
\cos\Bigl(\frac{\pi}{2\cos x}\Bigr)=
\cos\Bigl(\frac{\pi}{2}+\frac{\pi}{4}x^2+o(x^2)\Bigr)=-\sin\Bigl(\frac{\pi}{4}x^2+o(x^2)\Bigr)=-\frac{\pi}{4}x^2+o(x^2)
$$
and your limit is
$$
\lim_{x\to0}\frac{-\pi x^2/4+o(x^2)}{x^2+o(x^2)}=-\frac{\pi}{4}
$$
A: I found another way to compute the final boxed limit.
$$\begin{aligned}&\lim_{x\to0} \frac{\pi}{2x^2}\cdot\frac{\cos(x)-1}{\cos(x)}\\=&\lim_{x\to0}\frac{-(1-\cos(x))}{x^2}\cdot\frac{\pi}{2\cos(x)}\end{aligned}$$
The limit $\boxed{\lim\limits_{x\to0}\dfrac{1-\cos(x)}{x^2} = \dfrac12}$
$$\begin{aligned}\implies& \lim_{x\to0}\frac{-(1-\cos(x))}{x^2}\cdot\frac{\pi}{2\cos(x)} = \lim_{x\to0}\frac{-1}{2}\cdot\frac{\pi}{2\cos(x)}\\=&\frac{-\pi}{4\cos(0)} = \frac{-\pi}{4}\end{aligned}$$
So the limit is $-\pi/4$.
A: $$
\cos\left(x\right)-1 \underset{(0)}{=}-\frac{x^2}{2}+o\left(x^3\right)
$$
Hence combined with what you did
$$
\frac{\cos\left(\frac{\pi}{2\cos(x)}\right)}{\sin(\sin(x^2))} \underset{(0)}{\sim}\frac{\pi}{2x^2}\left(-\frac{x^2}{2}\right) = -\frac{\pi}{4}$$
