Always convert trigonometric expressions into a single function type if possible when checking absolute boundaries. Alternatively, rewrite \( f(x) = \cos x + (1 - \cos^2 x) = 1 + \cos x - \cos^2 x \). Letting \( t = \cos x \) where \( t \in [-1, 1] \), you get a simple quadratic function \( g(t) = 1 + t - t^2 \), whose maximum occurs at its vertex \( t = -\frac{1}{2(-1)} = \frac{1}{2} \).