The length of the shorter stick can be from $0$ to $0.5$ (because if it is greater than $0.5,$ it is no longer a shorter stick).
This random variable $L$ (length of shorter stick) follows a uniform distribution, and hence probability density function of $L$ is $\dfrac{1}{0.5-0}= 2$ for all lengths in range $0$ to $0.5$
Now expected value of $L = \int_{0}^{0.5} L*p(L) dL = \int_{0}^{0.5} L*2 dL = 2*\left[\dfrac{L^2}{2}\right]^{0.5}_0 = 0.25$