A differential equation relates a quantity to its own rate of change. That is how nearly every physical law is stated, which is why solving them matters.
What a differential equation is
An equation containing a derivative. Its order is the highest derivative present:
dxdy=2x(first order)dx2d2y+4y=0(second order)
The simplest kind is solved by integrating directly:
dxdy=2x⇒y=x2+C
The +C makes this the general solution — a whole family of curves. A boundary condition such as y=5 when x=1 picks one out: 5=1+C, so C=4 and y=x2+4. That is the particular solution.
Separation of variables
If the equation can be written as dxdy=f(x)g(y), gather the y's on one side and the x's on the other, then integrate both sides.
Solve dxdy=xy.
y1dy=xdx∫y1dy=∫xdxln∣y∣=2x2+Cy=Aex2/2
where A=eC absorbs the constant.
The growth and decay equation.dtdy=ky separates the same way:
ln∣y∣=kt+C⇒y=Aekt
with A the value at t=0. Positive k gives growth; negative k gives decay.
For adx2d2y+bdxdy+cy=0, try y=emx. This produces the auxiliary equation
am2+bm+c=0
and the shape of the solution depends on its roots:
Roots
General solution
distinct real m1,m2
y=Aem1x+Bem2x
repeated real m
y=(A+Bx)emx
complex α±βi
y=eαx(Acosβx+Bsinβx)
Solve y′′−5y′+6y=0.
m2−5m+6=0⇒(m−2)(m−3)=0y=Ae2x+Be3x
Solve y′′+4y′+4y=0.
m2+4m+4=(m+2)2=0
A repeated root m=−2, so
y=(A+Bx)e−2x
Solve y′′+4y=0.
m2+4=0⇒m=±2i
Here α=0 and β=2:
y=Acos2x+Bsin2x
— an oscillation, which is why complex roots describe vibrating systems.
Particular integrals
When the right-hand side is not zero,
general solution=complementary function+particular integral
The complementary function solves the equation with zero on the right; the particular integral is any single solution of the full equation. Guess its form from the right-hand side:
Right-hand side
Try
constant
y=k
linear in x
y=px+q
ekx
y=λekx
sinkx or coskx
y=λcoskx+μsinkx
Solve y′′−5y′+6y=12.
Complementary function: Ae2x+Be3x, from above.
Particular integral: try y=k, so y′=y′′=0 and 6k=12, giving k=2.
y=Ae2x+Be3x+2
Modelling
Exponential growth and decay. "The rate of change is proportional to the amount present" is
dtdP=kP⇒P=P0ekt
Population growth, compound interest and radioactive decay are all this equation, with k negative for decay.
Newton's law of cooling. "The rate of cooling is proportional to the excess temperature over the surroundings":
dtdθ=−k(θ−θs)
Separating gives
θ=θs+Ae−kt
so the temperature approaches θs but never quite reaches it — the object cools quickly at first, then ever more slowly, which matches what a cup of coffee actually does.