$\max\{\pi_0 F_{L_0}(W)-\frac{\pi_1}{W}\int_0^W F_{L_1}( \alpha )d \alpha \}$ \$W_{opt}=\arg \{\max(\pi_0 F_{L_0}(W)-\frac{\pi_1}{W}\int_0^W F_{L_1}( \alpha )d \alpha )\}$
$\textrm{s.t.}\quad \int_0^W F_{L_0} (\alpha)d\alpha <\xi$ \ subject to $\quad \int_0^W F_{L_0} (\alpha)d\alpha <\xi$
We should find analytically the bestoptimal $W >0$ whenwhich maximize the first equation subject to the second equation, where $F( \cdot )$ is probabilitycomulative distribution function (CDF), and $L_0$ and $L_1$ are positive random variables. $\xi$, $\pi_0$, $\pi_1$ are constant. Also, $\pi_0, \pi_1>0$$0<\pi_0, \pi_1<1$ and $\pi_0 + \pi_1 =1$. All variables are real. Further, if needed, we can assume that, for example, $F_{L_0}$ and $F_{L_1}$ such as below ($\lambda$$L_0$ and $\mu$ are constant:
$F_{L_0}(\alpha) &=& 1-e^{-\mu \alpha} \quad \alpha \geq 0.$ $F_{L_1}(\alpha) &=& 1-e^{-\lambda \alpha} \quad \alpha \geq 0. $$L_1$ may have Erlang or exponential distribution.