The variation of the constants is a method from the theory of linear ordinary differential equations for the determination of a special solution of an inhomogeneous linear differential equation system of the first order or an inhomogeneous linear differential equation of any order. A complete solution ( fundamental system ) of the corresponding homogeneous differential equation is required for this .
Leonhard Euler used a forerunner of this method as early as 1748 in connection with astronomical problems. In its current form, the method was developed by the mathematician JosephLouis Lagrange .
motivation
First order linear differential equation
Let and be continuous functions, then the linear differential equation of the first order reads
${\ displaystyle a: \ mathbb {R} \ rightarrow \ mathbb {R}}$${\ displaystyle b: \ mathbb {R} \ rightarrow \ mathbb {R}}$
 ${\ displaystyle y '(x) = a (x) y (x) + b (x) \.}$
Let also be an antiderivative of , then
${\ displaystyle A}$${\ displaystyle a}$
 ${\ displaystyle A (x): = \ int _ {x_ {0}} ^ {x} a (t) {\ rm {d}} t \,}$
where suitable boundary conditions must be satisfied. Then
${\ displaystyle x_ {0}}$
 ${\ displaystyle \ left \ {y (x) = ce ^ {A (x)} \  \ c \ in \ mathbb {R} \ right \}}$
the set of all solutions to the homogeneous differential equation .
${\ displaystyle y '(x) = a (x) y (x)}$
To solve the inhomogeneous differential equation, the function is now introduced and the approach of varying the constants selected
${\ displaystyle c (x)}$

${\ displaystyle y (x) = c (x) e ^ {A (x)}}$.
This results in a clear assignment between the functions and , because it is an always positive, continuously differentiable function. The derivation of this approach function is
${\ displaystyle y}$${\ displaystyle c}$${\ displaystyle \ exp (A (x))}$
 ${\ displaystyle y '(x) = c (x) a (x) e ^ {A (x)} + c' (x) e ^ {A (x)} = a (x) y (x) + c '(x) e ^ {A (x)} \.}$
So solves the inhomogeneous differential equation
${\ displaystyle y}$
 ${\ displaystyle y '(x) = a (x) y (x) + b (x) \}$
exactly when
 ${\ displaystyle \ c '(x) = b (x) e ^ { A (x)}}$
applies. For example is
 ${\ displaystyle c (x): = \ int _ {x_ {0}} ^ {x} b (t) e ^ { A (t)} {\ rm {d}} t}$
such a function and thus
 ${\ displaystyle y_ {sp} (x): = e ^ {A (x)} \ cdot \ int _ {x_ {0}} ^ {x} b (t) e ^ { A (t)} {\ rm {d}} t}$
the special solution with . So is
${\ displaystyle y_ {sp} (x_ {0}) = 0}$
 ${\ displaystyle \ left \ {y (x) = e ^ {A (x)} \ cdot \ left [\ int _ {x_ {0}} ^ {x} b (t) e ^ { A (t) } {\ rm {d}} t + c \ right] \  \ c \ in \ mathbb {R} \ right \}}$
the set of all solutions to the inhomogeneous differential equation .
${\ displaystyle y '(x) = a (x) y (x) + b (x)}$
example
If a DC voltage is applied to a coil with the inductance and the ohmic resistor , then the following applies to the voltage at the resistor
${\ displaystyle L}$ ${\ displaystyle R}$${\ displaystyle U_ {0}}$
 ${\ displaystyle U (t) = U_ {0} L {\ dot {I}} (t). \! \,}$
According to Ohm's law , this also applies

${\ displaystyle I (t) = {\ frac {U (t)} {R}} = {\ frac {U_ {0}} {R}}  {\ frac {L} {R}} {\ dot { I}} (t)}$.
It is therefore an inhomogeneous linear differential equation of the first order with constant coefficients, which is now to be solved using the method of varying the constants.
For the corresponding homogeneous differential equation ${\ displaystyle I_ {h}}$
 ${\ displaystyle {\ dot {I}} _ {h} (t) =  {\ frac {R} {L}} I_ {h} (t)}$
is the solution for each constant ${\ displaystyle c}$

${\ displaystyle I_ {h} (t) = ce ^ { {\ frac {R} {L}} t}}$.
As a starting point for the solution of the inhomogeneous differential equation, replace the constant with a variable expression . So you bet
${\ displaystyle c}$${\ displaystyle c (t)}$
 ${\ displaystyle I (t): = c (t) e ^ { {\ frac {R} {L}} t}}$
and tries to determine a differentiable function that satisfies the inhomogeneous differential equation. It follows
${\ displaystyle c (t)}$${\ displaystyle I}$
 ${\ displaystyle {\ begin {aligned} {\ frac {U_ {0}} {R}}  {\ frac {L} {R}} {\ dot {I}} (t) & = {\ frac {U_ {0}} {R}}  {\ frac {L} {R}} {\ dot {c}} (t) e ^ { {\ frac {R} {L}} t} + {\ frac { L} {R}} c (t) {\ frac {R} {L}} e ^ { {\ frac {R} {L}} t} \\ & = {\ frac {U_ {0}} { R}}  {\ frac {L} {R}} {\ dot {c}} (t) e ^ { {\ frac {R} {L}} t} + c (t) e ^ { { \ frac {R} {L}} t} \\ & = {\ frac {U_ {0}} {R}}  {\ frac {L} {R}} {\ dot {c}} (t) e ^ { {\ frac {R} {L}} t} + I (t). \ end {aligned}}}$
Accordingly, the inhomogeneous differential equation is solved if and only if applies

${\ displaystyle {\ frac {U_ {0}} {R}}  {\ frac {L} {R}} {\ dot {c}} (t) e ^ { {\ frac {R} {L} } t} = 0}$.
This boundary value condition is equivalent to or after integration with . So the solution to the inhomogeneous differential equation is
${\ displaystyle \ textstyle {\ dot {c}} (t) = {\ frac {U_ {0}} {L}} e ^ {{\ frac {R} {L}} t}}$${\ displaystyle \ textstyle c (t) = {\ frac {U_ {0}} {R}} e ^ {{\ frac {R} {L}} t} + d}$

${\ displaystyle I (t) = {\ frac {U_ {0}} {R}} + de ^ { {\ frac {R} {L}} t}}$.
The constant can be determined from the initial condition and results in the solution
${\ displaystyle d}$${\ displaystyle I (0) = 0}$

${\ displaystyle I (t) = {\ frac {U_ {0}} {R}}  {\ frac {U_ {0}} {R}} e ^ { {\ frac {R} {L}} t }}$.
Inhomogeneous systems of linear differential equations of the first order
The above procedure can be generalized in the following way:
formulation
Let and be continuous functions and a fundamental matrix of the homogeneous problem as well as the matrix that results from by replacing the th column with . Then
${\ displaystyle A: \ mathbb {R} \ rightarrow \ mathbb {R} ^ {n \ times n}}$${\ displaystyle b: \ mathbb {R} \ rightarrow \ mathbb {R} ^ {n}}$${\ displaystyle \ Phi (x) = (y_ {1} (x) \  \ \ cdots \  \ y_ {n} (x))}$${\ displaystyle y '(x) = A (x) y (x)}$${\ displaystyle \ Phi _ {k} (x)}$${\ displaystyle \ Phi (x)}$${\ displaystyle k}$${\ displaystyle b (x)}$
 ${\ displaystyle y_ {sp} (x): = \ sum _ {k = 1} ^ {n} c_ {k} (x) y_ {k} (x)}$
With
 ${\ displaystyle c_ {k} (x): = \ int _ {x_ {0}} ^ {x} {\ frac {\ det \ Phi _ {k} (s)} {\ det \ Phi (s)} } {\ rm {d}} s}$
the solution of the inhomogeneous initial value problem and .
${\ displaystyle y '(x) = A (x) y (x) + b (x)}$${\ displaystyle y (x_ {0}) = 0}$
proof
Set
 ${\ displaystyle y_ {sp} (x): = \ Phi (x) \ int _ {x_ {0}} ^ {x} \ Phi (s) ^ { 1} b (s) {\ rm {d} } s \.}$
It is , and because of differentiation, one sees that the differential equation is satisfied. Well solves
${\ displaystyle y_ {sp} (x_ {0}) = 0}$${\ displaystyle \ Phi '(x) = A (x) \ Phi (x)}$${\ displaystyle y_ {sp}}$${\ displaystyle y_ {sp} '(x) = A (x) y_ {sp} (x) + b (x)}$
 ${\ displaystyle a (s): = \ Phi ^ { 1} (s) b (s) \ in \ mathbb {R} ^ {n}}$
for fixed the system of linear equations
${\ displaystyle s}$
 ${\ displaystyle \ Phi (s) \ cdot a (s) = b (s) \.}$
According to Cramer's rule is
 ${\ displaystyle a_ {k} (s) = {\ frac {\ det \ Phi _ {k} (s)} {\ det \ Phi (s)}} \, \ k = 1, \ ldots, n \. }$
So it applies
 ${\ displaystyle y_ {sp} (x) = \ int _ {x_ {0}} ^ {x} \ Phi (x) a (s) {\ rm {d}} s = \ sum _ {k = 1} ^ {n} \ left [\ int _ {x_ {0}} ^ {x} {\ frac {\ det \ Phi _ {k} (s)} {\ det \ Phi (s)}} {\ rm { d}} s \ right] y_ {k} (x) \.}$
Special case: resonance case
If the inhomogeneity itself is the solution of the homogeneous problem, ie , this is called a resonance case . In this case it is
${\ displaystyle b}$${\ displaystyle b '(x) = A (x) b (x)}$
 ${\ displaystyle \ y_ {sp} (x): = (xx_ {0}) b (x)}$
the solution of the inhomogeneous initial value problem and .
${\ displaystyle y '(x) = A (x) y (x) + b (x)}$${\ displaystyle y (x_ {0}) = 0}$
Inhomogeneous linear differential equations of higher order
Solving a higher order differential equation is equivalent to solving an appropriate first order differential equation system. In this way the above procedure can be used to construct a special solution for a higher order differential equation.
formulation
Let be continuous functions and a fundamental matrix of the homogeneous problem whose first row reads, as well as the matrix that results from by replacing the th column with . Then
${\ displaystyle a_ {0}, \ ldots, a_ {n1}, b: \ mathbb {R} \ rightarrow \ mathbb {R}}$${\ displaystyle \ Phi (x)}$${\ displaystyle \ textstyle y ^ {(n)} (x) = \ sum _ {k = 0} ^ {n1} a_ {k} (x) y ^ {(k)} (x)}$${\ displaystyle (y_ {1} (x) \  \ \ cdots \  \ y_ {n} (x))}$${\ displaystyle \ Phi _ {k} (x)}$${\ displaystyle \ Phi (x)}$${\ displaystyle k}$${\ displaystyle \ textstyle {\ begin {pmatrix} 0 \\\ vdots \\ 0 \\ b (x) \\\ end {pmatrix}}}$
 ${\ displaystyle y_ {sp} (x): = \ sum _ {k = 1} ^ {n} c_ {k} (x) y_ {k} (x)}$
With
 ${\ displaystyle c_ {k} (x): = \ int _ {x_ {0}} ^ {x} {\ frac {\ det \ Phi _ {k} (s)} {\ det \ Phi (s)} } {\ rm {d}} s}$
the solution of the inhomogeneous initial value problem and .
${\ displaystyle \ textstyle y ^ {(n)} (x) = \ sum _ {k = 0} ^ {n1} a_ {k} (x) y ^ {(k)} (x) + b ( x)}$${\ displaystyle y (x_ {0}) = 0}$
proof
First consider the corresponding system of differential equations of the first order, consisting of equations
${\ displaystyle n}$

${\ displaystyle \ Y '(x) = A (x) Y (x) + B (x)}$ With ${\ displaystyle A (x): = {\ begin {pmatrix} 0 & 1 && 0 \\ & \ ddots & \ ddots & \\ && \ ddots & 1 \\ a_ {0} (x) & a_ {1} (x) & \ cdots & a_ {n1} (x) \\\ end {pmatrix}} \, \ B (x): = {\ begin {pmatrix} 0 \\\ vdots \\ 0 \\ b (x) \\\ end {pmatrix}} \.}$
The following applies: solves the scalar equation th order if and only if the
solution of the above system is first order. By definition,
a fundamental matrix for this system is first order. Finally, we apply the method of varying the constants, which has been proven above.
${\ displaystyle y (x)}$${\ displaystyle n}$${\ displaystyle \ textstyle Y (x): = {\ begin {pmatrix} y (x) \\ y '(x) \\\ vdots \\ y ^ {(n1)} (x) \\\ end {pmatrix}}}$${\ displaystyle \ Phi}$
Alternative: basic solution procedure
In the case of constant coefficients it is sometimes advantageous to use the basic solution method to construct a special solution: Is that homogeneous solution of which
${\ displaystyle y_ {h}}$${\ displaystyle \ textstyle y ^ {(n)} (x) = \ sum _ {k = 0} ^ {n1} a_ {k} y ^ {(k)} (x)}$
 ${\ displaystyle y_ {h} ^ {(k)} (x_ {0}) = 0 \, \ k = 0, \ ldots, n2 \, \ y_ {h} ^ {(n1)} ( x_ {0}) = 1}$
met then is
 ${\ display style y_ {sp} (x): = \ int _ {x_ {0}} ^ {x} y_ {h} (x_ {0} + xt) b (t) {\ rm {d}} t}$
that special solution from with .
${\ displaystyle \ textstyle y ^ {(n)} (x) = \ sum _ {k = 0} ^ {n1} a_ {k} y ^ {(k)} (x) + b (x)}$${\ displaystyle y_ {sp} (x_ {0}) = 0}$
proof
You check by differentiating
 ${\ displaystyle y_ {sp} ^ {(k)} (x) = \ int _ {x_ {0}} ^ {x} y_ {h} ^ {(k)} (x_ {0} + xt) b ( t) {\ rm {d}} t \, \ k = 0, \ ldots, n1}$
and
 ${\ displaystyle y_ {sp} ^ {(n)} (x) = b (x) + \ int _ {x_ {0}} ^ {x} y_ {h} ^ {(n)} (x_ {0} + xt) b (t) {\ rm {d}} t \.}$
It turns out
 ${\ displaystyle y_ {sp} ^ {(n)} (x)  \ sum _ {k = 0} ^ {n1} a_ {k} y_ {sp} ^ {(k)} (x) = b (x) + \ int _ {x_ {0}} ^ {x} \ left [y_ {h} ^ {(n)}  \ sum _ {k = 0} ^ {n1} a_ {k} y_ {h} ^ {(k)} \ right] (x_ {0} + xt) b (t) {\ rm {d}} t = b (x) \.}$
Individual evidence

^ Forest Ray Moulton : An Introduction to Celestial Mechanics , 2nd ed. (First published by the Macmillan Company in 1914; reprinted in 1970 by Dover Publications, Inc., Mineola, New York), page 431

^ Leonhard Euler: Recherches sur la question des inégalités du mouvement de Saturne et de Jupiter, sujet proposé pour le prix de l'année 1748 par l'Académie Royale des Sciences de Paris, France: G. Martin, JB Coignard, & HL Guerin , 1749, online at: Google.com

^ JosephLouis Lagrange: (1766) “Solution de différensproblemèmes du calcul integral,” Mélanges de philosophie et de mathématique de la Société royale de Turin , vol. 3, pages 179380.

↑ Wolfgang Walter : Ordinary differential equations. 3. Edition. Springer Verlag, 1986, ISBN 3540161430 , §2, Section II

↑ Wolfgang Walter : Ordinary differential equations. 3. Edition. Springer Verlag, 1986, ISBN 3540161430 , §16

↑ Differential equations of the nth order. In: Otto Forster : Analysis II. Vieweg Verlag, 1977, ISBN 3499270315 , Chapter II, §12.