Find $\alpha$ and $\beta$ so that the function $f\left(x\right)$ defined by $f\left(x\right) = \begin{cases} -2 \sin x, & \text{for } -\pi \leq x \leq - \dfrac{\pi}{2} \\\\ \alpha \sin x + \beta, & \text{for } - \dfrac{\pi}{2} < x < \dfrac{\pi}{2} \\\\ \cos x, & \text{for } \dfrac{\pi}{2} \leq x \leq \pi \end{cases}$ $\;$ is continuous on $\left[-\pi,\pi\right]$
Since $f\left(x\right)$ is continuous on $\left[-\pi, \pi\right]$, therefore $f\left(x\right)$ must be continuous at $-\dfrac{\pi}{2}$ and $\dfrac{\pi}{2}$.
$\therefore$ $f\left(-\dfrac{\pi}{2}\right)= \lim\limits_{x \to -\frac{\pi}{2}^-} f\left(x\right) = \lim\limits_{x \to -\frac{\pi}{2}^+} f\left(x\right)$ $\cdots$ (1)
and $f\left(\dfrac{\pi}{2}\right) = \lim\limits_{x \to \frac{\pi}{2}^-}f\left(x\right)= \lim\limits_{x \to \frac{\pi}{2}^+}f\left(x\right)$ $\cdots$ (2)
$\therefore$ From equation (1) we have
$-2 \sin \left(-\dfrac{\pi}{2}\right) = \lim\limits_{x \to -\frac{\pi}{2}^-} \; -2\sin x = \lim\limits_{x \to -\frac{\pi}{2}^+} \; \alpha \sin x + \beta$
i.e. $-2 \sin \left(-\dfrac{\pi}{2}\right) = -2 \sin \left(-\dfrac{\pi}{2}\right) = \alpha \sin \left(-\dfrac{\pi}{2}\right)+ \beta$
i.e. $2 \sin \left(\dfrac{\pi}{2}\right) = 2 \sin \left(\dfrac{\pi}{2}\right) = -\alpha \sin \left(\dfrac{\pi}{2}\right)+\beta$ $\;\;\; \left[\text{Note: }\sin \left(-\theta\right)=-\sin \theta\right]$
i.e. $-\alpha + \beta = 2 \; \cdots (3)$
From equation (2) we have
$\cos \left(\dfrac{\pi}{2}\right) = \lim\limits_{x \to \frac{\pi}{2}^-} \; \alpha \sin x + \beta = \lim\limits_{x \to \frac{\pi}{2}^+} \; \cos x$
i.e. $\cos \left(\dfrac{\pi}{2}\right) = \alpha \sin \left(\dfrac{\pi}{2}\right)+\beta = \cos \left(\dfrac{\pi}{2}\right)$
i.e. $\alpha + \beta = 0 $
$\implies$ $\alpha = -\beta \; \cdots (4)$
Substituting the value of $\alpha$ in equation (3) gives
$2 \beta = 2$ $\implies$ $\beta = 1$
Substituting the value of $\beta$ in equation (4) gives
$\alpha = -1$