A slightly different approach is as follows. Note that we have $$x \sin(x) + 2 \cos(x) \lt 2 \iff x\sin(x) \lt 2(1-\cos(x)) \iff x\sin(x) \lt 2\times2\sin^2(x/2) \\ \iff 2x\sin(x/2)\cos(x/2) \lt 4\sin^2(x/2)$$ Since $\sin(x/2)$ and $\cos(x/2)$ are positive on the interval $(0,\frac{\pi}{2})$, we have $$2x\sin(x/2)\cos(x/2) \lt 4\sin^2(x/2) \iff x\cos(x/2)\lt 2\sin(x/2) \iff x/2\lt \tan(x/2)$$So it's enough to show that for $x\in(0,\frac{\pi}{4})$ the inequality $x\lt \tan(x)$ holds and this can done geometrically or algebraically. For example, take a look at this and this. Note that the inequality $x \sin(x) + 2 \cos(x) \lt 2$ holds for the larger interval $x\in(0,2\pi)$ and the proof for the case $x\in(0,\pi)$ is similar. In the case that $x\in (\pi,2\pi)$, $\cos(x/2)$ is negative and so $$x\cos(x/2)\lt 2\sin(x/2) \iff x/2\gt \tan(x/2)$$This shows that we should prove $x \gt \tan(x)$ holds for $(\frac{\pi}{2},\pi)$. We can combine the previous result with $\tan(x)$ is an odd function and that $\tan(x)$ is periodic with $T = \pi$ to arrive at the desired conclusion: $$x\in (0,\frac{\pi}{2}): x \lt \tan(x) \implies -x\in (0,\frac{\pi}{2}): -x \lt \tan(-x) \implies \\ x\in(-\frac{\pi}{2},0):-x \lt \tan(-x) = -\tan(x) \\ \implies x-\pi\in(-\frac{\pi}{2},0): x \gt x-\pi \gt \tan(x-\pi) = \tan(x) \implies x\in (\frac{\pi}{2},\pi): x \gt \tan(x)$$ When $x = \pi$, it's obvious that the inequality holds: $$x\sin(x) + 2 \cos(x) = 0 - 2\lt 2$$