Let $ h(x) = \begin{cases} \sin (kx), & \text{if }x\leq 2, \\ x+k^2, & \text{if }x>2, \end{cases} $ where $k$ is a real constant. Determine the value of $k$, if any, that makes k continuous everywhere.
I done my work and here goes.
Since $h(x)$ is continuous on $(-\infty,2)$ and on $(2,\infty)$, it suffice to find the value of $k$ such that $h(x)$ is continuous at $x=2$.
Suppose $h(x)$ is continuous at $x=0$, then $\lim_{x\to2^-}h(x)=\lim_{x\to2^-}\sin k(x)=\sin(2k)$ and $\lim_{x\to2^+}h(x)=\lim_{x\to2^+}x+k^2=2+k^2$ Therefore, $\lim_{x\to2^+}h(x)=\lim_{x\to2^-}h(x)$ implies $\sin(2k)=2+k^2$
Ok so now I am stuck. Thanks in advance for helping me out!