So I decided to use the Euler Lagrange equations:Find solutions of the Euler-Lagrange equations for critical points of the following functionals with the given endpoint conditions.

where and

and

Inputting this into the Euler-Lagrange equations gives:

So integrating both sides w.r.t x gives where is a positive constant.

From here I was expecting to use the conditions on y to work out what A is. Unfortunately this doesn't work! y can't equal a constant and yet change from 1 to 2 as described in the conditions.

What's going wrong?