Variational Methods
The basic problem of the calculus of variations is to determine the function  that extremizes a functional
 that extremizes a functional  . In general, there can be more than one independent variable and the integrand
. In general, there can be more than one independent variable and the integrand  can depend on several functions and their higher derivatives.
 can depend on several functions and their higher derivatives. 
The extremal functions are solutions of the Euler(–Lagrange) equations that are obtained by setting the first variational derivatives of the functional  with respect to each function equal to zero. Since many ordinary and partial differential equations that occur in physics and engineering can be derived as the Euler equations for appropriate functionals, variational methods are of general utility.
 with respect to each function equal to zero. Since many ordinary and partial differential equations that occur in physics and engineering can be derived as the Euler equations for appropriate functionals, variational methods are of general utility. 
| VariationalD[f,u[x],x],VariationalD[f,u[x,y,…],{x,y,…}] | |
| give the first variational derivative of the functional  defined by the integrand f, where f depends on one function u and one independent variable x or several independent variables x, y, … | |
| VariationalD[f,{u[x,y,…],v[x,y,…],…},{x,y,…}] | |
| give a list of the first variational derivatives of the functional  defined by the integrand f, where f depends on several functions u, v, … and several independent variables x, y, … | |
| EulerEquations[f,u[x],x],EulerEquations[f,u[x,y,…],{x,y,…}] | |
| give the Euler equation for the integrand f, where f depends on one function u and one independent variable x or several independent variables x, y, … | |
| EulerEquations[f,{u[x,y,…],v[x,y,…],…},{x,y,…}] | |
| give a list of the Euler equations for the integrand f, where f depends on several functions u, v, … and several independent variables x, y, … | |
First variational derivatives and Euler equations.
VariationalD gives the first variational derivatives of a functional  defined by the integrand
 defined by the integrand  .
.  may depend on several functions u, v, w, …; their derivatives of arbitrary order; and variables x, y, z, …. EulerEquations returns the Euler(–Lagrange) equations given the integrand
 may depend on several functions u, v, w, …; their derivatives of arbitrary order; and variables x, y, z, …. EulerEquations returns the Euler(–Lagrange) equations given the integrand  . Again,
. Again,  may depend on several functions u, v, w, …; their derivatives of arbitrary order; and variables x, y, z, ….
 may depend on several functions u, v, w, …; their derivatives of arbitrary order; and variables x, y, z, …. 
| FirstIntegrals[f,u[x],x],FirstIntegrals[f,{u[x],v[x],…},x] | |
| give first integrals when the integrand f is independent of one or more of {u[x],v[x],…}, or independent of x | |
| FirstIntegral[u] | first integral associated with the variable u (appears in the output of FirstIntegrals) | 
When there is only one independent variable x, FirstIntegrals gives conserved quantities in the following cases: (1) if f does not depend on a coordinate u explicitly, it is referred to as an ignorable coordinate and the corresponding Euler equation possesses an obvious first integral (a conserved generalized momentum), and (2) if f depends on u, v, … and their first derivatives only and has no explicit x dependence, FirstIntegrals also returns the first integral corresponding to the Hamiltonian.
 (angular momentum conservation) and is independent of time
 (angular momentum conservation) and is independent of time  (energy conservation). FirstIntegrals yields both the first integral corresponding to coordinate
 (energy conservation). FirstIntegrals yields both the first integral corresponding to coordinate  and the first integral corresponding to the Hamiltonian.
 and the first integral corresponding to the Hamiltonian. The Ritz variational principle affords a powerful technique for the approximate solution of (1) eigenvalue problems  where
 where  is an operator and
 is an operator and  is a weight function and (2) problems of the form
 is a weight function and (2) problems of the form  where
 where  is a positive definite operator and
 is a positive definite operator and  is given. A judicious choice for the trial function
 is given. A judicious choice for the trial function  that satisfies boundary conditions and depends on variational parameters
 that satisfies boundary conditions and depends on variational parameters  ,
,  , ... must be given in both cases. For (1) VariationalBound[{f,g},u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,amin,amax},{b,bmin,bmax},…] extremizes
, ... must be given in both cases. For (1) VariationalBound[{f,g},u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,amin,amax},{b,bmin,bmax},…] extremizes  where
 where  and
 and  . The result is an upper bound on the corresponding eigenvalue and optimal values for the parameters. For (2) VariationalBound[f,u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,amin,amax},{b,bmin,bmax},…] extremizes the functional
. The result is an upper bound on the corresponding eigenvalue and optimal values for the parameters. For (2) VariationalBound[f,u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,amin,amax},{b,bmin,bmax},…] extremizes the functional  with
 with  and yields the value of the functional and the optimal parameters. VariationalBound can also be used to extremize general functionals given appropriate trial functions. NVariationalBound performs the same functions as VariationalBound numerically. It uses the internal function FindMinimum and has the same options and input format for parameters.
 and yields the value of the functional and the optimal parameters. VariationalBound can also be used to extremize general functionals given appropriate trial functions. NVariationalBound performs the same functions as VariationalBound numerically. It uses the internal function FindMinimum and has the same options and input format for parameters. 
| VariationalBound[{f,g},u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,amin,amax},{b,bmin,bmax},…] | |
| give an upper bound for the eigenvalue and the optimal values of a, b, … in the range {{amin,amax},{bmin,bmax},…} | |
| VariationalBound[f,u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,amin,amax},{b,bmin,bmax},…] | |
| give the value of the functional and optimal values of a, b, … | |
| NVariationalBound[{f,g},u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,a0,amin,amax},{b,b0,bmin,bmax},…] | |
| evaluate numerically an upper bound for the eigenvalue and the optimal values of a, b, … in the range {{amin,amax},{bmin,bmax},…} given initial values a0, b0, ... | |
| NVariationalBound[f,u[x,y,…],{{x,xmin,xmax},{y,ymin,ymax},…},ut,{a,a0,amin,amax},{b,b0,bmin,bmax},…] | |
| evaluate numerically the value of the functional and optimal values of a, b, … given initial values a0, b0, … | |
 state of the hydrogen atom with one node at
 state of the hydrogen atom with one node at  yields the exact energy in units of Rydberg. Note that the volume element
 yields the exact energy in units of Rydberg. Note that the volume element  is included in functional parameters
 is included in functional parameters  and
 and  , and the default range for the parameters is
, and the default range for the parameters is  .
.  where
 where  vanishes on the boundary. VariationalBound gives optimal values of parameters for the approximate solution.
 vanishes on the boundary. VariationalBound gives optimal values of parameters for the approximate solution.  and the initial values are specified.
 and the initial values are specified. 
