When the Malus' law is applied to a beam of unpolarized light, I can understand that the incident light has all the possible polarizations, so that I should apply the law for all the angles.
If I had three angles $\theta_1$, $\theta_2$ and $\theta_3$, I guess the equation should be
$I = I_0\left(\cos^2\theta_1+\cos^2\theta_2+\cos^2\theta_3\right)$.
If the light is unpolarized, I won't have just three angles, but all the angles between $0$ and $2\pi$, so the sum turns an integral:
$I = I_0\displaystyle\int_0^{2\pi} \cos^2\left(\theta\right) d\theta$.
However, it seems that, instead of that integral, I should use the average value, i.e. the integral divided by $2\pi$. Why?