# Liouville's formula

In mathematics, Liouville's formula, also known as the Abel–Jacobi–Liouville identity, is an equation that expresses the determinant of a square-matrix solution of a first-order system of homogeneous linear differential equations in terms of the sum of the diagonal coefficients of the system. The formula is named after the French mathematician Joseph Liouville. Jacobi's formula provides another representation of the same mathematical relationship.
Liouville's formula is a generalization of Abel's identity and can be used to prove it. Since Liouville's formula relates the different linearly independent solutions of the system of differential equations, it can help to find one solution from the other(s), see the example application below.

## Statement of Liouville's formula

Consider the n-dimensional first-order homogeneous linear differential equation
    $y'=A(t)y$
on an interval I of the real line, where A(t) for t ∈ I denotes a square matrix of dimension n with real or complex entries. Let Φ denote a matrix-valued solution on I, meaning that Φ(t) is the so-called fundamental matrix, a square matrix of dimension n with real or complex entries and the derivative satisfies
    $\Phi '(t)=A(t)\Phi (t),\qquad t\in I.$
Let
    $\operatorname {tr} A(s)=\sum _{i=1}^{n}a_{i,i}(s),\qquad s\in I,$
denote the trace of A(s) = (a$_{i,j}$(s))$_{i,j∈{1,...,n}}$, the sum of its diagonal entries. If the trace of A is a continuous function, then the determinant of Φ satisfies
    $\det \Phi (t)=\det \Phi (t_{0})\,\exp \left(\int _{t_{0}}^{t}\operatorname {tr} A(s)\,{\textrm {d}}s\right)$
for all t and t$_0$ in I.

## Example application

This example illustrates how Liouville's formula can help to find the general solution of a first-order system of homogeneous linear differential equations. Consider
    $y'=\underbrace {\begin{pmatrix}1&-1/x\\1+x&-1\end{pmatrix}} _{=\,A(x)}y$
on the open interval I = (0, ∞). Assume that the easy solution
    $y(x)={\begin{pmatrix}1\\x\end{pmatrix}},\qquad x\in I,$
is already found. Let
    $y(x)={\begin{pmatrix}y_{1}(x)\\y_{2}(x)\end{pmatrix}}$
denote another solution, then
    $\Phi (x)={\begin{pmatrix}y_{1}(x)&1\\y_{2}(x)&x\end{pmatrix}},\qquad x\in I,$
is a square-matrix-valued solution of the above differential equation. Since the trace of A(x) is zero for all x ∈ I, Liouville's formula implies that the determinant
| $c_{1}:=\det \Phi (x)=x\,y_{1}(x)-y_{2}(x),\qquad x\in I,$ | (1) |
is actually a constant independent of x. Writing down the first component of the differential equation for y, we obtain using (1) that
    $y'_{1}(x)=y_{1}(x)-{\frac {y_{2}(x)}{x}}={\frac {x\,y_{1}(x)-y_{2}(x)}{x}}={\frac {c_{1}}{x}},\qquad x\in I.$
Therefore, by integration, we see that
    $y_{1}(x)=c_{1}\ln x+c_{2},\qquad x\in I,$
involving the natural logarithm and the constant of integration c$_2$. Solving equation (1) for y$_2$(x) and substituting for y$_1$(x) gives
    $y_{2}(x)=x\,y_{1}(x)-c_{1}=\,c_{1}x\ln x+c_{2}x-c_{1},\qquad x\in I,$
which is the general solution for y. With the special choice c$_1$ = 0 and c$_2$ = 1 we recover the easy solution we started with, the choice c$_1$ = 1 and c$_2$ = 0 yields a linearly independent solution. Therefore,
    $\Phi (x)={\begin{pmatrix}\ln x&1\\x\ln x-1&x\end{pmatrix}},\qquad x\in I,$
is a so-called fundamental solution of the system.

## Proof of Liouville's formula

We omit the argument x for brevity. By the Leibniz formula for determinants, the derivative of the determinant of Φ = (Φ$_{i,j}$)$_{i,j∈{0,...,n}}$ can be calculated by differentiating one row at a time and taking the sum, i.e.
| $(\det \Phi )'=\sum _{i=1}^{n}\det {\begin{pmatrix}\Phi _{1,1}&\Phi _{1,2}&\cdots &\Phi _{1,n}\\\vdots &\vdots &&\vdots \\\Phi '_{i,1}&\Phi '_{i,2}&\cdots &\Phi '_{i,n}\\\vdots &\vdots &&\vdots \\\Phi _{n,1}&\Phi _{n,2}&\cdots &\Phi _{n,n}\end{pmatrix}}.$ | (2) |
Since the matrix-valued solution Φ satisfies the equation Φ' = AΦ, we have for every entry of the matrix Φ'
    $\Phi '_{i,k}=\sum _{j=1}^{n}a_{i,j}\Phi _{j,k}\,,\qquad i,k\in \{1,\ldots ,n\},$
or for the entire row
    $(\Phi '_{i,1},\dots ,\Phi '_{i,n})=\sum _{j=1}^{n}a_{i,j}(\Phi _{j,1},\ldots ,\Phi _{j,n}),\qquad i\in \{1,\ldots ,n\}.$
When we subtract from the i-th row the linear combination
    $\sum _{\scriptstyle j=1 \atop \scriptstyle j\neq i}^{n}a_{i,j}(\Phi _{j,1},\ldots ,\Phi _{j,n}),$
of all the other rows, then the value of the determinant remains unchanged, hence
    $\det {\begin{pmatrix}\Phi _{1,1}&\Phi _{1,2}&\cdots &\Phi _{1,n}\\\vdots &\vdots &&\vdots \\\Phi '_{i,1}&\Phi '_{i,2}&\cdots &\Phi '_{i,n}\\\vdots &\vdots &&\vdots \\\Phi _{n,1}&\Phi _{n,2}&\cdots &\Phi _{n,n}\end{pmatrix}}=\det {\begin{pmatrix}\Phi _{1,1}&\Phi _{1,2}&\cdots &\Phi _{1,n}\\\vdots &\vdots &&\vdots \\a_{i,i}\Phi _{i,1}&a_{i,i}\Phi _{i,2}&\cdots &a_{i,i}\Phi _{i,n}\\\vdots &\vdots &&\vdots \\\Phi _{n,1}&\Phi _{n,2}&\cdots &\Phi _{n,n}\end{pmatrix}}=a_{i,i}\det \Phi$
for every i ∈ {1, . . . , n} by the linearity of the determinant with respect to every row. Hence
| $(\det \Phi )'=\sum _{i=1}^{n}a_{i,i}\det \Phi =\mathrm {tr} \,A\,\det \Phi$ | (3) |
by (2) and the definition of the trace. It remains to show that this representation of the derivative implies Liouville's formula.
Fix x$_0$ ∈ I. Since the trace of A is assumed to be continuous function on I, it is bounded on every closed and bounded subinterval of I and therefore integrable, hence
    $g(x):=\det \Phi (x)\exp \left(-\int _{x_{0}}^{x}\mathrm {tr} \,A(\xi )\,{\textrm {d}}\xi \right),\qquad x\in I,$
is a well defined function. Differentiating both sides, using the product rule, the chain rule, the derivative of the exponential function and the fundamental theorem of calculus, we obtain
    $g'(x)={\bigl(\det \Phi (x))'-\det \Phi (x)\,\mathrm {tr} \,A(x){\bigr )}\exp \left(-\int _{x_{0}}^{x}\operatorname {tr} \,A(\xi )\,{\textrm {d}}\xi \right)=0,\qquad x\in I,$
due to the derivative in (3). Therefore, g has to be constant on I, because otherwise we would obtain a contradiction to the mean value theorem (applied separately to the real and imaginary part in the complex-valued case). Since g(x$_0$) = det Φ(x$_0$), Liouville's formula follows by solving the definition of g for det Φ(x).