<s>[INST] Can the value $\lim \frac{\sin x}{x} = 1$ be used even if $x$ is not approaching $0$? I was going through a solved example that involved calculating the coefficient $a$ for a piecewise function to be continuous at $x = 0$:
$f(x) = a \sin{\frac{\pi}{2} (x + 1)}$ if $x \le 0$
$f(x) = \frac{\tan{x} - \sin{x}}{x^3}$ if $x \gt 0$
For calculating the left-hand limit, the example proceeds by multiplying both the numerator and denominator by $\frac{\pi}{2} (x + 1)$ to get the $\sin x / x$ form and ends up with $\frac{a \pi}{2}$. Is this still applicable even when $x$ is not approaching $0$? Why can’t I just substitute $x = 0$ for the function since $0$ is included its domain and it reduces to $\frac{\sin{\pi / 2}}{\pi / 2}$, which is defined?
 [/INST] Let $f(x)$ a function such that $f(x)\to0$ when $x\to x_0\,\in\,\bar{\mathbb{R}}$, then:
$$\sin(f(x))\,\,\sim\,\,f(x)$$
This results can be shown using composite function limit theorem.
In your case, we are to study the continuity of:
$$f(x)=\begin{cases}
a \sin{\frac{\pi}{2} (x + 1)} & \text{ if } x\leq 0 \\
\frac{\tan{x} - \sin{x}}{x^3}& \text{ if } x > 0 
\end{cases}$$
We must have:
$$\lim_{x\to 0^-}f(x)=\lim_{x\to 0^+}f(x)=f(0)$$
So:
$$\lim_{x\to 0^+}f(x)=\lim_{x\to 0^+}a \sin{\frac{\pi}{2} (x + 1)}=a$$
Because when $x\to 0$, we have $\frac{\pi}{2} (x + 1)\to \frac{\pi}{2}$ and $\sin\left(\frac{\pi}{2}\right)=1$.
Also:
$$\lim_{x\to 0^+}f(x)=\lim_{x\to 0^+}\frac{\tan{x} - \sin{x}}{x^3}=\lim_{x\to 0^+}\frac{\sin(x)}{x}\cdot\frac{\cos(x)-1}{\sin^2(x)}\,\,\sim\,\,\lim_{x\to 0^+}1\cdot\frac{-\frac{1}{2}x^2}{x^2}=-\frac{1}{2}$$
And:
$$f(0)=a$$
So, $f(x)$ is continous in $x=0$ if and only if $a=-\frac{1}{2}$.
</s>