# Lagrange's identity (boundary value problem)

In the study of ordinary differential equations and their associated boundary value problems in mathematics, Lagrange's identity, named after Joseph Louis Lagrange, gives the boundary terms arising from integration by parts of a self-adjoint linear differential operator. Lagrange's identity is fundamental in Sturm–Liouville theory. In more than one independent variable, Lagrange's identity is generalized by Green's second identity.

## Statement

In general terms, Lagrange's identity for any pair of functions u and v in function space C$^2$ (that is, twice differentiable) in n dimensions is: $vL[u]-uL^{*}[v]=\nabla \cdot {\boldsymbol {M}},$ where: $M_{i}=\sum _{j=1}^{n}a_{ij}\left(v{\frac {\partial u}{\partial x_{j}}}-u{\frac {\partial v}{\partial x_{j}}}\right)+uv\left(b_{i}-\sum _{j=1}^{n}{\frac {\partial a_{ij}}{\partial x_{j}}}\right),$ and $\nabla \cdot {\boldsymbol {M}}=\sum _{i=1}^{n}{\frac {\partial }{\partial x_{i}}}M_{i},$
The operator L and its adjoint operator L$^*$ are given by: $L[u]=\sum _{i,\ j=1}^{n}a_{i,j}{\frac {\partial ^{2}u}{\partial x_{i}\partial x_{j}}}+\sum _{i=1}^{n}b_{i}{\frac {\partial u}{\partial x_{i}}}+cu$ and $L^{*}[v]=\sum _{i,\ j=1}^{n}{\frac {\partial ^{2}(a_{i,j}v)}{\partial x_{i}\partial x_{j}}}-\sum _{i=1}^{n}{\frac {\partial (b_{i}v)}{\partial x_{i}}}+cv.$
If Lagrange's identity is integrated over a bounded region, then the divergence theorem can be used to form Green's second identity in the form: $\int _{\Omega }vL[u]\,d\Omega =\int _{\Omega }uL^{*}[v]\ d\Omega +\int _{S}{\boldsymbol {M\cdot n}}\,dS,$
where S is the surface bounding the volume Ω and n is the unit outward normal to the surface S.

### Ordinary differential equations

Any second order ordinary differential equation of the form: $a(x){\frac {d^{2}y}{dx^{2}}}+b(x){\frac {dy}{dx}}+c(x)y+\lambda w(x)y=0,$ can be put in the form: ${\frac {d}{dx}}\left(p(x){\frac {dy}{dx}}\right)+\left(q(x)+\lambda w(x)\right)y(x)=0.$
This general form motivates introduction of the Sturm–Liouville operator L, defined as an operation upon a function f such that: $Lf={\frac {d}{dx}}\left(p(x){\frac {df}{dx}}\right)+q(x)f.$
It can be shown that for any u and v for which the various derivatives exist, Lagrange's identity for ordinary differential equations holds: $uLv-vLu=-{\frac {d}{dx}}\left[p(x)\left(v{\frac {du}{dx}}-u{\frac {dv}{dx}}\right)\right].$
For ordinary differential equations defined in the interval [0, 1], Lagrange's identity can be integrated to obtain an integral form (also known as Green's formula): $\int _{0}^{1}dx\ (uLv-vLu)=\left[p(x)\left(u{\frac {dv}{dx}}-v{\frac {du}{dx}}\right)\right]_{0}^{1},$
where $p=P(x)$, $q=Q(x)$, $u=U(x)$ and $v=V(x)$ are functions of $x$. $u$ and $v$ having continuous second derivatives on the interval $[0,1]$.

### Proof of form for ordinary differential equations

We have: $uLv=u\left[{\frac {d}{dx}}\left(p(x){\frac {dv}{dx}}\right)+q(x)v\right],$ and $vLu=v\left[{\frac {d}{dx}}\left(p(x){\frac {du}{dx}}\right)+q(x)u\right].$
Subtracting: $uLv-vLu=u{\frac {d}{dx}}\left(p(x){\frac {dv}{dx}}\right)-v{\frac {d}{dx}}\left(p(x){\frac {du}{dx}}\right).$
The leading multiplied u and v can be moved inside the differentiation, because the extra differentiated terms in u and v are the same in the two subtracted terms and simply cancel each other. Thus, ${\begin{aligned}uLv-vLu&={\frac {d}{dx}}\left(p(x)u{\frac {dv}{dx}}\right)-{\frac {d}{dx}}\left(vp(x){\frac {du}{dx}}\right),\\&={\frac {d}{dx}}\left[p(x)\left(u{\frac {dv}{dx}}-v{\frac {du}{dx}}\right)\right],\end{aligned}}$ which is Lagrange's identity. Integrating from zero to one: $\int _{0}^{1}dx\ (uLv-vLu)=\left[p(x)\left(u{\frac {dv}{dx}}-v{\frac {du}{dx}}\right)\right]_{0}^{1},$ as was to be shown.