Differential equation: Difference between revisions
Rewrite in canonical style for non-specialist readers: full worked derivations, concrete numeric examples, slope fields, and links (not duplication) to the separate articles on series, Laplace, numerical, and qualitative methods. AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server) |
|||
| Line 1: | Line 1: | ||
'''A differential equation''' is an equation | '''A differential equation''' is an equation in which the unknown is a function, and in which the derivatives (rates of change) of that function also appear. An ordinary equation such as $x^2 = 9$ asks for a number; a differential equation asks for a function whose rate of change obeys a stated rule. | ||
Most laws of nature are stated as rules about how quantities change, so differential equations appear throughout science and engineering: the swinging of a pendulum, the cooling of a hot drink, the growth of a population, and the discharge of a capacitor are all described by differential equations. This article covers '''ordinary differential equations''' (ODEs), in which the unknown function depends on a single independent variable, and points to the articles that treat the more advanced solution techniques. | |||
== A first example: slopes and a family of solutions == | |||
Take the simplest possible differential equation. Suppose the unknown is a function $y(x)$, and all we are told about it is how it changes: | |||
= | $$\frac{dy}{dx}=2x$$ | ||
Here $dy/dx$ is the slope of the graph of $y$. The equation says that whatever the solution is, its slope at the point $x$ must equal $2x$. | |||
To solve the equation is to find every function whose slope behaves this way. Integrating both sides with respect to $x$ undoes the differentiation on the left, so | |||
$$\int\frac{dy}{dx}\,dx=\int 2x\,dx\qquad\Longrightarrow\qquad y(x)=x^{2}+C$$ | |||
where $C$ is an arbitrary constant, because differentiating $x^2 + C$ gives $2x$ for every value of $C$: | |||
$$\frac{d}{dx}\left(x^{2}+C\right)=2x$$ | |||
The solutions are therefore not one function but a whole family of parabolas $y = x^2 + C$, one for each choice of $C$, each a vertical shift of the others. This family is called the '''general solution'''. | |||
Two features are common to all differential equations, and both are visible in this tiny example: | |||
* the unknown is a function, not a number; | |||
* the solutions come in a family, indexed here by the arbitrary constant $C$. | |||
An extra piece of information selects one member of the family. Suppose we want the solution whose graph passes through the point $(0, 3)$. Substituting $x = 0$ and $y = 3$ into the family fixes the constant: | |||
$$3=0^{2}+C\qquad\Longrightarrow\qquad C=3$$ | |||
{ | and the chosen solution is $y = x^{2} + 3$. Such an extra condition is called an '''initial condition''' (for historical reasons: for many equations the independent variable is time and the condition fixes the state at time zero), and a differential equation together with initial conditions is an '''initial value problem'''. | ||
== Types of differential equations == | |||
=== | === Order === | ||
The '''order''' of a differential equation is the order of the highest derivative that appears in it. The equation $dy/dx = 2x$ of the previous section is first order. | |||
Newton's second law of motion is the standard second-order example: the acceleration of a body, the second derivative of its position, is proportional to the force acting on it: | |||
{{#content:Q1583}} | |||
where $x(t)$ is the position of a body of mass $m$ and $F$ is the net force. | |||
Each integration introduces one arbitrary constant, so the general solution of an equation of order $n$ typically contains $n$ constants, and $n$ extra conditions are needed to fix them. For a falling body this is easy to see. If only gravity acts, the force is constant, $F = -mg$ (taking the height $x$ positive upwards), so the equation of motion is | |||
$$m\frac{d^{2}x}{dt^{2}}=-mg\qquad\Longrightarrow\qquad\frac{d^{2}x}{dt^{2}}=-g$$ | |||
{{ | with $g \approx 9.8\ \mathrm{m\,s^{-2}}$ the acceleration of free fall. Integrating both sides once gives the velocity, and introduces the constant $v_{0}$, the speed at time $t = 0$: | ||
$$\frac{dx}{dt}=-gt+v_{0}$$ | |||
Integrating again gives the height, and introduces a second constant, $x_{0}$, the height at $t = 0$: | |||
= | $$x(t)=-\frac{g}{2}\,t^{2}+v_{0}t+x_{0}$$ | ||
Two conditions, the initial height and the initial velocity, are needed to fix both constants. | |||
== | A concrete check: a ball dropped from rest ($v_{0} = 0$) at a height of $19.6\ \mathrm{m}$ hits the ground when $x(t) = 0$: | ||
$$0=19.6-4.9\,t^{2}\qquad\Longrightarrow\qquad t=\sqrt{19.6/4.9}=2\ \text{seconds}$$ | |||
since $\tfrac12 g = 4.9$. The example also shows how a differential equation can predict the future: the two initial conditions fix the whole trajectory. | |||
=== Linear and nonlinear === | |||
A differential equation is '''linear''' when the unknown function and its derivatives appear only to the first power and are never multiplied together (multiplying by functions of the independent variable is allowed). A first-order linear equation can always be written as | |||
$$\frac{dy}{dx}+p(x)\,y=q(x)$$ | |||
The equations | |||
$$\frac{dy}{dx}=y^{2},\qquad \frac{d^{2}\theta}{dt^{2}}+\sin\theta=0$$ | |||
are nonlinear: the first contains the square of the unknown, the second the sine of it. | |||
= | Linearity matters because linear equations have a simple structure. If $y_{1}$ and $y_{2}$ both solve a linear equation whose right-hand side is zero (a '''homogeneous''' equation), then any combination $c_{1}y_{1} + c_{2}y_{2}$ solves it too. This is the superposition principle, and it fails for nonlinear equations. For instance, the growth equation $dy/dx = ky$ is solved by $e^{kx}$, and so is any multiple of it; but if $y_{1}$ and $y_{2}$ solve $dy/dx = y^{2}$, their sum does not, because $(y_{1}+y_{2})^{2}$ contains the extra cross term $2y_{1}y_{2}$. The practical upshot is that linear equations can usually be solved by systematic methods, whereas most nonlinear equations cannot (see below). | ||
=== Ordinary and partial === | |||
An '''ordinary differential equation''' involves a function of a single independent variable, as in all the examples so far. A '''partial differential equation''' (PDE) involves a function of several independent variables, together with its partial derivatives. For example, the temperature $u(x, t)$ of a metal bar satisfies the heat equation | |||
$$\frac{\partial u}{\partial t}=\alpha\,\frac{\partial^{2}u}{\partial x^{2}}$$ | |||
where the constant $\alpha$ measures how quickly heat spreads: a spot that is much warmer than its neighbours (large second derivative) warms or cools quickly. PDEs such as the heat, wave and Laplace equations form a whole branch of their own; the rest of this article concerns ordinary differential equations. | |||
== | == Slope fields: seeing the solutions without formulas == | ||
A first-order equation solved for its derivative reads | |||
{{#content:Q1581}} | {{#content:Q1581}} | ||
It assigns to every point $(x, y)$ of the plane the slope that any solution curve passing through that point must have there. Drawing a short line segment with exactly that slope at many points produces a '''direction field''' (or slope field) for the equation. | |||
Drawing a short line segment | |||
[[File:Slope field of exponential growth.png|thumb|Direction field of | [[File:Slope field of exponential growth.png|thumb|Direction field of $dy/dx = y$. Each short segment shows the slope that a solution must have there, and the drawn curves follow the field. The field already shows the solutions climbing ever more steeply. Credit: jjbeard (public domain).]] | ||
A solution curve must be tangent to the field everywhere it passes, rather like a boat that is pushed by a current whose direction depends on where the boat is. The field therefore displays the whole solution family at a glance, without a single integration. For the equation $dy/dx = y$ pictured above, the field shows solutions rising ever more steeply in the upper half-plane (fast growth), diving down in the lower half-plane, and the horizontal line $y = 0$ is itself a solution. Reading behaviour directly from the field is often the only practical approach for equations that resist formulas.<ref>{{#cite:Q1576}}</ref> | |||
== | == Separable equations: growth and decay == | ||
The first family of equations that can always be solved are the '''separable''' ones, those of the form | |||
{{#content:Q1612}} | {{#content:Q1612}} | ||
in which the right-hand side is a product of a function of $x$ alone and a function of $y$ alone. Dividing both sides by $h(y)$ moves every $y$ to the left and every $x$ to the right, so the two sides can be integrated separately, and solving the result for $y$ gives the general solution. | |||
The single most important separable equation is the one describing a quantity that changes at a rate proportional to its own size: | |||
{{#content:Q1584}} | |||
with $k$ a constant. For $k > 0$ the quantity grows (a population with unlimited food, money earning interest); for $k < 0$ it decays (a radioactive substance). Dividing by $y$ and integrating, | |||
$$\frac{1}{y}\frac{dy}{dt}=k\qquad\Longrightarrow\qquad\int\frac{dy}{y}=\int k\,dt$$ | |||
gives $\ln|y| = kt + C$. Exponentiating both sides, | |||
== | $$|y|=e^{kt+C}=e^{C}e^{kt}$$ | ||
and absorbing the constant into the initial amount $y_{0} = y(0)$ gives the general solution: | |||
{{#content:Q1585}} | |||
{{ | Each fixed interval of time multiplies the quantity by the same factor $e^{k\Delta t}$, so growth ($k>0$) and decay ($k<0$) are both exponential. The time needed to double (for growth) or halve (for decay) is $\ln 2/|k|$, obtained from $e^{kt} = 2$ or $e^{kt} = \tfrac12$. | ||
A concrete example of growth: suppose a bank account pays interest at 5% per year, added continuously. If the balance is $A(t)$, it changes at the rate $dA/dt = 0.05\,A$. An initial deposit of €1000 therefore grows as $A(t) = 1000\,e^{0.05t}$, with $t$ in years. The money doubles when | |||
{{ | $$1000\,e^{0.05t}=2000\qquad\Longrightarrow\qquad 0.05\,t=\ln 2\qquad\Longrightarrow\qquad t=\frac{\ln 2}{0.05}\approx 13.9\ \text{years}$$ | ||
and after 30 years the balance is $1000\,e^{1.5} \approx$ €4482, roughly four and a half times the deposit. | |||
{{# | The same equation with $k < 0$ describes decay: a substance whose half-life is 2 hours leaves an eighth of its original amount after 6 hours, because three half-lives have passed. Radioactive dating, drug elimination, and the discharge of a capacitor are all the same model.<ref>{{#cite:Q1576}}</ref> | ||
== Newton's law of cooling: decay towards a fixed level == | |||
Growth and decay need not head towards zero; many quantities move towards a fixed level instead. A hot object cools at a rate proportional to the gap between its temperature and that of the room, not to its own temperature. This is Newton's law of cooling: | |||
{{#content:Q1586}} | |||
{{ | where $T(t)$ is the temperature of the object, $T_{a}$ the (constant) room temperature and $k > 0$. If $T > T_{a}$ the right-hand side is negative, so the object cools; if $T < T_{a}$ it warms. The equation is separable: moving the $T$-dependent factor to the left and integrating, | ||
$$\int\frac{dT}{T-T_{a}}=\int -k\,dt\qquad\Longrightarrow\qquad \ln|T-T_{a}|=-kt+C$$ | |||
Exponentiating both sides, | |||
$$|T-T_{a}|=e^{-kt+C}=e^{C}e^{-kt}$$ | |||
For an object hotter than the room, $T - T_{a} > 0$ throughout, so the absolute value can be dropped, and absorbing $e^{C}$ into the initial temperature difference $T_{0} - T_{a}$ gives | |||
{{ | $$T(t)=T_{a}+\left(T_{0}-T_{a}\right)e^{-kt}$$ | ||
So it is the temperature gap, not the temperature, that decays exponentially. As $t$ grows the gap shrinks towards zero: the formula predicts that the object approaches room temperature but never quite reaches it. | |||
{{ | A concrete example. A cup of coffee is at $80\,^{\circ}\mathrm{C}$ in a room at $20\,^{\circ}\mathrm{C}$, and after 10 minutes it has cooled to $50\,^{\circ}\mathrm{C}$. The initial gap $T_{0} - T_{a} = 60$ has halved to 30 in those 10 minutes, so the gap halves every 10 minutes and | ||
$$T(t)=20+60\cdot 2^{-t/10}$$ | |||
{{# | with $t$ in minutes. After 20 minutes the gap is a quarter of its original value, so the coffee is at $20 + 15 = 35\,^{\circ}\mathrm{C}$. After an hour the temperature is $20 + 60/64 \approx 20.9\,^{\circ}\mathrm{C}$, barely above room temperature; the formula says it will cool more and more slowly, approaching $20\,^{\circ}\mathrm{C}$ without ever quite arriving.<ref>{{#cite:Q1576}}</ref> | ||
The | == The harmonic oscillator: equations whose solutions oscillate == | ||
Some quantities do not settle towards a level but swing back and forth. Consider a mass $m$ attached to a spring. If the spring is displaced a distance $x$ from its rest position, it pulls back with a force $-kx$ proportional to the displacement (Hooke's law), where the spring constant $k$ measures how stiff the spring is. Newton's second law therefore gives | |||
$$m\frac{d^{2}x}{dt^{2}}=-kx\qquad\Longrightarrow\qquad\frac{d^{2}x}{dt^{2}}+\frac{k}{m}x=0$$ | |||
{{ | Writing $\omega_{0}^{2} = k/m$, this becomes the '''harmonic oscillator equation''': | ||
{{#content:Q1588}} | |||
{{#content: | |||
The equation asks for a function whose second derivative is a negative constant multiple of itself, and the sine and cosine have exactly this property. Differentiating $\cos(\omega_{0}t)$ twice brings out two factors of $\omega_{0}$ and a minus sign: | |||
$$\frac{d}{dt}\cos(\omega_{0}t)=-\omega_{0}\sin(\omega_{0}t),\qquad \frac{d^{2}}{dt^{2}}\cos(\omega_{0}t)=-\omega_{0}^{2}\cos(\omega_{0}t)$$ | |||
== | so $x = \cos(\omega_{0}t)$ solves the equation, and so does $x = \sin(\omega_{0}t)$. Because the equation is linear and homogeneous, the superposition principle applies and the general solution is | ||
$$x(t)=A\cos(\omega_{0}t)+B\sin(\omega_{0}t)$$ | |||
The two constants $A$ and $B$ are fixed by the initial displacement and the initial velocity, exactly as the order of the equation requires. | |||
[[File:Simple harmonic motion animation.gif|thumb|A mass on a spring executes simple harmonic motion: the solution of the harmonic oscillator equation is a sinusoid of fixed amplitude and frequency. Credit: Evil saltine (public domain).]] | |||
{{ | A concrete example. Take a mass of $2\ \mathrm{kg}$ on a spring with $k = 8\ \mathrm{N/m}$, so that $\omega_{0} = \sqrt{k/m} = \sqrt{4} = 2$ radians per second. Pull the mass $10\ \mathrm{cm}$ out and release it from rest: the initial velocity is zero, so $B = 0$, and $x(t) = 0.10\cos(2t)$ metres. The motion repeats after one period | ||
$$P=\frac{2\pi}{\omega_{0}}=\pi\ \text{seconds}\approx 3.14\ \text{s}$$ | |||
so the mass returns to its starting point roughly every 3.14 seconds. One second after release, measuring angles in radians, | |||
= | $$x(1)=0.10\cos(2)\approx 0.10\times(-0.416)\approx -0.042\ \text{m}$$ | ||
about 4 cm on the other side of the rest position. This kind of motion, a sinusoid of fixed amplitude, is called '''simple harmonic motion''', and the oscillator equation governs not only springs but pendulums (for small swings), electric circuits, and the vibrations of molecules.<ref>{{#cite:Q1577}}</ref> | |||
== When no formula can be found == | |||
The equations solved above are the standard cases taught in a first course, and they are the exception rather than the rule. Most differential equations, and almost all nonlinear ones, cannot be solved by any combination of familiar functions, however cleverly combined. Realistic models are therefore studied in one of three ways: | |||
* if approximate numbers are wanted, the solution is stepped forward numerically, one small interval at a time (see the article [[Euler's method]]); | |||
* if the behaviour matters more than the numbers, the equation is studied geometrically, through its slope fields, equilibria, stability, and long-term behaviour (see the article [[Qualitative methods]]); | |||
* for special linear equations, solutions can be expressed as infinite series or recovered by integral transforms (see the articles [[Power series]] and [[Laplace transform]]). | |||
<uml type="uml"> | |||
@startuml | |||
skinparam monochrome true | |||
start | |||
:Given a differential equation; | |||
if (Can you separate the variables, or recognise\nexponential or sinusoidal solutions?) then (yes) | |||
:Elementary solution:\na formula (a whole family of solutions); | |||
else (no) | |||
if (Approximate numbers are enough?) then (yes) | |||
:Numerical stepping\n(article: Euler's method); | |||
else (no) | |||
if (The equation is linear and a series or\nintegral-transform formula may exist?) then (yes) | |||
:Series and transform methods\n(articles: Power series, Laplace transform); | |||
else (no) | |||
:Study the behaviour instead:\nequilibria, stability, chaos\n(article: Qualitative methods); | |||
endif | |||
endif | |||
endif | |||
stop | |||
@enduml | |||
</uml> | |||
The choice between these routes is part of the art of applying mathematics, and is treated in full in the standard textbooks.<ref>{{#cite:Q1576}}</ref><ref>{{#cite:Q1578}}</ref> | |||
== A short history == | |||
[[File:Isaac Newton portrait.jpg|thumb|left|Isaac Newton (portrait after Godfrey Kneller, 1689). The laws of motion and of gravitation published in the ''Principia'' (1687) are differential equations. Credit: James Thronill after Godfrey Kneller (public domain).]] | |||
In the 18th century [[Person:Leonhard Euler|Leonhard Euler]] turned a collection of ad hoc tricks into a systematic theory, developing the | Differential equations arose together with the calculus developed by [[Person:Isaac Newton|Isaac Newton]] and [[Person:Gottfried Wilhelm Leibniz|Gottfried Wilhelm Leibniz]] in the second half of the 17th century. Newton's laws of motion, published in his ''Principia'' of 1687, are differential equations, and it is Leibniz's notation $dy/dx$, introduced in the same period, that is still used today. In the 18th century [[Person:Leonhard Euler|Leonhard Euler]] turned a collection of ad hoc tricks into a systematic theory, developing the solution of linear equations with constant coefficients, series methods, and the first numerical integration scheme, which still bears his name.<ref>{{#cite:Q1577}}</ref> | ||
[[File:Leonhard Euler portrait.jpg|thumb|Leonhard Euler (portrait by Jakob Emanuel Handmann, 1753). Euler created much of the systematic theory of differential equations | [[File:Leonhard Euler portrait.jpg|thumb|Leonhard Euler (portrait by Jakob Emanuel Handmann, 1753). Euler created much of the systematic theory of differential equations in the 18th century. Credit: Jakob Emanuel Handmann (public domain).]] | ||
Alongside the theory of ordinary equations, the 18th and 19th centuries | Alongside the theory of ordinary equations, the physics of the 18th and 19th centuries produced the partial differential equations: Jean le Rond d'Alembert wrote down and solved the wave equation of the vibrating string in the 1740s, and Joseph Fourier derived the heat equation from the physics of conduction and solved it with trigonometric series in his ''Théorie analytique de la chaleur'' of 1822, founding Fourier analysis.<ref>{{#cite:Q1579}}</ref> | ||
Two developments of the 20th century completed the modern picture. On the one hand, numerical computing made it possible to approximate the solutions of equations that cannot be solved in formulas. On the other, the geometric ideas of [[Person:Henri Poincaré|Henri Poincaré]], who studied the three-body problem of celestial mechanics at the end of the 19th century, grew into the qualitative theory of dynamical systems, in which equilibria, stability, and long-term behaviour are studied without solving the equations. In 1963 the meteorologist [[Person:Edward Lorenz|Edward Lorenz]] found chaotic behaviour in a simple system of three differential equations modelling atmospheric convection: although the equations were deterministic, their solutions were aperiodic and so sensitive to initial conditions that long-term weather prediction is impossible in practice.<ref>{{#cite:Q1578}}</ref> | |||
== References == | == References == | ||
Revision as of 13:53, 5 September 2026
A differential equation is an equation in which the unknown is a function, and in which the derivatives (rates of change) of that function also appear. An ordinary equation such as $x^2 = 9$ asks for a number; a differential equation asks for a function whose rate of change obeys a stated rule.
Most laws of nature are stated as rules about how quantities change, so differential equations appear throughout science and engineering: the swinging of a pendulum, the cooling of a hot drink, the growth of a population, and the discharge of a capacitor are all described by differential equations. This article covers ordinary differential equations (ODEs), in which the unknown function depends on a single independent variable, and points to the articles that treat the more advanced solution techniques.
A first example: slopes and a family of solutions
Take the simplest possible differential equation. Suppose the unknown is a function $y(x)$, and all we are told about it is how it changes:
$$\frac{dy}{dx}=2x$$
Here $dy/dx$ is the slope of the graph of $y$. The equation says that whatever the solution is, its slope at the point $x$ must equal $2x$.
To solve the equation is to find every function whose slope behaves this way. Integrating both sides with respect to $x$ undoes the differentiation on the left, so
$$\int\frac{dy}{dx}\,dx=\int 2x\,dx\qquad\Longrightarrow\qquad y(x)=x^{2}+C$$
where $C$ is an arbitrary constant, because differentiating $x^2 + C$ gives $2x$ for every value of $C$:
$$\frac{d}{dx}\left(x^{2}+C\right)=2x$$
The solutions are therefore not one function but a whole family of parabolas $y = x^2 + C$, one for each choice of $C$, each a vertical shift of the others. This family is called the general solution.
Two features are common to all differential equations, and both are visible in this tiny example:
- the unknown is a function, not a number;
- the solutions come in a family, indexed here by the arbitrary constant $C$.
An extra piece of information selects one member of the family. Suppose we want the solution whose graph passes through the point $(0, 3)$. Substituting $x = 0$ and $y = 3$ into the family fixes the constant:
$$3=0^{2}+C\qquad\Longrightarrow\qquad C=3$$
and the chosen solution is $y = x^{2} + 3$. Such an extra condition is called an initial condition (for historical reasons: for many equations the independent variable is time and the condition fixes the state at time zero), and a differential equation together with initial conditions is an initial value problem.
Types of differential equations
Order
The order of a differential equation is the order of the highest derivative that appears in it. The equation $dy/dx = 2x$ of the previous section is first order.
Newton's second law of motion is the standard second-order example: the acceleration of a body, the second derivative of its position, is proportional to the force acting on it:
where $x(t)$ is the position of a body of mass $m$ and $F$ is the net force.
Each integration introduces one arbitrary constant, so the general solution of an equation of order $n$ typically contains $n$ constants, and $n$ extra conditions are needed to fix them. For a falling body this is easy to see. If only gravity acts, the force is constant, $F = -mg$ (taking the height $x$ positive upwards), so the equation of motion is
$$m\frac{d^{2}x}{dt^{2}}=-mg\qquad\Longrightarrow\qquad\frac{d^{2}x}{dt^{2}}=-g$$
with $g \approx 9.8\ \mathrm{m\,s^{-2}}$ the acceleration of free fall. Integrating both sides once gives the velocity, and introduces the constant $v_{0}$, the speed at time $t = 0$:
$$\frac{dx}{dt}=-gt+v_{0}$$
Integrating again gives the height, and introduces a second constant, $x_{0}$, the height at $t = 0$:
$$x(t)=-\frac{g}{2}\,t^{2}+v_{0}t+x_{0}$$
Two conditions, the initial height and the initial velocity, are needed to fix both constants.
A concrete check: a ball dropped from rest ($v_{0} = 0$) at a height of $19.6\ \mathrm{m}$ hits the ground when $x(t) = 0$:
$$0=19.6-4.9\,t^{2}\qquad\Longrightarrow\qquad t=\sqrt{19.6/4.9}=2\ \text{seconds}$$
since $\tfrac12 g = 4.9$. The example also shows how a differential equation can predict the future: the two initial conditions fix the whole trajectory.
Linear and nonlinear
A differential equation is linear when the unknown function and its derivatives appear only to the first power and are never multiplied together (multiplying by functions of the independent variable is allowed). A first-order linear equation can always be written as
$$\frac{dy}{dx}+p(x)\,y=q(x)$$
The equations
$$\frac{dy}{dx}=y^{2},\qquad \frac{d^{2}\theta}{dt^{2}}+\sin\theta=0$$
are nonlinear: the first contains the square of the unknown, the second the sine of it.
Linearity matters because linear equations have a simple structure. If $y_{1}$ and $y_{2}$ both solve a linear equation whose right-hand side is zero (a homogeneous equation), then any combination $c_{1}y_{1} + c_{2}y_{2}$ solves it too. This is the superposition principle, and it fails for nonlinear equations. For instance, the growth equation $dy/dx = ky$ is solved by $e^{kx}$, and so is any multiple of it; but if $y_{1}$ and $y_{2}$ solve $dy/dx = y^{2}$, their sum does not, because $(y_{1}+y_{2})^{2}$ contains the extra cross term $2y_{1}y_{2}$. The practical upshot is that linear equations can usually be solved by systematic methods, whereas most nonlinear equations cannot (see below).
Ordinary and partial
An ordinary differential equation involves a function of a single independent variable, as in all the examples so far. A partial differential equation (PDE) involves a function of several independent variables, together with its partial derivatives. For example, the temperature $u(x, t)$ of a metal bar satisfies the heat equation
$$\frac{\partial u}{\partial t}=\alpha\,\frac{\partial^{2}u}{\partial x^{2}}$$
where the constant $\alpha$ measures how quickly heat spreads: a spot that is much warmer than its neighbours (large second derivative) warms or cools quickly. PDEs such as the heat, wave and Laplace equations form a whole branch of their own; the rest of this article concerns ordinary differential equations.
Slope fields: seeing the solutions without formulas
A first-order equation solved for its derivative reads
It assigns to every point $(x, y)$ of the plane the slope that any solution curve passing through that point must have there. Drawing a short line segment with exactly that slope at many points produces a direction field (or slope field) for the equation.

A solution curve must be tangent to the field everywhere it passes, rather like a boat that is pushed by a current whose direction depends on where the boat is. The field therefore displays the whole solution family at a glance, without a single integration. For the equation $dy/dx = y$ pictured above, the field shows solutions rising ever more steeply in the upper half-plane (fast growth), diving down in the lower half-plane, and the horizontal line $y = 0$ is itself a solution. Reading behaviour directly from the field is often the only practical approach for equations that resist formulas.[1]
Separable equations: growth and decay
The first family of equations that can always be solved are the separable ones, those of the form
in which the right-hand side is a product of a function of $x$ alone and a function of $y$ alone. Dividing both sides by $h(y)$ moves every $y$ to the left and every $x$ to the right, so the two sides can be integrated separately, and solving the result for $y$ gives the general solution.
The single most important separable equation is the one describing a quantity that changes at a rate proportional to its own size:
with $k$ a constant. For $k > 0$ the quantity grows (a population with unlimited food, money earning interest); for $k < 0$ it decays (a radioactive substance). Dividing by $y$ and integrating,
$$\frac{1}{y}\frac{dy}{dt}=k\qquad\Longrightarrow\qquad\int\frac{dy}{y}=\int k\,dt$$
gives $\ln|y| = kt + C$. Exponentiating both sides,
$$|y|=e^{kt+C}=e^{C}e^{kt}$$
and absorbing the constant into the initial amount $y_{0} = y(0)$ gives the general solution:
Each fixed interval of time multiplies the quantity by the same factor $e^{k\Delta t}$, so growth ($k>0$) and decay ($k<0$) are both exponential. The time needed to double (for growth) or halve (for decay) is $\ln 2/|k|$, obtained from $e^{kt} = 2$ or $e^{kt} = \tfrac12$.
A concrete example of growth: suppose a bank account pays interest at 5% per year, added continuously. If the balance is $A(t)$, it changes at the rate $dA/dt = 0.05\,A$. An initial deposit of €1000 therefore grows as $A(t) = 1000\,e^{0.05t}$, with $t$ in years. The money doubles when
$$1000\,e^{0.05t}=2000\qquad\Longrightarrow\qquad 0.05\,t=\ln 2\qquad\Longrightarrow\qquad t=\frac{\ln 2}{0.05}\approx 13.9\ \text{years}$$
and after 30 years the balance is $1000\,e^{1.5} \approx$ €4482, roughly four and a half times the deposit.
The same equation with $k < 0$ describes decay: a substance whose half-life is 2 hours leaves an eighth of its original amount after 6 hours, because three half-lives have passed. Radioactive dating, drug elimination, and the discharge of a capacitor are all the same model.[1]
Newton's law of cooling: decay towards a fixed level
Growth and decay need not head towards zero; many quantities move towards a fixed level instead. A hot object cools at a rate proportional to the gap between its temperature and that of the room, not to its own temperature. This is Newton's law of cooling:
where $T(t)$ is the temperature of the object, $T_{a}$ the (constant) room temperature and $k > 0$. If $T > T_{a}$ the right-hand side is negative, so the object cools; if $T < T_{a}$ it warms. The equation is separable: moving the $T$-dependent factor to the left and integrating,
$$\int\frac{dT}{T-T_{a}}=\int -k\,dt\qquad\Longrightarrow\qquad \ln|T-T_{a}|=-kt+C$$
Exponentiating both sides,
$$|T-T_{a}|=e^{-kt+C}=e^{C}e^{-kt}$$
For an object hotter than the room, $T - T_{a} > 0$ throughout, so the absolute value can be dropped, and absorbing $e^{C}$ into the initial temperature difference $T_{0} - T_{a}$ gives
$$T(t)=T_{a}+\left(T_{0}-T_{a}\right)e^{-kt}$$
So it is the temperature gap, not the temperature, that decays exponentially. As $t$ grows the gap shrinks towards zero: the formula predicts that the object approaches room temperature but never quite reaches it.
A concrete example. A cup of coffee is at $80\,^{\circ}\mathrm{C}$ in a room at $20\,^{\circ}\mathrm{C}$, and after 10 minutes it has cooled to $50\,^{\circ}\mathrm{C}$. The initial gap $T_{0} - T_{a} = 60$ has halved to 30 in those 10 minutes, so the gap halves every 10 minutes and
$$T(t)=20+60\cdot 2^{-t/10}$$
with $t$ in minutes. After 20 minutes the gap is a quarter of its original value, so the coffee is at $20 + 15 = 35\,^{\circ}\mathrm{C}$. After an hour the temperature is $20 + 60/64 \approx 20.9\,^{\circ}\mathrm{C}$, barely above room temperature; the formula says it will cool more and more slowly, approaching $20\,^{\circ}\mathrm{C}$ without ever quite arriving.[1]
The harmonic oscillator: equations whose solutions oscillate
Some quantities do not settle towards a level but swing back and forth. Consider a mass $m$ attached to a spring. If the spring is displaced a distance $x$ from its rest position, it pulls back with a force $-kx$ proportional to the displacement (Hooke's law), where the spring constant $k$ measures how stiff the spring is. Newton's second law therefore gives
$$m\frac{d^{2}x}{dt^{2}}=-kx\qquad\Longrightarrow\qquad\frac{d^{2}x}{dt^{2}}+\frac{k}{m}x=0$$
Writing $\omega_{0}^{2} = k/m$, this becomes the harmonic oscillator equation:
The equation asks for a function whose second derivative is a negative constant multiple of itself, and the sine and cosine have exactly this property. Differentiating $\cos(\omega_{0}t)$ twice brings out two factors of $\omega_{0}$ and a minus sign:
$$\frac{d}{dt}\cos(\omega_{0}t)=-\omega_{0}\sin(\omega_{0}t),\qquad \frac{d^{2}}{dt^{2}}\cos(\omega_{0}t)=-\omega_{0}^{2}\cos(\omega_{0}t)$$
so $x = \cos(\omega_{0}t)$ solves the equation, and so does $x = \sin(\omega_{0}t)$. Because the equation is linear and homogeneous, the superposition principle applies and the general solution is
$$x(t)=A\cos(\omega_{0}t)+B\sin(\omega_{0}t)$$
The two constants $A$ and $B$ are fixed by the initial displacement and the initial velocity, exactly as the order of the equation requires.

A concrete example. Take a mass of $2\ \mathrm{kg}$ on a spring with $k = 8\ \mathrm{N/m}$, so that $\omega_{0} = \sqrt{k/m} = \sqrt{4} = 2$ radians per second. Pull the mass $10\ \mathrm{cm}$ out and release it from rest: the initial velocity is zero, so $B = 0$, and $x(t) = 0.10\cos(2t)$ metres. The motion repeats after one period
$$P=\frac{2\pi}{\omega_{0}}=\pi\ \text{seconds}\approx 3.14\ \text{s}$$
so the mass returns to its starting point roughly every 3.14 seconds. One second after release, measuring angles in radians,
$$x(1)=0.10\cos(2)\approx 0.10\times(-0.416)\approx -0.042\ \text{m}$$
about 4 cm on the other side of the rest position. This kind of motion, a sinusoid of fixed amplitude, is called simple harmonic motion, and the oscillator equation governs not only springs but pendulums (for small swings), electric circuits, and the vibrations of molecules.[2]
When no formula can be found
The equations solved above are the standard cases taught in a first course, and they are the exception rather than the rule. Most differential equations, and almost all nonlinear ones, cannot be solved by any combination of familiar functions, however cleverly combined. Realistic models are therefore studied in one of three ways:
- if approximate numbers are wanted, the solution is stepped forward numerically, one small interval at a time (see the article Euler's method);
- if the behaviour matters more than the numbers, the equation is studied geometrically, through its slope fields, equilibria, stability, and long-term behaviour (see the article Qualitative methods);
- for special linear equations, solutions can be expressed as infinite series or recovered by integral transforms (see the articles Power series and Laplace transform).
The choice between these routes is part of the art of applying mathematics, and is treated in full in the standard textbooks.[1][3]
A short history

Differential equations arose together with the calculus developed by Isaac Newton and Gottfried Wilhelm Leibniz in the second half of the 17th century. Newton's laws of motion, published in his Principia of 1687, are differential equations, and it is Leibniz's notation $dy/dx$, introduced in the same period, that is still used today. In the 18th century Leonhard Euler turned a collection of ad hoc tricks into a systematic theory, developing the solution of linear equations with constant coefficients, series methods, and the first numerical integration scheme, which still bears his name.[2]

Alongside the theory of ordinary equations, the physics of the 18th and 19th centuries produced the partial differential equations: Jean le Rond d'Alembert wrote down and solved the wave equation of the vibrating string in the 1740s, and Joseph Fourier derived the heat equation from the physics of conduction and solved it with trigonometric series in his Théorie analytique de la chaleur of 1822, founding Fourier analysis.[4]
Two developments of the 20th century completed the modern picture. On the one hand, numerical computing made it possible to approximate the solutions of equations that cannot be solved in formulas. On the other, the geometric ideas of Henri Poincaré, who studied the three-body problem of celestial mechanics at the end of the 19th century, grew into the qualitative theory of dynamical systems, in which equilibria, stability, and long-term behaviour are studied without solving the equations. In 1963 the meteorologist Edward Lorenz found chaotic behaviour in a simple system of three differential equations modelling atmospheric convection: although the equations were deterministic, their solutions were aperiodic and so sensitive to initial conditions that long-term weather prediction is impossible in practice.[3]
References
- ↑ ↑ ↑ ↑ Boyce, W. E. (2012). Elementary Differential Equations and Boundary Value Problems (Book). In Elementary Differential Equations and Boundary Value Problems (Book). John Wiley & Sons.
- ↑ ↑ Tenenbaum, M. (1985). Ordinary Differential Equations (Book). In Ordinary Differential Equations (Book). Dover Publications.
- ↑ ↑ Strogatz, S. H. (2015). Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering (Book). In Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering (Book). Westview Press.
- ↑ Strauss, W. A. (2008). Partial Differential Equations: An Introduction (Book). In Partial Differential Equations: An Introduction (Book). John Wiley & Sons.
Further reading
- Differential equation, Wikipedia
- Differential Equation, Wolfram MathWorld
- 18.03SC Differential Equations, MIT OpenCourseWare
- Leonhard Euler, MacTutor History of Mathematics