Determine the value of $a$ for which the function is continuous at $x=0$ Determine the value of $a$ for which the function is continuous at $x=0$
  $$
f(x) = 
\begin{cases}
a \sin\frac{\pi}{2}(x+1) &amp; \text{if} \ x\le0, \\ \\
\frac{\tan x - \sin x}{x^3} &amp;\text{if} \ x\gt0. \ 
\end{cases}
$$


Can you help me with this problem?
HINT:

$$\lim_{x\to0^+}\frac{\tan x - \sin x}{x^3}$$

$$=\lim_{x\to0^+}\frac{\sin x}x\cdot\lim_{x\to0^+} \frac{1-\cos x}{x^2}\cdot\lim_{x\to0^+}\frac1{\cos x}$$

$$=\lim_{x\to0^+} \frac{1-\cos x}{x^2}  \text{ as }\lim_{x\to0}\frac{\sin x}x=1=\lim_{x\to0}\cos x$$

$$=\frac12\left(\lim_{x\to0^+} \frac{\sin \frac x2}{\frac x2}\right)^2\text{ as }\cos2y=1-2\sin^2y$$

$$=\frac12$$

$$\lim_{x\to0^-}\sin\left(\frac\pi2(x+1)\right)=1$$

Now use this.
Hint $f$ is continuous at $x=0$ if and only if

$$\lim_{x \to 0^+} f(x) = \lim_{x \to 0^-} f(x)=f(0) \,.$$

Now $f(0)=a \sin(\frac{\pi}{2})=??$

$$\lim_{x \to 0^+} f(x) =\lim_{x \to 0^+} \frac{\tan(x)-\sin(x)}{x^3}=???$$
$$\lim_{x \to 0^-} f(x) =\lim_{x \to 0^-}a \sin(\frac{\pi}{2}(x+1))=???$$