Actually, this should be

but you seem to have computed the correct expression here:

On the face of it, it doesn't surprise me that the term with drops out. After all,

So the problem reduces down to finding the extremal of

subject to the boundary conditions. Since there is now no term, the Euler-Lagrange equation simplifies down to setting

which implies

or as before. And, as you've noted, this function does not satisfy the boundary conditions.

Question: what is the domain of functions over which you're searching for a solution? Continuous? Differentiable? (I would assume probably differentiable, since you have a in the integrand; however, you might be interpreting that derivative in a weak sense, or in some other similarly exotic fashion.)

If you require a differentiable function as your solution, then I would say your problem has no solution.