Average value of $\cos^2(\theta)$ in Malus' law 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?
 A: The formula which you gave in the example is wrong, and I'll shortly show you why.

Unpolarized light can be taking as a mixture of light polarized in different directions, as shown in the figure. Thus, we must find the intensity due to each individual polarized light using malus law and add them up
Assume that there are $n$ different polarized light. For instance, in your example, you have taken $n=3$. Thus, each polarized light will have an intensity $\frac{I_0}{n}$ (This is where you went wrong in your example, it should have been $\frac{I_0}{3}$, not $I_0$ in your example). Additionaly, the angle between each polarized light is $\theta=\frac{\pi}{n}$. Thus, the net intensity transmitted is given by,
$$I = \frac{I_0}{n}(\cos^2{0}+\cos^2{\theta} + \cos^2{2\theta}+....+\cos^2{(\pi-\theta)}+\cos^2{\pi})$$
$$=  \frac{I_0}{\pi}\frac{\pi}{n}\sum_{k=0}^{n} \cos^2{k\frac{\pi}{n}}$$
But since it is unpolarized light we are talking about, we must take the limit of $n$ becoming $\infty$. In that case, the sum reduces to a integral and we get,
$$I=\frac{I_0}{\pi} \int_{0}^{\pi} \cos^2{\theta}d\theta = \frac{I_0}{2}$$
