Find a non-zero value for the constant $k$ such that $f$ defined as below is continuous at $x = 0$.
$$f(x) = \begin{cases} \frac{\tan(kx)}{x}, \hspace{0.3cm}x< 0 \\ 3x + 2k^2, \hspace{0.3cm}x\geq0 \end{cases}$$
My attempt:
$$\lim_{x\rightarrow0^{-}}\frac{\tan(kx)}{ x} = \lim_{x \rightarrow 0^{-}} \frac{\sin(kx)}{ x\cos(kx)} = \lim_{x \rightarrow 0^{-}} \frac{k\sin(kx)}{(kx)}\frac{1}{\cos(kx)} = k\lim_{x \rightarrow 0^{-}} \frac{1}{\cos(kx)} = k$$
$$\lim_{x \rightarrow 0^{+}}3x+2k^2 = 2k^2$$
For continuity we must have that the limit on the right must be equal to the limit on the left, i.e, $k = 2k^2$, so
$$k(2k-1) = 0$$
Therefore, a non-zero value for constant $k$ such that $f$ is continuous on $x=0$ is $k = 1/2$.
I am not fully confident in my solution. Could someone tell me if i went down the right path and why? Or maybe tell me I am entirely wrong and lend a hand?