Integration by parts and the zero endpoint values turn the Rayleigh quotient into a positive kinetic energy integral:
This is the parabolic variational trial for a particle in a box. The potential energy vanishes inside the box.