Intuitive explanation for formula of maximum length of a pipe moving around a corner? For one of my homework problems, we had to try and find the maximum possible length $L$ of a pipe (indicated in red) such that it can be moved around a corner with corridor lengths $A$ and $B$ (assuming everything is 2d, not 3d):

My professor walked us through how to derive a formula for the maximum possible length of the pipe, ultimately arriving at the equation $L = (A^{2/3} + B^{2/3})^{3/2}$.
The issue I have is understanding intuitively why this formula works, and exactly what it's doing. I understand the steps taken to get to this point, but there's an odd symmetry to the end result -- for example, is the fact that $\frac{2}{3}$ and its inverse are the only constants used just a coincidence, or indicative of some deeper relationship?
I also don't quite understand how the formula relates, geometrically, to the diagram. If I hadn't traced the steps myself, I would have never guessed that the formula was in any way related to the original problem.
If possible, can somebody give an intuitive explanation as to why this formula works, and how to interpret it geometrically?

Here's how he found the formula, if it's useful:
The formula is found by finding the maximum possible length of the pipe by expressing the length in terms of the angle $\theta$ formed between the pipe and the wall, and by taking the derivative to find when $\frac{dL}{d\theta} = 0$, which is the minimum of $\frac{dL}{d\theta}$ and is therefore when $L$ is the smallest:
$$
L = \min_{0 \leq \theta \leq \frac{\pi}{2}} \frac{A}{\cos{\theta}} + \frac{B}{\sin{\theta}} \\
0 = \frac{dL}{d\theta} = \frac{A\sin{\theta}}{\cos^2{\theta}} - \frac{B\cos{\theta}}{\sin^2{\theta}} \\
0 = \frac{A\sin^3{\theta} - B\cos^3{\theta}}{\sin^2{\theta}\cos^2{\theta}} \\
0 = A\sin^3{\theta} - B\cos^3{\theta} \\
\frac{B}{A} = \tan^3{\theta} \\
\theta = \arctan{\left( \frac{B}{A} \right)^{\frac{1}{3}}} \\
$$
At this point, we can substitute $\theta$ back into the original equation for $L$ by interpreting $A^{1/3}$ and $B^{1/3}$ as sides of a triangle with angle $\theta$ and hypotenuse $\sqrt{A^{2/3} + B^{2/3} }$:
$$
\cos{\theta} = \frac{A^{1/3}}{ \sqrt{A^{2/3} + B^{2/3} }} \\
\sin{\theta} = \frac{B^{1/3}}{ \sqrt{A^{2/3} + B^{2/3} }} \\
\therefore L = A^{2/3} \sqrt{A^{2/3} + B^{2/3} } + B^{2/3} \sqrt{A^{2/3} + B^{2/3} } \\
L = (A^{2/3} + B^{2/3}) \sqrt{A^{2/3} + B^{2/3} } \\
L = (A^{2/3} + B^{2/3})^{3/2} \\
$$
The equation for the formula for the maximum length of the pipe is therefore $L = (A^{2/3} + B^{2/3})^{3/2}$. 

Here's a derivation without trigonometry.
There is also a short discussion of the geometric significance
of the exponents in the answer after the derivation.

Let $L$ be the length of a line touching the inner corner of the
two corridors and extending to the outer wall of each corridor.
Where this line meets the outer wall of each corridor, draw a line
perpendicular to the corridor.
Let $x$ be the distance from the inner corner to the perpendicular line
across corridor $B$
and let $y$ be the distance from the inner corner to the perpendicular line
across corridor $A$.
The result is the figure shown above.
Applying the Pythagorean Theorem to the obvious
right triangle with hypotenuse $L$,
$$ L^2 = (A + x)^2 + (B + y)^2.$$
The longest pipe that can fit around the corner is the smallest
value of $L$ for any value $x > 0$, so let's minimize $L$ as a function of $x$.
But $L$ is minimized when $L^2$ is minimized, so we would like to set
$$ \frac{d}{dx} L^2 = 0. $$
That is,
$$\begin{eqnarray}
0 = \frac{d}{dx} L^2 &=& \frac{d}{dx}\left((A + x)^2 + (B + y)^2\right) \\
&=& 2(A + x) + 2(B + y)\frac{dy}{dx}.
\end{eqnarray}$$
Now, by similar triangles,
$ \dfrac Bx = \dfrac yA .$
That is, $xy = AB.$ Differentiating both sides of this by $x$,
$$ x\frac{dy}{dx} + y = 0,$$
$$ \frac{dy}{dx} = -\frac yx.$$
Substituting for $\frac{dy}{dx}$ in our earlier equation for $\frac{d}{dx}L^2,$
$$ 0 = 2(A + x) + 2(B + y)\left(-\frac yx\right),$$
from which it follows that
$$ (A + x)x = (B + y)y,$$
But (again by similar triangles)
$$ \frac Bx = \frac{B+y}{A+x},$$
$$ B+y = \frac Bx (A+x),$$
and combining this with the fact that $y = \dfrac{AB}{x},$
$$ (B + y)y = \left(\frac Bx (A+x)\right) \frac{AB}{x}
  = \frac{AB^2}{x^2}(A + x).$$
That is,
$$ (A + x)x = \frac{AB^2}{x^2}(A + x),$$
$$ x^3 = AB^2,$$
$$ x = A^{1/3}B^{2/3},$$
$$ y = \frac{AB}{x} = A^{2/3}B^{1/3},$$
$$A + x = A + A^{1/3}B^{2/3} = \left(A^{2/3} + B^{2/3} \right)A^{1/3},$$
and $$B + y = B + A^{2/3}B^{1/3} = \left(A^{2/3} + B^{2/3} \right)B^{1/3}.$$
Therefore at the value of $x$ that minimizes $L$,
$$\begin{eqnarray}
L^2 &=& (A + x)^2 + (B + y)^2 \\
&=& \left(A^{2/3} + B^{2/3} \right)^2 A^{2/3} +
     \left(A^{2/3} + B^{2/3} \right)^2 B^{2/3} \\
&=& \left(A^{2/3} + B^{2/3} \right)^2 \left(A^{2/3} + B^{2/3}\right) \\
&=& \left(A^{2/3} + B^{2/3} \right)^3
\end{eqnarray}$$ 
and
$$ L = \left(A^{2/3} + B^{2/3} \right)^{3/2}.$$

Regarding the symmetry of the solution, clearly the length of the pipe
does not change if we swap the labels $A$ and $B$ on the two corridors.
We should suspect from this that there might be some expression for
$L$ in which $A$ and $B$ appear in completely symmetric roles.
Regarding the geometric interpretation of the exponents, the key facts
that lead to the $\frac23$ exponents are the findings that $x^3 = AB^2$
and (by symmetry) $y^3 = BA^2.$
This is what leads to the conclusion that $L$ is the hypotenuse of a
right triangle with legs $A + A^{1/3}B^{2/3}$ and $B + B^{1/3}A^{2/3}$;
it is from the squares of those two lengths that we get terms
in $A^{2/3}$ and $B^{2/3}$.
Finally, note that if we double both $A$ and $B$ simultaneously,
we should expect the entire figure showing the "tightest" angle
of the pipe around the corner to scale up by a factor of $2$,
hence $L$ also doubles.
But we see that $A^{2/3}$ and $B^{2/3}$ scale up only by a factor
of $2^{2/3}$ when we double $A$ and $B$; it is the exponent of $\frac32$
outside the parentheses that gives us a scaling factor
of $\left(2^{2/3}\right)^{3/2} = 2.$
So it is not a mere coincidence that the exponents $\frac23$ and $\frac32$
are multiplicative inverses.

Another way to approach this is to apply the fact that
$B+y = \dfrac Bx (A+x)$
before differentiating $L^2$ rather than afterwards.
That is, we simply substitute for $B+y$ in the formula for $L^2$,
obtaining
$$\begin{eqnarray}
 L^2 &=& (A + x)^2 + \frac{B^2}{x^2}(A + x)^2 \\
&=& \left(1 + \frac{B^2}{x^2}\right) (A + x)^2.
\end{eqnarray}$$
We can differentiate this with respect to $x$ to obtain an analytic solution,
or apply numeric methods using $x$ as an independent variable.
