\begin{align} F \left( \frac{\pi}{3} \right) - F \left( \frac{\pi}{4} \right) &= \frac{\sqrt{3} - \sqrt{2}}{2} \end{align}
\begin{align} f(x) &= \begin{cases} 0 & (x \leq 0) \\ \cos x & (0 \lt x \lt \frac{1}{2} \pi) \\ 0 & (x \geq \frac{1}{2} \pi) \end{cases} \end{align}
\begin{align} E(X) &= \int_0^\frac{\pi}{2} x \cos x dx \\ &= \left[ x \sin x \right]_0^\frac{\pi}{2} - \int_0^\frac{\pi}{2} \sin x dx \\ &= \frac{\pi}{2} + \left[ \cos x \right]_0^\frac{\pi}{2} \\ &= \frac{\pi}{2} - 1 \\ E(X^2) &= \int_0^\frac{\pi}{2} x^2 \cos x dx \\ &= \left[ x^2 \sin x \right]_0^\frac{\pi}{2} - 2 \int_0^\frac{\pi}{2} x \sin x dx \\ &= \frac{\pi^2}{4} + 2 \left[ x \cos x \right]_0^\frac{\pi}{2} - 2 \int_0^\frac{\pi}{2} \cos x dx \\ &= \frac{\pi^2}{4} - 2 \left[ \sin x \right]_0^\frac{\pi}{2} \\ &= \frac{\pi^2}{4} - 2 \\ V(X) &= E(X^2) - E(X)^2 \\ &= \pi - 3 \end{align}