# Continuity by parts, calculating the limit of a trig function

$$\large f(x)=\begin{cases}\left(\sin\frac\pi{2+x}\right)^{1/x^2},& x\ne0\\c,&x\ne0\end{cases}$$

I want to find the c for which this function is continuous: I tried to find the limit of f(x) as x approches 0 to get a value which would be my C but I have trouble finding the limit. I get infinity which would mean there is no continuous extension at 0.

How would you proceed?

Hint

Consider $$y=\sqrt[x^2]{\sin \left(\frac{\pi }{x+2}\right)}\implies \log(y)=\frac 1{x^2}\log\left(\sin \left(\frac{\pi }{x+2}\right)\right)$$ Now use Taylor series $$\frac{\pi }{x+2}=\frac{\pi }{2}-\frac{\pi x}{4}+\frac{\pi x^2}{8}+O\left(x^3\right)$$ $$\sin \left(\frac{\pi }{x+2}\right)=1-\frac{\pi ^2 x^2}{32}+O\left(x^3\right)$$ $$\log\left(\sin \left(\frac{\pi }{x+2}\right)\right)=\log\left( 1-\frac{\pi ^2 x^2}{32}+O\left(x^3\right)\right)=-\frac{\pi ^2 x^2}{32}+O\left(x^3\right)$$

I am sure that you can take it from here.

Note that we can write

$$\sin\left(\frac{\pi}{2+x}\right)=\cos\left(\frac{\pi x}{2(2+x)}\right)$$

and

\begin{align} \sin\left(\frac{\pi}{2+x}\right)^{1/x^2}&=e^{\frac1{x^2}\log\left(\sin\left(\frac{\pi}{2+x}\right)\right)}\\\\ &=e^{\frac1{x^2}\log\left(\cos\left(\frac{\pi x}{2(2+x)}\right)\right)}\\\\ &=e^{\frac1{x^2}\log\left(1-\frac12 \left(\frac{\pi x}{2(2+x)}\right)^2+O(x^4)\right)}\\\\ &=e^{-\frac1{2x^2}\left(\frac{\pi x}{2(2+x)}\right)^2 +O(x^2)}\\\\ &\to e^{-\pi^2/32} \end{align}