In mathematics, linear differential equations are differential equations having solutions which can be added together in particular linear combinations to form further solutions. They equate 0 to a polynomial that is linear in the value and various derivatives of a variable; its linearity means that each term in the polynomial has degree either 0 or 1.
The linear operator L may be considered to be of the form
The linearity condition on L rules out operations such as taking the square of the derivative of y; but permits, for example, taking the second derivative of y. It is convenient to rewrite this equation in an operator form
where D is the differential operator d/dt (i.e. Dy = y' = dy/dt , D2y = y" = d2y/dt2,... ), and the An are given functions.
Such an equation is said to have ordern, the index of the highest derivative of y that is involved.
A typical simple example is the linear differential equation used to model radioactive decay. Let N(t) denote the number of radioactive atoms remaining in some sample of material  at time t. Then for some constant k > 0, the rate at which the radioactive atoms decay can be modelled by
The case where f = 0 is called a homogeneous equation and its solutions are called complementary functions. It is particularly important to the solution of the general case, since any complementary function can be added to a solution of the inhomogeneous equation to give another solution (by a method traditionally called particular integral and complementary function). When the Ai are numbers, the equation is said to have constant coefficients.
Homogeneous equations with constant coefficients
The first method of solving linear homogeneous ordinary differential equations with constant coefficients is due to Euler, who realized that solutions have the form ezx, for possibly-complex values of z. The exponential function is one of the few functions to keep its shape after differentiation, allowing the sum of its multiple derivatives to cancel out to zero, as required by the equation. Thus, for constant values A1,..., An, to solve:
Formally, the terms of the original differential equation are replaced by zk. Solving the polynomial gives n values of z, z1, ..., zn. Substitution of any of those values for z into ezx gives a solution ezix. Since homogeneous linear differential equations obey the superposition principle, any linear combination of these functions also satisfies the differential equation.
This has zeroes, i, −i, and 1 (multiplicity 2). The solution basis is then
This corresponds to the real-valued solution basis
The preceding gave a solution for the case when all zeros are distinct, that is, each has multiplicity 1. For the general case, if z is a (possibly complex) zero (or root) of F(z) having multiplicity m, then, for , is a solution of the ordinary differential equation. Applying this to all roots gives a collection of n distinct and linearly independent functions, where n is the degree of F(z). As before, these functions make up a basis of the solution space.
If the coefficients Ai of the differential equation are real, then real-valued solutions are generally preferable. Since non-real roots z then come in conjugate pairs, so do their corresponding basis functions xkezx, and the desired result is obtained by replacing each pair with their real-valued linear combinationsRe(y) and Im(y), where y is one of the pair.
A case that involves complex roots can be solved with the aid of Euler's formula.
We then can solve for z. There are three particular cases of interest:
Case #1: Two distinct roots, z1 and z2
Case #2: One real repeated root, z
Case #3: Complex roots, α ± βi
In case #1, the general solution is given by
In case #2, the general solution is given by
In case #3, the general solution is given, using Euler's equation, by
In each case, the constants are functions of the initial conditions They can be found by using the values of the initial conditions in the solution equation for y and in the resulting equation for y' , giving two equations in the two unknown parameters.
The expression in parenthesis can be factored out, yielding
which has a pair of linearly independent solutions:
The solutions are, respectively,
These solutions provide a basis for the two-dimensional solution space of the second order differential equation: meaning that linear combinations of these solutions will also be solutions. In particular, the following solutions can be constructed
These last two trigonometric solutions are linearly independent, so they can serve as another basis for the solution space, yielding the following general solution:
Use these characteristic roots to factor the left side of the original differential equation:
This implies a pair of solutions, one corresponding to
The solutions are, respectively,
where ω = b/2m. From this linearly independent pair of solutions can be constructed another linearly independent pair which thus serve as a basis for the two-dimensional solution space:
However, if |ω| < |ω0| then it is preferable to get rid of the consequential imaginaries, expressing the general solution as
This latter solution corresponds to the underdamped case, whereas the former one corresponds to the overdamped case: the solutions for the underdamped case oscillate whereas the solutions for the overdamped case do not.
Nonhomogeneous equation with constant coefficients
To obtain the solution to the nonhomogeneous equation (sometimes called inhomogeneous equation), find a particular integral yP(x) by either the method of undetermined coefficients or the method of variation of parameters; the general solution to the linear differential equation is the sum of the general solution of the related homogeneous equation and the particular integral. Or, when the initial conditions are set, use Laplace transform to obtain the particular solution directly.
Suppose we face
For later convenience, define the characteristic polynomial
We find a solution basis for the homogeneous (f(x) = 0) case. We now seek a particular integralyp(x) by the variation of parameters method. Let the coefficients of the linear combination be functions of x:
For ease of notation we will drop the dependency on x (i.e. the various (x)). Using the operator notation D = d/dx, the ODE in question is P(D)y = f; so
With the constraints
the parameters commute out,
But P(D)yj = 0, therefore
This, with the constraints, gives a linear system in the u′j. This much can always be solved; in fact, combining Cramer's rule with the Wronskian,
In the very non-standard notation used above, one should take the i,n-minor of W and multiply it by f. That's why we get a minus-sign. Alternatively, forget about the minus sign and just compute the determinant of the matrix obtained by substituting the j-th W column with (0, 0, ..., f).
The rest is a matter of integrating u′j.
The particular integral is not unique; also satisfies the ODE for any set of constants cj.
An arbitrary linear ordinary differential equation or even a system of such equations can be converted into a first order system of linear differential equations by adding variables for all but the highest order derivatives. A linear system can be viewed as a single equation with a vector-valued variable. The general treatment is analogous to the treatment above of ordinary first order linear differential equations, but with complications stemming from noncommutativity of matrix multiplication.
(here is a vector or matrix, and is a matrix), let be the solution of with (the identity matrix). is a fundamental matrix for the equation — the columns of form a complete linearly independent set of solutions for the homogeneous equation. After substituting , the equation simplifies to Thus,
If commutes with for all and , then
but in the general case there is no closed form solution, and an approximation method such as Magnus expansion may have to be used. Note that the exponentials are matrix exponentials.