Before moving on to numerical methods for the solution of ODEs we begin by revising basic analytical techniques for solving ODEs that you will of seen at undergraduate level.
If your equation is of the form
then it can be reformulated as
where
is a constant of integration.
This can be solved by integration, either directly or by substitution, to give a relation between
and
.
The following example will show you how to use to use the separation of variables to solve a first-order ODE.
We wish to solve
subject to
.
The equation can be reformulated as
which can be solved to give
which simplifies to
where
.
This is the general solution to the differential equation. We now need to apply the initial condition
.
Therefore
, and we take the positive root.
The solution is
.
If your equation is of the form
then it can be reformulated by introducing an integrating factor.
The integrating factor for the above equation is defined as
(Note: that this is not unique as any multiple would also be an integrating factor).
In order to solve the original equation we multiply through by the integrating factor to give
by construction of the integrating factor
The original equation can be written as
This can be solved by integration of the right hand side, either directly or by substitution.
The solution is
Note: You need to be careful to consider where the solutions exist, that is, you need
.
Therefore no solutions exist for
such that
.
The following example will show you how to use integrating factors to solve a first-order ODE.
We wish to solve
subject to
.
The integrating factor for this equation is given by
Therefore the original equation may be written as
Integrating the right-hand side gives
where
is a constant of integration, and
. This is the general solution to the differential equation. We now need to apply the initial condition
.
Therefore
, and the solution is
, valid for