Answer
$L= \frac{\sqrt {20x^2 - 20x + 25}}{4}$
Work Step by Step
$2x + 4y = 5$
$4y = 5 - 2x$
$y = - \frac{1}{2} x + \frac{5}{4}$
Say, a = distance from the y-axis till the point (x,y), then a = x-0.
Say, b = distance from the x-axis till the point (x,y), then b = y-0.
Using Pythagorean's theorem, one can say that $L^2 = a^2 + b^2$. So, $L = \sqrt {a^2 + b^2}$.
So, $L = \sqrt {(x-0)^2 + (y-0)^2}$
Substituting $y = - \frac{1}{2} x + \frac{5}{4}$ gives
$L = \sqrt {(x-0)^2 + (- \frac{1}{2} x + \frac{5}{4}-0)^2}$
$L = \sqrt {x^2 + (- \frac{1}{2} x + \frac{5}{4})^2}$
$L = \sqrt {x^2 + \frac{1}{4} x^2 - \frac{5}{4}x + \frac{25}{16}}$
$L = \sqrt {\frac{5}{4} x^2 - \frac{5}{4}x + \frac{25}{16}}$
$L = \sqrt {\frac{20}{16} x^2 - \frac{20}{16}x + \frac{25}{16}}$
$L = \sqrt {\frac{20 x^2 - 20x + 25}{16}}$
$L = \frac{\sqrt {20 x^2 - 20x + 25}}{4}$