Fundamental lemma of variational calculus in beam theory

I'm following the derivation of Timoshenko beam equation on Wikipedia.

At one point we arrive at the following:

$$\int_L \left[\left(\frac{\partial M_{xx}}{\partial x} - Q_x\right)~\delta\varphi - \left(\frac{\partial Q_{x}}{\partial x} + q\right)~\delta w\right]~\mathrm{d}L = 0$$

where the integral is taken along the length $$L$$ of the beam. The moment $$M_{xx}$$, the shear force $$Q_{x}$$ and the variations on the beam angle and deflection, $$\delta \varphi$$ and $$\delta w$$, are functions of $$x$$.

Then:

The governing equations for the beam are, from the fundamental theorem of variational calculus,

$$\frac{\partial M_{xx}}{\partial x} - Q_x = 0 ~;~~ \frac{\partial Q_{x}}{\partial x} + q = 0$$

I know the fundamental theorem/lemma of variational calculus is: If a smooth function $$f(x)$$ satisfies the following formula for any $$h(x)$$ with certain properties on the interval between $$a$$ and $$b$$, then $$f(x)=0$$.

$${\displaystyle \int _{a}^{b}f(x)h(x)\,\operatorname {d} x=0}$$

But how does this lemma apply in the case of the beam equation derivation? If we compare the first equation to the last, what are the functions $$f(x)$$ and $$h(x)$$ of the fundamental lemma, in the first equation? In the first equation we have two functions $$\frac{\partial M_{xx}}{\partial x} - Q_x$$ and $$\frac{\partial Q_{x}}{\partial x} + q$$, both independently found to equal zero. So how did we just use the fundamental lemma, dealing with only one function, to the first equation that is an expression dealing with two functions?

If two smooth functions $$f$$ and $$g$$ satisfy $$\int [f(x)\phi(x) + g(x)\psi(x)]~dx = 0$$ for all smooth compactly supported functions $$\phi$$ and $$\psi$$, then $$f = 0$$ and $$g=0$$.
This follows easily from the standard version of the fundamental lemma. To see that $$f = 0$$, since the above equation holds for any $$\psi$$ you are free to choose $$\psi = 0$$. Then we find that $$f$$ satisfies $$\int f(x)\phi(x)~dx = 0$$ for any $$\phi$$, so by the fundamental lemma we conclude that $$f = 0$$. Similarly if you set $$\phi = 0$$ you conclude that $$g = 0$$.