The red one is √( 1+cos 2x), and the black one is √2 cos x.
The previous function is non-negative because it has a root sign and its value range is [0, 1]. The latter function is in the range of [- 1, 1], so it is easy to judge whether the two functions are the same.