Somewhat unusual projectile motion question

The problem is kind of hard to solve if one is not careful. One can write the satisfying equations but still might not be able to find the answer. I will outline a way to this.

The idea is that at the minimum required velocity the projectile just touches the top of the walls. Let the velocity and angle of projection at the origin be $v_0$ and $\theta _0$. From the origin the projectile goes and touches the top of the first wall. You can view the rest of its motion as a projectile projected from the top of the first wall with velocity $v_1$ at an angle $\theta_1$(both are unknown at this point). The following relation holds $$ v_1 ^2 = v_0 ^2 -2gh_1.$$ Define $\sin(\phi) = \frac{h_2 - h_1}{L}$. The projectile should now go and touch the top of the second wall which means w.r.t the new origin it must pass through the point $(L cos(\phi), h_2 - h_1)$. You can plug this in to the equation of projectile parabola to get.

$$h_2 - h_1 = \tan(\theta_1)[L\cos(\phi)] - \frac{gL^2\cos^2(\phi)}{2(v_0^2 -2gh_1)\cos^2(\theta_1)}$$.

Now rearrange this and write $v_0$ in terms of $\theta_1$. Everything else are parameters given in the question. Use calculus to minimize the value of $v_0$. You'll get the answer. Let me know if anything is not clear.


Interesting question.

Here's an alternative approach using a symmetrical relationship involving launch and terminal velocities that I found, which helps simplify the solution.

$\hspace{4cm}$enter image description here

Let $u,v,w$ be velocities at launch, at the first wall and at the second wall respectively. Let $k$ be the horizontal distance between the two walls. Hence $k^2=L^2-(h_2-h_1)^2$.

Squaring equation $(1)$ here (${v^*}{w^*}=gk$) for minimum velocities (omitting $^*$ for minimum velocities for clarity of notation) and using the standard energy conservation/kinematics formula $V^2=U^2+2AS$ gives

$$\begin{align} v^2w^2&=g^2k^2\\ (u^2-2gh_1)(u^2-2gh_2)&=g^2 \big(L^2-(h_2-h_1)^2\big)\\ u^4-2g(h_1+h_2)u^2+4gh_1h_2+g^2(h_2-h_1)^2&=g^2L^2\\ u^4-2g(h_1+h_2)u^2+g^2(h_1+h_2)^2&=g^2L^2\\ \big(u^2-g(h_1+h_2)\big)^2&=g^2L^2\\ u^2-g(h_1+h_2)&=gL\\ \text{Minimum launch velocity, }\;\;\;\;\;\;\color{red}u&\color{red}{=\sqrt{g(h_1+h_2+L)}} \end{align}$$

No trigonometric ratios or calculus.


Alternatively, using the results here, and omitting $^*$ for minimum velocities for clarity of notation, $${v}^2=g(L+H-h)\qquad $$ Using conservation of energy, $$\begin{align} {u}^2 &={v}^2+2gh\\ &=g(L+H-h)+2gh\\ &=g(L+H+h)\\ &=g(L+h_1+h_2)\\ \color{red}u&\color{red}{=\sqrt{g(h_1+h_2+L)}}\end{align}$$