The position of a ladder leaning against a wall and touching a box under it

I was reading a newspaper and there was a little math riddle, I thought "how funny, that's gonna be easy, let's do it" and here am I...

The problem goes as follow : in a barn, there is a 1 meter cubic box against a wall and a 4 meter ladder is leaning against the wall, touching the box at its corner. Here is a picture : Illustration of the situation

So, the big triangle has a hypotenuse $FE$ of $4$, the square $ABDC$ has sides of length 1 and is basically "insquared" at the right angle, i.e. $D\in \overline{FE}$. The question is "what is the length of the biggest cathetus", here $AF$.

So far, no problem.

Now here are my solutions:

  • By Thales' intercept theorem, $\frac{FB}{FA}=\frac{BD}{AE}$, by hypothesis, $FB=FA-1$ and $BD=1$. Now by Pythagoras, $FA^2+AE^2=FE^2$; by hypothesis, $FE=4$, so we end up with a system of equations, letting $h=FA, d=AE$: $$ \begin{align} &\frac{h-1}{h}=\frac{1}{d} \\ &h^2+d^2=4^2 \end{align} $$ Which solves (removing 3 non-relevant solutions) into $d \cong 1.3622$ and $h \cong 3.76091$.
  • Now, if I consider the "function" of the line : $f(x)=\frac{-h}{d}x+h$, I know that $f(1)=1$ and I end up with Pythagoras with the system :$$ \begin{align} &\frac{-h}{d}+h=1 \\ &h^2+d^2=4^2 \end{align} $$ it solves again into the same, again removing 3 non-relevant solutions

Okay, this means that using Pythagoras is no good since it ends up giving a quartic equation (4 answers of which 3 are "non-relevant").

  • Now if I consider the length of the arc $f(x)$ between $0$ and $d$ it has to be $4$ and again $f(1)=1$ I end up with the system: $$ \begin{align} &\frac{-h}{d}+h=1 \\ &\int_0^d \sqrt{1+(f'(x))^2} dx =\int_0^d \sqrt{1+\left(\frac{-h}{d}\right)^2} dx = d \sqrt{1+\left(\frac{-h}{d}\right)^2} \end{align} $$ Which solves again into the same answers, but this time removing only 2 non-relevant solutions (i.e. it gives a cubic equation instead of a quartic).

I tried also using the areas and the smaller trangles $FAD$ and $AED$ for example : $\frac{h \cdot d}{2} = \frac{h\cdot 1}{2}+\frac{d\cdot 1}{2}$

Yet I wasn't able to get to any "hand solvable" solution : if I were able to bring it down to some quadratic equation, that would be nice, since it is a common assumption, here, that everybody has seen the "general formula for solving quadratic equations" in school and so would be able to solve this, I may then see how it is seen as a funny riddle in the newspaper.

My best trial, with "just" a cubic equation, is way too complicated for the normal readers of this newspaper, so it's bugging me.

What am I missing? Some basic properties maybe? It's really bugging me, not being able to solve this without Wolfram.


Let $|FB|=x$. By similarity of triangles we then have $|CE|=1/x$. Pythagoras thus gives $$ 4=\sqrt{x^2+1}+\sqrt{1+(1/x)^2}=\sqrt{x^2+1}(1+\frac1x). $$ Squaring this gives us $$ 16=(x^2+1)(1+\frac2x+\frac1{x^2}), $$ but I prefer to move one factor $x$ from the former factor on r.h.s. to the latter, so $$ 16=(x+\frac1x)(x+2+\frac1x). $$ Getting warmer! Write $u=x+1/x$. We can solve $u$ from the quadratic $$ 16=u(u+2), $$ and then solve for $x$ from the equation $$ x+\frac1x=u. $$


It is clear to discard the negative possibility for $u$. For the positive value of $u$ the two solutions for $x$ are reciprocals of each other. They correspond to "physical" solutions gotten from each other by reflecting the entire picture w.r.t. the diagonal $AD$ at 45 degree with the floor.


EDIT (5.5 years later!)

Had I known my solution would be featured in the video "Ladder and Box Problem" on Presh Talwalkar's "Mind Your Decisions" YouTube channel (thanks, Presh!), I would've made another pass.

Shunting the original solution to this answer's edit history, here's something of a streamlined presentation.


From a length-$b$ ladder resting against a side-$r$ box, we can make the following diagram:

enter image description here

Then we have:

$$\left(\;\color{green}{p + q + r} \;\right)^2 = \color{blue}{b}^2 + \color{red}{r}^2 \qquad\to\qquad p + q + r = \sqrt{b^2 + r^2} \tag{1}$$

(discarding the negative root). The semicircle recalls the classical construction of the geometric mean, and we have $$pq=r^2 \tag{2}$$

Now, $p$ and $q$ are the roots of the quadratic $$0 \;=\; (x-p)(x-q) \;=\;x^2 - (p+q)x + p q \;=\; x^2 - (-r + \sqrt{b^2+r^2})x + r^2 \tag{3}$$

Solving yields

$$\{p,q\} = \frac12 \left(-r + \sqrt{b^2 + r^2} \pm \sqrt{ b^2 - 2 r^2 - 2 r \sqrt{b^2 + r^2}} \right) \tag{$\star$}$$

For $r=1$ and $b=4$, this gives

$$\{p,q\} = \frac12 \left(-1 + \sqrt{17} \pm \sqrt{ 14 - 2\sqrt{17}} \right)$$

Calculating the "bigger cathetus" from this is left as an exercise to the reader.


Consider the equation of the line that the ladder makes:

$$\mathcal{l} = \{ (x, y) ~:~ y = mx + h \}$$

where $h$ is the height of the ladder on the wall and $m$ is the slope of the ladder. We know that $(1, 1)$ is on the line, so

$$1 = m + h$$

And we know that the distance from the x-intersecpt to the y-intersept is $4$. So

$$h^2 + (-h/m)^2 = 4^2$$

So solve the last 2 equations for $h$:

$$h^2 + \left(\frac{h}{1-h}\right)^2 = 4^2$$ $$h^4 - 2h^3 - 14 h^2 + 32h - 16 = 0$$

So the problem is a quartic. It doesn't really have a simple answer (what was this newspaper thinking?), but the one you want is:

$$h = \frac{ \sqrt{14 - 2 \sqrt{17}} + \sqrt{17} + 1 } {2} \approx 3.76$$