To treat this problem in a somewhat general manner, let us assume that y's boundary values are fixed, say
y(a)=y_{a},y(b)=y_{b}
We look then at the set of comparison functions:
Y(x,\epsilon)=y(x)+\epsilon\gamma(x),\gamma(a)=\gamma(b)=0
That is, the \gamma-function is arbitrary except for vanishing at the boundaries.
We have a functional,
F(\epsilon)=\frac{\int_{a}^{b}N(Y,Y^{,},x)dx}{\int_{a}^{b}D(Y,Y^{,},x)dx}
and also define the quantities:
n=\int_{a}^{b}N(y,y^{,},x)dx, d=\int_{a}^{b}D(y,y^{,},x)dx (*)
Now, differentiating F with respect to \epsilon and then setting thederivative of F equal to 0 at \epsilon=0 yields, with some rearrangement:
\frac{\int_{a}^{b}(d(\frac{\partial{N}}{\partial{y}}-\frac{d}{dx}\frac{\partial{N}}{\partial{y^{,}}})-n(\frac{\partial{D}}{\partial{y}}-\frac{d}{dx}\frac{\partial{D}}{\partial{y^{,}}}))\gamma(x)dx}{d^{2}}=0
Thus, we get the following diff.eq problem to solve:
d(\frac{\partial{N}}{\partial{y}}-\frac{d}{dx}\frac{\partial{N}}{\partial{y^{,}}})-n(\frac{\partial{D}}{\partial{y}}-\frac{d}{dx}\frac{\partial{D}}{\partial{y^{,}}})=0, y(a)=y_{a},y(b)=y_{b}
The solution of this diff.eq problem will typically be a function of the two parameters d and n, (in addition of course, of being a function in x)!
In order to determine d and n, (*) represents a system of algebraic equations in d and n, so we solve this system to complete our solution.