Question:
The function $f(x)=\left\{\begin{array}{ll}\frac{\sin x}{x}+\cos x, & \text { if } x \neq 0 \\ k, & \text { if } x=0\end{array}\right.$ is continuous at $x=0$, then the value of $k$ is
(a) 3
(b) 2
(c) 1
(d) 1.5
Solution:
It is given that, the function $f(x)=\left\{\begin{array}{ll}\frac{\sin x}{x}+\cos x, & \text { if } x \neq 0 \\ k, & \text { if } x=0\end{array}\right.$ is continuous at $x=0$.
$\therefore f(0)=\lim _{x \rightarrow 0} f(x)$
$\Rightarrow k=\lim _{x \rightarrow 0}\left(\frac{\sin x}{x}+\cos x\right)$
$\Rightarrow k=\lim _{x \rightarrow 0} \frac{\sin x}{x}+\lim _{x \rightarrow 0} \cos x$
$\Rightarrow k=1+1=2$
Thus, the value of k is 2.
Hence, the correct answer is option (b).