Clarification on Euler-Lagrange equation derivation

Below is extracted from page 8 of https://courses.maths.ox.ac.uk/node/view_material/44170:

I have an issue with the line: "It is easy to see that this means both terms on the RHS must vanish...". I.e. I don't see why the first term of the RHS can't just be the negative of the other.

• This is supposed to be true for all functions $\eta$ so what happens to the first term when $\eta (a)=\eta (b) = 0$ but arbitrary otherwise? – AHusain Dec 11 '19 at 2:11
• @AHusain The assumptions that $\eta (a)=\eta (b) = 0$ only comes after the above extract - this is what confuses me. Is this statement true: The Euler-Langrange equation is necessarily give a extremal function when fixed/natural boundary conditions are set. – helios321 Dec 11 '19 at 2:41

1. Assume that $$y$$ is stationary so that LHS. of eq. (15) vanishes.
2. Start by considering $$\eta$$ that vanishes on the boundary. Then the first term on the RHS. of eq. (15) vanish. From the fundamental lemma of calculus of variations, it follows from that the Euler-Lagrange (EL) equations are satisfies on the open interval $$]a,b[$$, which by continuity can be extended to the closed interval $$[a,b]$$.
3. Consider next $$\eta$$ that not necessarily vanishes at $$x=a$$ but vanishes at $$x=b$$. However, the second term on the RHS. of eq. (15) is still zero, cf. part 2. Therefore the first term must vanish as well. This can only happen in $$2$$ ways:
1. fixed endpoint/essential/Dirichlet boundary condition at $$x=a$$, or
2. natural boundary condition at $$x=a$$.
4. There is a similar conclusion for the boundary condition at $$x=b$$. $$\Box$$