Find the maximum value of $\cos x + 2 \sin x,$ over all angles $x.$
I recognize this expression as a linear combination of trigonometric functions with the same frequency. I recall that there is a formula for converting such expressions into a single trigonometric function with a different amplitude and phase shift. The formula is $a \cos x + b \sin x = c \cos (x - \delta),$ where $c = \sqrt{a^2 + b^2}$ and $\delta = \arctan \frac{b}{a}.$ Applying this formula to the given expression, I get $\cos x + 2 \sin x = \sqrt{5} \cos (x - \arctan 2).$ Now, I know that the maximum value of $\cos (x - \arctan 2)$ is $1,$ which occurs when $x - \arctan 2 = 0$ or $x = \arctan 2.$ Therefore, the maximum value of the given expression is $\sqrt{5} \cdot 1 = \sqrt{5}.$ 