Is it possible to calculate how much percent the function $\cos ax-\cos 2ax$ is positive on its periodic domain? We know that $\cos ax$ on its period $0<x<\frac{2\pi}{a}$ is $50$ % positive and $50$ % negative.
My question is that are we able to conclude such a result for the following function?
$$\cos ax-\cos 2ax$$
I mean can we say something about how much percent this function is positive on its periodic domain? According to the plots, I see that this percent does not depend on the parameter $a$; is that correct?
Here, $a$ and $x$ are both reals and positive.

 A: Since the function is periodic we need only find the proportion of the curve which is positive over the first period. To do this, we can integrate between $0$ and the first root, of the function. This will give the positive area. Do the same to find the area of the curve which is negative, and then combine the two to find the percentage you require.
A: As @binary_string100101 says:

$$\int\limits_{x=0}^{2 \pi a} [\cos (a x) - \cos (2 a x)]^+  dx = \frac{3 \sqrt{3}}{2}$$
where $[\cdot]^+$ is non-zero only if the argument is non-negative.
The same holds for the negative portion.
So $50\%$ above, and $50\%$ below.
A: The other answers to this question are responding to how much of the area between the curve and the $x$-axis is positive as a proportion of the total area. I read the question as being what proportion of the domain is the function positive over. If that's the case, the solution is below:
You need to know where the function is positive and where it's negative. The easiest way to do that is to find the roots:
$$ \cos(ax) - \cos(2ax) = 0$$
$$ \Rightarrow \cos(ax) - \left( 2\cos^2 (ax) - 1 \right) = 0$$
$$ \Rightarrow 2\cos^2 (ax) - \cos(ax) - 1 = 0$$
Note that this equation is quadratic in $\cos(ax)$, so we can use the quadratic formula:
$$ \cos(ax) = \frac{1 \pm \sqrt{1-4(2)(-1)}}{4} $$
$$ \Rightarrow \cos(ax) = 1, -\frac{1}{2} $$
For the period between $x = 0$ and $x = \frac{2\pi}{a} $, the solutions to these equations are:
$$ x = 0, \frac{2\pi}{3a}, \frac{4\pi}{3a}, \frac{2\pi}{a} $$
Then, the function is nonnegative on the intervals $[0,\frac{2\pi}{3a}]$ and $[\frac{4\pi}{3a}, \frac{2\pi}{a}]$. The ratio of the measure of the union of these intervals to the interval for the period is then
$$ \frac{(\frac{2\pi}{a} - \frac{4\pi}{3a}) + (\frac{2\pi}{3a} - 0)}{\frac{2\pi}{a} - 0} $$
$$ = \frac{\frac{4\pi}{3a}}{\frac{2\pi}{a}} $$
$$ = \frac{2}{3} .$$
So, $\cos(ax) - \cos(2ax)$ is positive for $\frac{2}{3}$ of its interval.
