I’m reading a structural mechanics book and it’s going over boundary value problems and needs to develop the calculus of variations for this purpose. So, it states:

Define G(g,a,b,u)= integral from 0 to l of g(x)u(x)dx +au(0)+bu(l)

If G(g,a,b,y)=0 for all u(x), then g(x)=0, a=b=0

It starts the proof of the previous statement considering the subset of functions u for which u(0)=u(l)=0. Then the integral of g(x)u(x) must equal zero. If you let u(x)=g(x) (since the theorem must hold for all u), then the integral of g^2dx=0 only holds for g(x)=0.

I follow this. However, the next part relaxes the assumption that u(l)=0. The book then states “since we have already proved that g(x)=0, we have a*u(0)=0…” But didn’t we only prove that g(x)=0 when u(0)=u(l)=0? Why can we say that g(x)=0 when we relax that restriction?

It’s not actually relaxing a restriction; it’s relaxing a restriction on the assumptions, which actually makes the assumptions stronger.

Think of it as two statements to be proved. The first is

“If G(g,a,b,u)=0 for all u(x) such that u(0)=u(l)=0, then g(x)=0.”

and you proved this by taking u=g (here you must use the assumption that g(0)=g(l)=0, which you didn’t give explicitly, so that g is an allowed value of u). The second statement is

“If G(g,a,b,u)=0 for all u(x), then g(x)=0 and a=b=0.”

This is a stronger assumption than in the first statement–the set of u for which we require G=0 in this second statement is strictly larger, since it now includes functions with nonzero endpoints. In particular, we’ve already proved that g=0 using the smaller set of u for which u(0)=u(l)=0, so we still must have g=0. Thus G(g,a,b,u)=au(0)+bu(l).

Why do we have g=0 for any u other than a u that is equal to zero at the end points? It sounds to me like the book is saying “A+Bx=0. Assume X is zero, therefore proving A is zero. Ok, relax that assumption. Now we already have A is zero, so the equation is Bx=0, so B also has to be zero.”

The first part deals with a subset of u(x) - specifically those that meet u(0) = u(l) = 0. For G(g,a,b,y)=0 to hold, we require that g(x) be zero.

Then, we remove the restriction on u(x). We still have g(x) = 0, because this generalized u(x) still includes those functions for which u(0) = u(l) = 0. However it also includes functions for which u(0) and u(l) are not zero - therefore we require a=b=0.

Your example isn’t equivalent because x isn’t a function. A better one would be:

Consider A* g(x) + B * g(0) = 0 for any function g(x). First, consider that some g(x) will have g(0) = 0. Therefore, A must be 0 for the equation to hold for these g(x). Now, since A is zero, consider g(x) for which g(0) =/= 0. Now we can show that B must also be zero for the equation to hold for all g(x).

Actually, your example holds as well if you want it to be true for all possible values of x. Right?

The only equation of the form A + Bx = 0 that is true for all values of x is 0 + 0 * x = 0.

And the proof is exactly as you describe. First consider x = 0. This immediately leads to A = 0. Now consider non-zero values of x. Since A is zero this requires B = 0.

g is an unknown but fixed function, which you are trying to find (along with a and b). Using u=g lets you show that g=0.

This is a reasonable analogy, but you’re thinking about it wrong. Let’s make it precise. The statement is

“Suppose A+Bx=0 for all x. Prove that A=B=0.”

(again, A and B are unknown but fixed values, to be found), and your proof can be,

Since A+Bx=0 for all x, in particular it is true for x=0: A=A+B0=0. So A=0. And it is also true for x=1: A+B=A+B1=0. But we already know that A=0, so also B=0.

Note that you’re not assuming that x=0 in the first sentence of your proof. You are told that the statement A+Bx=0 is true for all x; you’re just using one of the values for which the statement is true, to derive some conditions on the variables. If you like you can consider the statement “A+Bx=0 for all x” to be an infinite set of statements:
A+B0=0
A+B1=0
A+B2.5=0
A+B3.14159=0
…
and your goal is just to use all of these equations to find A and B.

Similarly in your problem you have been given a bunch of statements:
G(g(x),a,b,1)=0
G(g(x),a,b,x)=0
G(g(x),a,b,g(x))=0
… (and so on, with every legal value of u inserted) …
Your goal is to find g(x), a, and b. You can use the third statement to show g(x)=0; then you can use other statements to find a and b.