The crossed ladders problem is a puzzle of unknown origin that has appeared in various publications and regularly reappears in Web pages and Usenet discussions.

## The problem

Two ladders of lengths a and b lie oppositely across an alley, as shown in the figure. The ladders cross at a height of h above the alley floor. What is the width of the alley?

Martin Gardner presents and discusses the problem in his book of mathematical puzzles published in 1979 and cites references to it as early as 1895. The Crossed Ladders Problem may appear in various forms, with variations in name, using various lengths and heights, or requesting unusual solutions such as cases where all values are integers. Its charm has been attributed to a seeming simplicity which can quickly devolve into an "algebraic mess" [characterization attributed by Gardner to D. F. Church].

## Solution summary

The problem may be reduced to the quartic equation x 3(x − c) − 1 = 0, which can be solved by approximation methods, as suggested by Gardner, or the quartic may be solved in closed form by Ferrari's method. Once x is obtained, the width of the alley is readily calculated. A derivation of the quartic is outlined below. Note the potentially confusing fact that the requested unknown, w, does not appear.

Eq 1: Divide the baseline into two parts at the point where it meets $h\,$ , and call the left and right parts $w_{1}\,$ and $w_{2}\,$ , respectively. The angle where $a\,$ meets $w\,$ is common to two similar triangles with bases $w\,$ and $w_{1}\,$ respectively. The angle where $b\,$ meets $w\,$ is common to two similar triangles with bases $w\,$ and $w_{2}\,$ respectively. This tells us that
${\frac {B}{w}}={\frac {h}{w_{1}}}\,$ and ${\frac {A}{w}}={\frac {h}{w_{2}}}\,$ which we can then re-arrange (using $w_{1}+w_{2}=w$ ) to get
${\frac {1}{A}}+{\frac {1}{B}}={\frac {1}{h}}\,$ from which we get
$AB=h(A+B)\,$ .

Eq 2: Using the Pythagorean theorem, we can see that
$w^{2}+B^{2}=a^{2}$ and $w^{2}+A^{2}=b^{2}$ .
By isolating w² on both equations, we see that
$a^{2}-B^{2}=b^{2}-A^{2}$ which can be rearranged and factored into
$a^{2}-b^{2}=(B+A)(B-A)\,$ .

Eq 3: Square (Eq 2) and combine with (Eq 1)
$(a^{2}-b^{2})^{2}=(B+A)^{2}(B-A)^{2},\,$ $(a^{2}-b^{2})^{2}=(B+A)^{2}(B^{2}-2AB+A^{2})$ Rearrange to get
$(a^{2}-b^{2})^{2}=(A+B)^{2}(A^{2}+B^{2}-2AB)$ Then
$(a^{2}-b^{2})^{2}=(A+B)^{2}(A^{2}+B^{2}+2AB-4AB),\,$ $(a^{2}-b^{2})^{2}=(A+B)^{2}((A^{2}+2AB+B^{2})-4AB),\,$ $(a^{2}-b^{2})^{2}=(A+B)^{2}((A+B)^{2}-4AB),$ Now, combine with (Eq 1)
$(a^{2}-b^{2})^{2}=(A+B)^{2}((A+B)^{2}-4h(A+B)),\,$ $(a^{2}-b^{2})^{2}=(A+B)^{2}(A+B)((A+B)-4h)\,$ Finally
$(a^{2}-b^{2})^{2}=(A+B)^{3}(A+B-4h)\,$ Let

$x={\frac {A+B}{\sqrt {a^{2}-b^{2}}}},\,$ $c={\frac {4h}{\sqrt {a^{2}-b^{2}}}}.\,$ Then

$x^{3}(x-c)-1=0.\,$ (same as Eq 3)

The above fourth power equation can be solved for x using any available method. The width of the alley is then found by using the value found for x.

A quartic equation has four solutions, and only one solution for this equation matches the problem as presented. Another solution is for a case where one ladder (and wall) is below ground level and the other above ground level. In this case the ladders do not actually cross, but the intersection of their extensions do so at the specified height. The other two solutions are a pair of conjugate complex numbers. The equation does not have the ladder lengths explicitly defined, only the difference of their squares, so one could take the length as any value that makes them cross, and the wall spacing would be defined as between where the ladders intersect the walls.

Surprisingly as the wall spacing approaches zero, the height of the crossing approaches $w={\frac {ab}{a+b}}$ . As the solutions to the equation involve square roots, negative roots are equally valid so both ladders and walls can be below ground level and with them in opposing sense, they can be interchanged.

The complex solutions result in wall A leaning to the left or right and wall B below ground, so the intersection is between extensions to the ladders as shown for the case h.a,b = 3,2,1. The ladders a & b and a^2-b^2 are not as specified . The base w is a function of A,B & h and the complex values of A & B can be found from the alternatine quartic x^4 - 2.h.x^3 + D.x^2 - 2.h.D.x + h^2.D = 0 with D being a^2-b^2 for one wall and b^2-a^2 for the other.(+/-5 in the example) Note that the imaginary solutions are horizontal and the real ones are vertical.