arise in many problems in physics
, etc. The following examples show how to solve differential equations in a few simple cases when an exact solution exists.
Separable first order linear ordinary differential equations
A separable linear ordinary differential equation
of the first order has the general form:
where is some known function. We may solve this by separation of variables (moving the y terms to one side and the t terms to the other side),
Antidifferentiating, we find
where C is a constant. Then, by exponentiation, we obtain
with A another arbitrary constant. It is easy to confirm that this is a solution by plugging it into the original differential equation:
Some elaboration is needed because is not in necessarily a constant—indeed, it might not even be integrable. Arguably, one must also assume something about the domains of the functions involved before the equation is fully defined. Are we talking about complex functions, or just real, for example? The usual textbook approach is to discuss forming the equations well before considering how to solve them.
Non-separable first order linear ordinary differential equations
Some first order linear ODEs (ordinary differential equations
) are not separable like in the above example. In order to solve non-separable first order linear ODEs one must use what is known as an integrating factor
. Consider first order linear ODEs of the general form:
The method for solving this equation relies on a special integrating factor, μ:
We choose this integrating factor because it has the special property that its derivative is itself times the function we are integrating, that is:
Multiply both sides of the original differential equation by μ to get:
Because of the special μ we picked, we may substitute for , simplifying the equation to:
Using the product rule in reverse, we get:
Integrating both sides:
Finally, to solve for we divide both sides by :
Since μ is a function of x, we cannot simplify any further directly.
A simple example
Suppose a mass is attached to a spring which exerts an attractive force on the mass proportional
to the extension/compression of the spring. For now, we may ignore any other forces (gravity
, etc). We shall write the extension of the spring at a time
. Now, using Newton's second law
we can write (using convenient units):
If we look for solutions that have the form , where is a constant, we discover the relationship , and thus must be one of the complex numbers or . Thus, using Euler's theorem we can say that the solution must be of the form:
To determine the unknown constants and , we need initial conditions, i.e. equalities that specify the state of the system at a given time (usually ).
For example, if we suppose at the extension is a unit distance (), and the particle is not moving (). We have
and so .
and so .
Therefore . This is an example of simple harmonic motion.
A more complicated model
The above model of an oscillating mass on a spring is plausible but not really realistic. For a start, we have imagined a perpetual motion machine, violating the second law of thermodynamics
. Therefore, we will add some friction
for realism. Experimental scientists
tell us that friction will tend to decelerate the mass and have magnitude proportional to its velocity (i.e.
). Our new differential equation, expressing the balancing of the acceleration and the forces, is
where is our coefficient of friction, and . Again looking for solutions of the form , we find that
This is a quadratic equation which we can solve. If we have complex roots , and the solution (with the above boundary conditions) will look like this:
(We can show that )
This is a damped oscillator, and the plot of displacement against time would look something like this:
which does resemble how one would expect a vibrating spring to behave as friction removed the energy from the system.
- A. D. Polyanin and V. F. Zaitsev, Handbook of Exact Solutions for Ordinary Differential Equations, 2nd Edition, Chapman & Hall/CRC Press, Boca Raton, 2003; ISBN 1-58488-297-2.