myphysicslab – what is a differential equation?
a differential equation can look pretty intimidating, with lots of fancy math symbols. but the idea behind it is actually fairly simple:
a differential equation states how a rate of change (a "differential") in one variable is related to other variables.
for example, the single spring simulation
has two variables: time t
and the amount of stretch in the spring, x
. if we set x = 0
to be the position of the block when the spring is unstretched, then x
represents both the position of the block and the stretch in the spring. velocity is (as usual) the time derivative of position v = x'
, and the differential equation describing the single spring simulation is
v' = −k x
is the spring constant (how stiff the spring is). now we can "read" the meaning of the differential equation: it says that
the rate of change in velocity is proportional to the position
for instance, when the position is zero (ie. the spring is neither stretched nor compressed) then the velocity is not changing. this makes sense, because the spring is not exerting a force at that moment.
on the other hand, when the position is large (ie. the string is very much stretched or compressed) then the rate of change of the velocity is large, because the spring is exerting a lot of force.
what is a solution to a differential equation?
when you begin learning mathematics, you work on getting solutions to equations like
x2 + 2x + 1 = 0
which has a solution x = −1
for a differential equation, the solution is not a single value, but a function
. the task is to find a function whose various derivatives fit the differential equation over a long span of time. for example,
is a differential equation where the goal is to find a function x(t)
which, when you plug the function and its derivatives into the differential equation, the equation holds for any time t
the general solution
for the previous equation happens to be
x(t) = a e−t + b t e−t
are undetermined constants. it's easy to confirm that you have a solution: just plug the solution in to the differential equation! for our example, we find the first and second derivatives (see the math refresher
for how to find these derivatives... it's easy!):
x'(t) = (b − a)e−t − b t e−t
x''(t) = (a − 2b)e−t + b t e−t
now plug these equations (2), (3), and (4) into the left side of the differential equation (1), and do a little algebra:
x'' + 2x' + x =
=((a − 2b)e−t + b t e−t) + 2((b − a)e−t − b t e−t) + (a e−t + b t e−t)
=(a − 2b+2b − 2a+a)e−t + (b − 2b+b) t e−t
therefore the solution (2) satisfies the differential equation (1) for any values of a, b
the solution is called the general solution
because we have not yet applied a particular set of initial conditions. initial conditions are things like: positions and velocities of things at time t = 0
. the initial conditions will determine the values of the coefficients a, b
in the above example we are left with undetermined constants a, b
. how do we find out what they are?
they are set according to the initial conditions
which are the state of the world at the beginning of time. for the example problem above, we might have initial conditions specifying position x
and velocity x'
at time t = 0
x(0) = 1 x'(0) = 0
then we can plug t = 0
into equations (2) and (3) above to find the values of the constants a, b
x(0) = a + 0 = 1
x'(0) = (b − a) − 0 = 0
and therefore we find that a = b = 1
and the particular solution
x(t) = e−t + t e−t
this solution is called the particular solution
because it applies only to the particular initial conditions that we have chosen.
more information on differential equations: