Answer
$$ \approx 14.05{\text{ft}}$$
Work Step by Step
$$\eqalign{
& {\text{From the image shown below }} \cr
& {\text{Using the points: }}\left( {0,y} \right){\text{ and }}\left( {4,6} \right){\text{ and }}m = \frac{{{y_2} - {y_1}}}{{{x_2} - {x_1}}} \cr
& m = \frac{{6 - y}}{{4 - 0}} = \frac{{6 - y}}{4} \cr
& {\text{Using the points: }}\left( {x,0} \right){\text{ and }}\left( {4,6} \right){\text{ and }}m = \frac{{{y_2} - {y_1}}}{{{x_2} - {x_1}}} \cr
& m = \frac{{6 - 0}}{{4 - x}} = \frac{6}{{4 - x}} \cr
& {\text{Let }}m = m \cr
& \frac{{6 - y}}{4} = \frac{6}{{4 - x}} \cr
& {\text{Solving for }}y \cr
& 6 - y = \frac{{24}}{{4 - x}} \cr
& y = 6 - \frac{{24}}{{4 - x}} \cr
& y = \frac{{6x}}{{x - 4}} \cr
& {\text{Using the pythagoream theorem to calculate the length}} \cr
& {\text{of the beam}} \cr
& h = \sqrt {{x^2} + {y^2}} \cr
& h = \sqrt {{x^2} + {{\left( {6 - \frac{{24}}{{4 - x}}} \right)}^2}} ,{\text{ domain }}x > 4 \cr
& {\text{The expression is a minimum when the radicand is a minimum,}} \cr
& {\text{so let }}L{\text{ the radicand be}} \cr
& L = {x^2} + {\left( {6 - \frac{{24}}{{4 - x}}} \right)^2} \cr
& {\text{Differentiate}} \cr
& \frac{{dL}}{{dx}} = 2x + 2\left( {6 - \frac{{24}}{{4 - x}}} \right)\left( {\frac{{24}}{{{{\left( {4 - x} \right)}^2}}}} \right) \cr
& \frac{{dL}}{{dx}} = 2x + 2\left( {\frac{{6x}}{{x - 4}}} \right)\left( {\frac{{24}}{{{{\left( {4 - x} \right)}^2}}}} \right) \cr
& \frac{{dL}}{{dx}} = 2x + \frac{{288x}}{{{{\left( {x - 4} \right)}^3}}} \cr
& {\text{Let }}\frac{{dL}}{{dx}} = 0,{\text{ then}} \cr
& 2x + \frac{{288x}}{{{{\left( {x - 4} \right)}^3}}} = 0 \cr
& x + \frac{{144x}}{{{{\left( {x - 4} \right)}^3}}} = 0 \cr
& x{\left( {x - 4} \right)^3} + 144x = 0 \cr
& x\left[ {{{\left( {x - 4} \right)}^3} - 144} \right] = 0 \cr
& x = 0,{\text{ }}{\left( {x - 4} \right)^3} - 144 = 0 \cr
& {\left( {x - 4} \right)^3} = 144 \cr
& x - 4 = \root 3 \of {144} \cr
& x = 4 + \root 3 \of {144} {\text{ and }}x = 0{\text{ }}\left( {{\text{Domain }}x > 4} \right) \cr
& {\text{Taking }}x = 4 + \root 3 \of {144} \cr
& {\text{The length of the shortest beam is:}} \cr
& h = \sqrt {{x^2} + {{\left( {5 - \frac{{20}}{{4 - x}}} \right)}^2}} \cr
& h = \sqrt {{{\left( {4 + \root 3 \of {144} } \right)}^2} + {{\left( {5 - \frac{{20}}{{4 - 4 + \root 3 \of {144} }}} \right)}^2}} \cr
& {\text{Simplifying by a scientific calculator}} \cr
& h \approx 14.05{\text{ft}} \cr} $$