Differential equation: Difference between revisions

From Wikibase
Jump to navigation Jump to search
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)
No edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''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.
'''A differential equation''' is an equation whose unknown is a function and which also involves that function's derivatives (rates of change). Where an ordinary equation such as $x^2=9$ is solved by numbers, a differential equation such as $y'+2y=0$ is solved by functions $y(x)$.


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 surprising number of laws of nature can be described by differential equations: pendulums, cooling drinks, growing populations, and discharging capacitors.  


== A first example: slopes and a family of solutions ==
== General and specific solution ==


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:
The simplest differential equation prescribes the slope of a function $y(x)$:


$$\frac{dy}{dx}=2x$$
$$\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$.
Integrating both sides gives


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 unknown constant. Therefore, the solution is not one single function, but a family of functions, known as the '''general solution'''.
 
If we know the value of $y$ at a particular $x$, for instance, $y(0)=3$, then a '''particular solution''' function can be identified
 
$$3=0^2+C\qquad\Longrightarrow\qquad C=3\qquad\Longrightarrow\qquad y=x^2+3$$
 
A prescribed value such as $y(a)=b$ allowing us to pin down a particular solution is called an '''initial condition'''.
 
== Classifying differential equations ==
 
A differential equation can be classified by three criteria: its '''order''', its '''linearity''', and how many independent variables it involves.
 
=== Order ===
 
The order is the order of the highest derivative present.
 
$\frac{dy}{dx}=2x$ is first order, whereas Newton's second law,
 
{{#content:Q1583}}
 
is second order ($x(t)$ position of mass $m$, $F$ net force).
 
=== Linearity and homogeneity ===
 
An equation is '''linear''' when the unknown and its derivatives appear only to the first power and never multiplied together. A linear first-order equation can always be written
 
$$\frac{dy}{dx}+p(x)\,y=q(x)$$
 
It is said to be '''homogeneous''' when $q(x)=0$.
 
<blockquote>
The equations $dy/dx=y^2$ and $d^2\theta/dt^2+\sin\theta=0$ are nonlinear (square of $y$; sine of $\theta$).
</blockquote>
 
An important property of linear homogeneous equation is the '''superposition principle'''. If $y_1,y_2$ solve a homogeneous linear equation, so does $c_1y_1+c_2y_2$.
 
For a nonlinear equation, the same principle usually does not apply: if $y'=y^2$ has two solutions $y_1'=y_1^2$ and $y_2'=y_2^2$
 
$$(y_1+y_2)'=y_1^2+y_2^2\neq (y_1+y_2)^2$$
 
so $y_1+y_2$ does not solve $y'=y^2$.
 
=== Ordinary and partial ===
 
An '''ordinary differential equation''' (ODE) has one independent variable. A '''partial differential equation''' (PDE) has several, with partial derivatives. All the examples we have seen above are ordinary differential equations. For an example of a partial differential equation, we can take the heat equation describing the temperature $u$ of an insulated metal bar, according to position $x$ on the metal bar and time $t$


$$\int\frac{dy}{dx}\,dx=\int 2x\,dx\qquad\Longrightarrow\qquad y(x)=x^{2}+C$$
{{#content:Q1590}}


where $C$ is an arbitrary constant, because differentiating $x^2 + C$ gives $2x$ for every value of $C$:
where $\alpha$ is the thermal diffusivity.


$$\frac{d}{dx}\left(x^{2}+C\right)=2x$$
== Direction field ==


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'''.
A first-order equation can be written


Two features are common to all differential equations, and both are visible in this tiny example:
{{#content:Q1581}}


* the unknown is a function, not a number;
assigning to each point $(x,y)$ the slope $f(x,y)$ a solution must have there. Drawing short segments of that slope gives a '''direction field'''. Solution curves must run tangent to the direction field for every point they pass through.
* 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:
[[File:Slope field of exponential growth.png|thumb|Direction field of $dy/dx=y$. Credit: jjbeard (public domain).]]


$$3=0^{2}+C\qquad\Longrightarrow\qquad C=3$$
== Solving differential equations ==


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'''.
Just like there is no general formula solving all algebraic equations, there is no general method permitting the solution of all differential equations. However, some standard methods exist for solving a restricted class of simple differential equations.


== Types of differential equations ==
=== First-order ODEs ===


=== Order ===
==== Method 1: separable equations ====


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.
'''General case.''' A first-order equation is separable when it can be rewritten as the equality of the derivative to the product of two functions, one containing only $x$, one containing only $y$.


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:Q1612}}


{{#content:Q1583}}
after which both integrals can be evaluated directly.


where $x(t)$ is the position of a body of mass $m$ and $F$ is the net force.
'''Example: exponential growth and decay.''' A quantity whose rate of change is proportional to its own size, such as an unchecked population or a radioactive sample, obeys


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
{{#content:Q1584}}


$$m\frac{d^{2}x}{dt^{2}}=-mg\qquad\Longrightarrow\qquad\frac{d^{2}x}{dt^{2}}=-g$$
Separating variables and integrating,


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$:
$$\int\frac{dy}{y}=\int k\,dt\;\Longrightarrow\;\ln|y|=kt+C_1\;\Longrightarrow\;y=Ce^{kt}$$


$$\frac{dx}{dt}=-gt+v_{0}$$
The initial condition $y(0)=y_0$ fixes $C=y_0$, giving


Integrating again gives the height, and introduces a second constant, $x_{0}$, the height at $t = 0$:
{{#content:Q1585}} (1)


$$x(t)=-\frac{g}{2}\,t^{2}+v_{0}t+x_{0}$$
Observing (1) we notice this is very well an exponential growth (k>0)/decay(k<0).


Two conditions, the initial height and the initial velocity, are needed to fix both constants.
'''Example: Newton's law of cooling.''' A hot object in a cooler room loses heat through its surface, and the larger the temperature gap, the faster it cools: The temperature of the object is modelled by


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$:
{{#content:Q1586}}


$$0=19.6-4.9\,t^{2}\qquad\Longrightarrow\qquad t=\sqrt{19.6/4.9}=2\ \text{seconds}$$
Separating variables and integrating,


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.
$$\int\frac{dT}{T-T_a}=-k\int dt\;\Longrightarrow\;\ln|T-T_a|=-kt+C\;\Longrightarrow\;T-T_a=Ce^{-kt}$$


=== Linear and nonlinear ===
so with $T(0)=T_0$, hence $C=T_0-T_a$,


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
$$T(t)=T_a+(T_0-T_a)e^{-kt}$$


$$\frac{dy}{dx}+p(x)\,y=q(x)$$
==== Method 2: linear first-order equations (integrating factor) ====


The equations
'''General case.''' For the linear equation


$$\frac{dy}{dx}=y^{2},\qquad \frac{d^{2}\theta}{dt^{2}}+\sin\theta=0$$
$$y'+p(x)\,y=q(x)$$


are nonlinear: the first contains the square of the unknown, the second the sine of it.
introduce the integrating factor $\mu=e^{\int p\,dx}$, chosen so that $\mu'=p\mu$; multiplying by $\mu$ collapses the left-hand side into a single derivative:


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).
{{#content:Q1613}}


=== Ordinary and partial ===
Integrating both sides,


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
$$\mu y=\int\mu\,q\,dx+C\;\Longrightarrow\;y=\frac{1}{\mu}\int\mu\,q\,dx+\frac{C}{\mu}$$


$$\frac{\partial u}{\partial t}=\alpha\,\frac{\partial^{2}u}{\partial x^{2}}$$
If you notice, the first term $y=\frac{1}{\mu}\int\mu\,q\,dx$$\frac{C}{\mu}$ provides one particular solution to the non-homogeneous equation, and the second term, $C/\mu=Ce^{-\int p\,dx}$, is a solution to the homogeneous counter par of the original equation: $y'+p(x)\,y=0$. It generalises the solution to the entire solution family.


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.
This is in fact a general principle: $y=y_p+y_h$, i.e., the solution family of a non-homogeneous equation is the sum of one particular solution plus the solution to its homogeneous counterpart.


== Slope fields: seeing the solutions without formulas ==
To see the method in action, consider


A first-order equation solved for its derivative reads
$$ \frac{dy}{dx} + \frac{1}{x}\,y = x^2, \qquad x>0. $$


{{#content:Q1581}}
Here $P(x)=1/x$, so


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.
$$ \mu(x)=e^{\int \frac{1}{x}\,dx}=e^{\ln x}=x. $$


[[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).]]
Multiply the whole equation by $\mu(x)=x$:


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>
$$ x\frac{dy}{dx} + y = x^3. $$


== Separable equations: growth and decay ==
The left side is exactly the derivative of the product $x\,y$:


The first family of equations that can always be solved are the '''separable''' ones, those of the form
$$ \frac{d}{dx}\bigl(xy\bigr) = x^3. $$


{{#content:Q1612}}
Integrate with respect to $x$:


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.
$$ xy = \int x^3\,dx = \frac{x^4}{4} + C. $$


The single most important separable equation is the one describing a quantity that changes at a rate proportional to its own size:
Finally, divide by $x$ to obtain the general solution:


{{#content:Q1584}}
$$ y = \frac{x^3}{4} + \frac{C}{x}. $$


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,
A quick substitution verifies that this function family satisfies the original equation. The arbitrary constant $C$ can be determined later if an initial condition $y(x_0)=y_0$ is given.


$$\frac{1}{y}\frac{dy}{dt}=k\qquad\Longrightarrow\qquad\int\frac{dy}{y}=\int k\,dt$$
==== Method 3: constant-coefficient linear equations (trial solutions) ====


gives $\ln|y| = kt + C$. Exponentiating both sides,
=== Second-order ODEs ===


$$|y|=e^{kt+C}=e^{C}e^{kt}$$
==== Method 1: direct integration ====


and absorbing the constant into the initial amount $y_{0} = y(0)$ gives the general solution:
'''General case.''' For $y''=f(x)$,


{{#content:Q1585}}
$$y''=f(x)\;\Longrightarrow\;y'=\int f(x)\,dx+C_1\;\Longrightarrow\;y=\int\!\!\left(\int f(x)\,dx\right)dx+C_1x+C_2$$


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$.
and likewise $y^{(n)}=f(x)$ by $n$ integrations.


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
'''Example: free fall.''' A ball released above the ground falls under gravity alone, which accelerates it downward at the constant rate $g\approx 9.8\ \mathrm{m\,s^{-2}}$; Newton's second law gives the second-order equation $x''=-g$, of the form above with $f(x)=-g$. Integrating twice,


$$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}$$
$$x''=-9.8\;\Longrightarrow\;\frac{dx}{dt}=-9.8t+v_0\;\Longrightarrow\;x(t)=-4.9t^2+v_0t+x_0$$


and after 30 years the balance is $1000\,e^{1.5} \approx$ €4482, roughly four and a half times the deposit.
Numeric scenario: the ball is dropped from rest, $v_0=0$, at height $x_0=19.6\ \mathrm{m}$. It reaches the ground, $x=0$, when


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>
$$0=19.6-4.9t^2\;\Longrightarrow\;t=\sqrt{19.6/4.9}=2\ \text{s}$$


== Newton's law of cooling: decay towards a fixed level ==
so the two initial conditions have pinned down the whole trajectory.


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:
==== Method 2: linear equations with constant coefficients ====


{{#content:Q1586}}
'''General case.'''


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,
$$y''+a\,y'+b\,y=f(x)$$


$$\int\frac{dT}{T-T_{a}}=\int -k\,dt\qquad\Longrightarrow\qquad \ln|T-T_{a}|=-kt+C$$
'''Homogeneous case ($f=0$).''' The exponential trial $y=e^{rx}$,


Exponentiating both sides,
{{#content:Q1644}}


$$|T-T_{a}|=e^{-kt+C}=e^{C}e^{-kt}$$
gives the characteristic equation $r^2+ar+b=0$, whose roots determine $y_h$:


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
* $r_1\neq r_2$ real: $y_h=C_1e^{r_1x}+C_2e^{r_2x}$;
* $r_1=r_2=r$: $y_h=(C_1+C_2x)e^{rx}$;
* $r=\alpha\pm i\beta$: $y_h=e^{\alpha x}(C_1\cos\beta x+C_2\sin\beta x)$.


$$T(t)=T_{a}+\left(T_{0}-T_{a}\right)e^{-kt}$$
'''Non-homogeneous case ($f\neq 0$).''' $y=y_h+y_p$, with $y_p$ found by undetermined coefficients as in Method 3.


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.
'''Worked demonstration (homogeneous).''' $y''-3y'+2y=0$: $r^2-3r+2=(r-1)(r-2)=0$,


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
{{#content:Q1608}}


$$T(t)=20+60\cdot 2^{-t/10}$$
Check: $e^x$ gives $(1-3+2)e^x=0$.


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>
'''Worked demonstration (non-homogeneous).''' $y''-3y'+2y=2e^{3x}$: keep $y_h$ above, try $y_p=Ae^{3x}$:


== The harmonic oscillator: equations whose solutions oscillate ==
$$y_p''-3y_p'+2y_p=(9-9+2)Ae^{3x}=2Ae^{3x}\;\Longrightarrow\;A=1$$


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
$$y=C_1e^x+C_2e^{2x}+e^{3x}$$


$$m\frac{d^{2}x}{dt^{2}}=-kx\qquad\Longrightarrow\qquad\frac{d^{2}x}{dt^{2}}+\frac{k}{m}x=0$$
'''Example: the harmonic oscillator (a mass on a spring).''' A mass attached to a spring is pulled back towards its rest position by a force $-kx$ proportional to the displacement (Hooke's law); once released it oscillates. Newton's second law models the motion,


Writing $\omega_{0}^{2} = k/m$, this becomes the '''harmonic oscillator equation''':
$$m\frac{d^2x}{dt^2}=-kx\;\Longrightarrow\;x''+\omega_0^2x=0,\qquad \omega_0=\sqrt{\frac{k}{m}}$$


{{#content:Q1588}}
{{#content:Q1588}}


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:
The trial $x=e^{rt}$ gives the characteristic equation $r^2+\omega_0^2=0$ with roots $r=\pm i\omega_0$, the complex-pair case with $\alpha=0$, hence
 
$$x(t)=A\cos\omega_0t+B\sin\omega_0t$$
 
with $A,B$ fixed by the initial position and velocity.
 
[[File:Simple harmonic motion animation.gif|thumb|A mass on a spring: the harmonic oscillator solution is a sinusoid of fixed amplitude. Credit: Evil saltine (public domain).]]
 
Numeric scenario: a mass $m=2\ \mathrm{kg}$ hangs on a spring with $k=8\ \mathrm{N\,m^{-1}}$, so $\omega_0=\sqrt{8/2}=2\ \mathrm{rad\,s^{-1}}$ and the displacement obeys $x''+4x=0$. Pulled $0.10\ \mathrm{m}$ from rest and released, the conditions $x(0)=0.10$, $x'(0)=0$ give $A=0.10$, $B=0$:
 
$$x(t)=0.10\cos 2t\ \mathrm{m},\qquad P=\frac{2\pi}{\omega_0}=\pi\approx 3.14\ \text{s}$$
 
After one second $x(1)=0.10\cos 2\approx -0.042\ \mathrm{m}$, and the motion is '''simple harmonic motion'''.<ref>{{#cite:Q1577}}</ref>
 
=== Partial differential equations ===
 
Two standard techniques give closed-form solutions of linear PDEs: separation of variables, for separable problems on bounded domains, and the method of characteristics, for first-order equations. The wave equation is also solved by the second technique, because its operator factors into two first-order parts. Both methods below are stated in general and then applied to a concrete equation.
 
==== Method 1: separation of variables ====
 
'''General form.''' For a linear homogeneous PDE in two variables on a bounded domain with homogeneous boundary conditions, seek a solution of the separated form
 
$$u(x,t)=X(x)\,T(t)$$
 
Substituting into the PDE and dividing by $XT$ separates the variables into one ordinary differential equation in $x$ and one in $t$. Since the two sides are functions of different variables, they can be identically equal only if each equals the same constant, the separation constant $-\lambda$. The $x$-equation together with the boundary conditions is an eigenvalue problem: only a discrete sequence of constants $\lambda_n$, with eigenfunctions $X_n(x)$, is admissible. The $t$-equation then has a solution $T_n(t)$ for each $n$, and every product $X_nT_n$ solves the PDE.
 
'''General algebraic solution.''' The PDE is linear and homogeneous, so the separated modes superimpose:
 
$$u(x,t)=\sum_n c_n\,X_n(x)\,T_n(t)$$
 
with the coefficients $c_n$ chosen so that the series equals the initial profile $u(x,0)$; orthogonality of the eigenfunctions $X_n$ determines them.
 
'''Example: the heat equation.''' The temperature of a bar of length $L$ with insulated sides and both ends held at $0$ obeys
 
$$\frac{\partial u}{\partial t}=\alpha\frac{\partial^2u}{\partial x^2},\qquad u(0,t)=u(L,t)=0$$
 
Substituting $u=X(x)T(t)$ gives $XT'=\alpha X''T$, and dividing by $\alpha XT$,
 
{{#content:Q1622}}
 
The $t$-equation $T'=-\alpha\lambda T$ has solution $T=e^{-\alpha\lambda t}$, and the $x$-equation
 
$$X''=-\lambda X\;\Longrightarrow\;X=A\cos(\sqrt\lambda\,x)+B\sin(\sqrt\lambda\,x)$$
 
together with the boundary conditions forces $X(0)=X(L)=0$: hence $A=0$ and $\sin(\sqrt\lambda\,L)=0$, so $\sqrt\lambda\,L=n\pi$, $n=1,2,\dots$. Each $\lambda=(n\pi/L)^2$ gives one mode
 
$$u_n(x,t)=\sin\frac{n\pi x}{L}\,e^{-\alpha(n\pi/L)^2t}$$
 
and the general algebraic solution above becomes
 
{{#content:Q1611}}
 
with $b_n$ determined by the Fourier sine series of the initial profile $u(x,0)$; the decay rate $\alpha(n\pi/L)^2$ grows as $n^2$.
 
Numeric scenario: a $1\ \mathrm{m}$ iron bar, heated so that its centre is at $100\,^{\circ}\mathrm{C}$ while both ends are held at $0\,^{\circ}\mathrm{C}$, cools by conduction with iron's diffusivity $\alpha\approx 2.3\times10^{-5}\ \mathrm{m^2s^{-1}}$. The initial profile $u(x,0)=100\sin(\pi x/L)$ is exactly the first mode, so only $n=1$ contributes and
 
$$u(x,t)=100\sin\frac{\pi x}{L}\,e^{-\alpha\pi^2t/L^2}$$
 
At the centre, with $L=1$ and $\alpha\pi^2\approx 2.3\times10^{-4}\ \text{s}^{-1}$,
 
$$u\!\left(\tfrac12,t\right)=100\,e^{-2.3\times10^{-4}t}$$
 
so after one hour $u\approx 100e^{-0.82}\approx 44\,^{\circ}\mathrm{C}$, and $50\,^{\circ}\mathrm{C}$ is reached at $t=\ln 2/(2.3\times10^{-4})\approx 3050\ \text{s}\approx 51$ min.<ref>{{#cite:Q1579}}</ref>
 
==== Method 2: the method of characteristics ====
 
'''General form.''' The method of characteristics solves first-order PDEs by tracing curves along which the PDE reduces to ordinary differential equations. In two independent variables the general quasilinear first-order equation is
 
$$A(x,t,u)\,u_x+B(x,t,u)\,u_t=C(x,t,u)$$
 
A solution $u=u(x,t)$ is a surface in $(x,t,u)$-space. Its tangent plane at each point is spanned by $(1,0,u_x)$ and $(0,1,u_t)$, so a vector $(A,B,C)$ is tangent to the surface exactly when $C=A u_x+B u_t$, the condition expressed by the PDE itself. The solution surface is therefore swept out by the integral curves of the vector field $(A,B,C)$, the characteristic curves, which solve the characteristic system of ordinary differential equations
 
$$\frac{dx}{ds}=A(x,t,u),\qquad \frac{dt}{ds}=B(x,t,u),\qquad \frac{du}{ds}=C(x,t,u)$$
 
Given data on a curve that is not itself characteristic, such as $u(x,0)=u_0(x)$, one characteristic issues from each point of the curve, and integrating the system carries the data across the region the characteristics cover. For the linear homogeneous case
 
$$a(x,t)\,u_x+b(x,t)\,u_t=0$$
 
the $x$- and $t$-equations do not involve $u$, and the third gives $du/ds=0$: the solution is constant along each characteristic. The characteristics form a one-parameter family; let $\psi(x,t)=\text{const}$ be a first integral, a function constant on each member of the family.


$$\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)$$
'''General algebraic solution.''' Since $u$ is constant on every characteristic and the characteristics are the level sets of $\psi$, the general solution is an arbitrary function of the first integral,


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
$$u(x,t)=F\bigl(\psi(x,t)\bigr)$$


$$x(t)=A\cos(\omega_{0}t)+B\sin(\omega_{0}t)$$
with $F$ fixed by the initial data. When the right-hand side of the PDE is nonzero, $u$ changes along a characteristic at the rate $C$ (or of the given source term), so the general solution acquires an integral of that term along the curve.


The two constants $A$ and $B$ are fixed by the initial displacement and the initial velocity, exactly as the order of the equation requires.
'''Example: transport of a pollutant.''' For constant coefficients $c$ the equation $u_t+c\,u_x=0$ has characteristics $dx/dt=c$, the straight lines $x-ct=\text{const}$; hence $\psi=x-ct$, and the general algebraic solution is the travelling wave


[[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).]]
$$u(x,t)=F(x-ct),\qquad u(x,0)=F(x)$$


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
A river flows steadily at speed $c=2\ \mathrm{m\,s^{-1}}$, and a factory releases a concentrated slug of pollutant at one point; as long as mixing and diffusion are negligible, the current simply carries the whole slug downstream without changing it. The concentration obeys $u_t+2u_x=0$ with the Gaussian initial profile


$$P=\frac{2\pi}{\omega_{0}}=\pi\ \text{seconds}\approx 3.14\ \text{s}$$
$$u(x,0)=50\,e^{-(x/10)^2}\ \mathrm{mg\,L^{-1}}$$


so the mass returns to its starting point roughly every 3.14 seconds. One second after release, measuring angles in radians,
(peak $50\ \mathrm{mg\,L^{-1}}$ at the release point, falling by $e^{-1}$ ten metres away). The solution above gives


$$x(1)=0.10\cos(2)\approx 0.10\times(-0.416)\approx -0.042\ \text{m}$$
$$u(x,t)=50\,e^{-((x-2t)/10)^2}\ \mathrm{mg\,L^{-1}}$$


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>
After one minute the peak has moved from $x=0$ to $x=ct=120\ \mathrm{m}$, still reading $50\ \mathrm{mg\,L^{-1}}$; pure transport does not spread the slug, which would require the second-order term $\alpha u_{xx}$ of the heat equation. With a source $q(x,t)$, the value accumulates along each characteristic:


== When no formula can be found ==
$$u(x,t)=F(x-ct)+\int_0^t q\bigl(x-c(t-\tau),\tau\bigr)\,d\tau$$


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:
'''Example: the wave equation.''' The wave equation


* if approximate numbers are wanted, the solution is stepped forward numerically, one small interval at a time (see the article [[Euler's method]]);
$$u_{tt}=c^2u_{xx}$$
* 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]]).
is second order, yet its operator factors into two first-order transport operators, so the method of characteristics still applies. Introduce the characteristic coordinates
 
$$\xi=x-ct,\qquad \eta=x+ct$$
 
in which the operator becomes $u_{tt}-c^2u_{xx}=-4c^2u_{\xi\eta}$, so the equation reads $u_{\xi\eta}=0$. Hence $u_\xi$ depends on $\xi$ alone, and one further integration gives the general algebraic solution (d'Alembert, 1747):
 
$$u(x,t)=f(x-ct)+g(x+ct)$$
 
a superposition of two travelling waves, one in each direction. The functions $f,g$ are fixed by the initial displacement and velocity: for a string released from rest with initial displacement $\phi(x)$, the conditions $u(x,0)=\phi(x)$ and $u_t(x,0)=0$ give $f=g=\phi/2$, so
 
$$u(x,t)=\frac{\phi(x-ct)+\phi(x+ct)}{2}$$
 
and the initial hump separates into two half-size copies travelling apart at speed $c$.<ref>{{#cite:Q1579}}</ref>
 
=== When no formula exists ===
 
Most equations, especially nonlinear ones, fit none of the classes above and have no solution in terms of familiar functions. They are studied in one of three ways:<ref>{{#cite:Q1576}}</ref><ref>{{#cite:Q1578}}</ref>
 
* '''Numerically''', when numbers suffice: [[Euler's method]] steps along the slope field;
* '''[[Qualitative methods]]''': equilibria, stability and long-term behaviour, without formulas;
* '''Series and transforms''', for linear cases: [[Power series]] or the [[Laplace transform]].


<uml type="uml">
<uml type="uml">
Line 202: Line 347:
skinparam monochrome true
skinparam monochrome true
start
start
:Given a differential equation;
:You have a differential equation;
if (Can you separate the variables, or recognise\nexponential or sinusoidal solutions?) then (yes)
if (First order and separable?\ny' = g(x) h(y)?) then (yes)
   :Elementary solution:\na formula (a whole family of solutions);
   :Separate and integrate:\n∫ dy/h(y) = ∫ g(x) dx;
else (no)
else (no)
   if (Approximate numbers are enough?) then (yes)
   if (First order and linear?\ny' + p(x) y = q(x)?) then (yes)
     :Numerical stepping\n(article: Euler's method);
     if (Constant coefficients?\ny' + a y = q(x)?) then (yes)
      :Trial solution:\ny_h = C e^{-ax} + guessed y_p;
    else (no)
      :Integrating factor\nμ = e^{∫ p dx};
    endif
   else (no)
   else (no)
     if (The equation is linear and a series or\nintegral-transform formula may exist?) then (yes)
     if (Second order, of the form\ny'' = f(x)?) then (yes)
       :Series and transform methods\n(articles: Power series, Laplace transform);
       :Integrate twice;
     else (no)
     else (no)
       :Study the behaviour instead:\nequilibria, stability, chaos\n(article: Qualitative methods);
       if (Second order, linear, constant coefficients?\ny'' + a y' + b y = 0? or = f(x)?) then (yes)
        :Characteristic equation\nr² + a r + b = 0;\nthen add a particular y_p;
      else (no)
        if (Transport equation?\nu_t + c u_x = 0?) then (yes)
          :Travelling wave\nu(x,t) = f(x - ct);
        else (no)
          if (Linear PDE on a simple shape,\ne.g. the heat equation?) then (yes)
            :Separate variables\nu(x,t) = X(x) T(t);
          else (no)
            if (Are approximate numbers enough?) then (yes)
              :Numerical stepping\n(Euler's method);
            else (no)
              if (Linear?) then (yes)
                :Power series or Laplace transform;
              else (no)
                :Qualitative study:\nequilibria, stability, chaos;
              endif
            endif
          endif
        endif
      endif
     endif
     endif
   endif
   endif
Line 220: Line 389:
</uml>
</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>
The exact methods occupy the branches on the left; most equations encountered in research fall through to the routes on the right, each treated in its own article.


== A short history ==
== 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).]]
The origins of differential equations coincide with those of the calculus, since the calculus supplies the language in which rates of change are expressed and inverted. Newton's laws of motion and of universal gravitation, published in the ''Philosophiae Naturalis Principia Mathematica'' (1687), are differential equations; Newton treated them by the geometrical and infinite-series methods of his fluxional calculus. Although Newton developed a notation for fluxions, the differential notation $dy/dx$ introduced by Leibniz in the 1670s proved the more enduring: it exhibits the structure of the equation directly and is the notation adopted in this article.<ref>{{#cite:Q1577}}</ref>
 
[[File:Isaac Newton portrait.jpg|thumb|left|Isaac Newton (portrait after Godfrey Kneller, 1689). Newton's laws of motion and of gravitation (''Principia'', 1687) are differential equations. Credit: James Thronill after Godfrey Kneller (public domain).]]


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>
The consolidation of these techniques into a systematic theory is due in large measure to [[Person:Leonhard Euler|Leonhard Euler]], whose work in the middle decades of the eighteenth century established the principal exact methods. Euler showed that linear equations with constant coefficients are solved by the substitution $y=e^{rx}$, which reduces the problem to an algebraic equation, and he advanced the theory of series solutions. For equations that admitted no closed-form solution, he introduced the step-by-step numerical procedure, described above as Euler's method, that bears his name. The exact methods presented in this article derive, in large part, from his work.<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 in the 18th century. Credit: Jakob Emanuel Handmann (public domain).]]
[[File:Leonhard Euler portrait.jpg|thumb|Leonhard Euler (portrait by Jakob Emanuel Handmann, 1753). Credit: Jakob Emanuel Handmann (public domain).]]


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>
The theory of partial differential equations arose from the demands of eighteenth-century physics. In 1747, [[Person:Jean le Rond d'Alembert|Jean le Rond d'Alembert]] derived the wave equation for the vibrating string and established that its general solution consists of two waves propagating in opposite directions. The problem of heat conduction proved more demanding, because the initial temperature distribution of a conducting body is arbitrary. In his ''Théorie analytique de la chaleur'' (1822), [[Person:Joseph Fourier|Joseph Fourier]] derived the heat equation from the physical principles of conduction and solved it by expanding the initial data into a trigonometric series. This work established separation of variables as a standard technique of mathematical physics, and the Fourier series introduced for the purpose has since become fundamental to the analysis of periodic phenomena, from acoustics to signal processing.<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>
The limits of closed-form methods became apparent towards the end of the nineteenth century, and the later history of the subject is concerned principally with equations for which elementary solutions do not exist. In his investigation of the three-body problem of celestial mechanics, [[Person:Henri Poincaré|Henri Poincaré]] demonstrated that qualitative properties of the motion, such as its equilibria, stability, and long-term behaviour, can be characterised without solving the equations, thereby founding the qualitative theory of dynamical systems. The subsequent development of electronic computing made numerical approximation, of which Euler's method is the simplest instance, a routine and general technique. The two strands converged in 1963, when [[Person:Edward Lorenz|Edward Lorenz]], studying a simplified system of three ordinary differential equations that models atmospheric convection, established the phenomenon of deterministic chaos: although the equations are deterministic, their solutions are aperiodic and depend so sensitively on initial conditions that long-term weather prediction is not feasible in practice. These later approaches, qualitative analysis, numerical approximation, and series and transform methods, are treated in dedicated articles.<ref>{{#cite:Q1578}}</ref>


== References ==
== References ==

Latest revision as of 11:56, 7 September 2026

Languages: English · français · Esperanto

A differential equation is an equation whose unknown is a function and which also involves that function's derivatives (rates of change). Where an ordinary equation such as $x^2=9$ is solved by numbers, a differential equation such as $y'+2y=0$ is solved by functions $y(x)$.

A surprising number of laws of nature can be described by differential equations: pendulums, cooling drinks, growing populations, and discharging capacitors.

General and specific solution

The simplest differential equation prescribes the slope of a function $y(x)$:

$$\frac{dy}{dx}=2x$$

Integrating both sides gives

$$\int\frac{dy}{dx}\,dx=\int 2x\,dx\qquad\Longrightarrow\qquad y(x)=x^{2}+C$$

Where $C$ is an unknown constant. Therefore, the solution is not one single function, but a family of functions, known as the general solution.

If we know the value of $y$ at a particular $x$, for instance, $y(0)=3$, then a particular solution function can be identified

$$3=0^2+C\qquad\Longrightarrow\qquad C=3\qquad\Longrightarrow\qquad y=x^2+3$$

A prescribed value such as $y(a)=b$ allowing us to pin down a particular solution is called an initial condition.

Classifying differential equations

A differential equation can be classified by three criteria: its order, its linearity, and how many independent variables it involves.

Order

The order is the order of the highest derivative present.

$\frac{dy}{dx}=2x$ is first order, whereas Newton's second law,

m\frac{d^{2}x}{dt^{2}}=F

is second order ($x(t)$ position of mass $m$, $F$ net force).

Linearity and homogeneity

An equation is linear when the unknown and its derivatives appear only to the first power and never multiplied together. A linear first-order equation can always be written

$$\frac{dy}{dx}+p(x)\,y=q(x)$$

It is said to be homogeneous when $q(x)=0$.

The equations $dy/dx=y^2$ and $d^2\theta/dt^2+\sin\theta=0$ are nonlinear (square of $y$; sine of $\theta$).

An important property of linear homogeneous equation is the superposition principle. If $y_1,y_2$ solve a homogeneous linear equation, so does $c_1y_1+c_2y_2$.

For a nonlinear equation, the same principle usually does not apply: if $y'=y^2$ has two solutions $y_1'=y_1^2$ and $y_2'=y_2^2$

$$(y_1+y_2)'=y_1^2+y_2^2\neq (y_1+y_2)^2$$

so $y_1+y_2$ does not solve $y'=y^2$.

Ordinary and partial

An ordinary differential equation (ODE) has one independent variable. A partial differential equation (PDE) has several, with partial derivatives. All the examples we have seen above are ordinary differential equations. For an example of a partial differential equation, we can take the heat equation describing the temperature $u$ of an insulated metal bar, according to position $x$ on the metal bar and time $t$

\frac{\partial u}{\partial t}=\alpha\frac{\partial^{2}u}{\partial x^{2}}

where $\alpha$ is the thermal diffusivity.

Direction field

A first-order equation can be written

\frac{dy}{dx}=f(x,y)

assigning to each point $(x,y)$ the slope $f(x,y)$ a solution must have there. Drawing short segments of that slope gives a direction field. Solution curves must run tangent to the direction field for every point they pass through.

Direction field of $dy/dx=y$. Credit: jjbeard (public domain).

Solving differential equations

Just like there is no general formula solving all algebraic equations, there is no general method permitting the solution of all differential equations. However, some standard methods exist for solving a restricted class of simple differential equations.

First-order ODEs

Method 1: separable equations

General case. A first-order equation is separable when it can be rewritten as the equality of the derivative to the product of two functions, one containing only $x$, one containing only $y$.

\frac{dy}{dx}=g(x)\,h(y)\qquad\Longrightarrow\qquad\int\frac{dy}{h(y)}=\int g(x)\,dx

after which both integrals can be evaluated directly.

Example: exponential growth and decay. A quantity whose rate of change is proportional to its own size, such as an unchecked population or a radioactive sample, obeys

\frac{dy}{dt}=k\,y

Separating variables and integrating,

$$\int\frac{dy}{y}=\int k\,dt\;\Longrightarrow\;\ln|y|=kt+C_1\;\Longrightarrow\;y=Ce^{kt}$$

The initial condition $y(0)=y_0$ fixes $C=y_0$, giving

y(t)=y_{0}\,e^{kt} (1)

Observing (1) we notice this is very well an exponential growth (k>0)/decay(k<0).

Example: Newton's law of cooling. A hot object in a cooler room loses heat through its surface, and the larger the temperature gap, the faster it cools: The temperature of the object is modelled by

\frac{dT}{dt}=-k\bigl(T-T_{a}\bigr)

Separating variables and integrating,

$$\int\frac{dT}{T-T_a}=-k\int dt\;\Longrightarrow\;\ln|T-T_a|=-kt+C\;\Longrightarrow\;T-T_a=Ce^{-kt}$$

so with $T(0)=T_0$, hence $C=T_0-T_a$,

$$T(t)=T_a+(T_0-T_a)e^{-kt}$$

Method 2: linear first-order equations (integrating factor)

General case. For the linear equation

$$y'+p(x)\,y=q(x)$$

introduce the integrating factor $\mu=e^{\int p\,dx}$, chosen so that $\mu'=p\mu$; multiplying by $\mu$ collapses the left-hand side into a single derivative:

\frac{dy}{dx}+p(x)\,y=q(x),\text{multiply both sides by } \mu(x)=e^{\int p(x)\,dx}\;\Longrightarrow\;\frac{d}{dx}\bigl(\mu(x)\,y\bigr)=\mu(x)\,q(x)

Integrating both sides,

$$\mu y=\int\mu\,q\,dx+C\;\Longrightarrow\;y=\frac{1}{\mu}\int\mu\,q\,dx+\frac{C}{\mu}$$

If you notice, the first term $y=\frac{1}{\mu}\int\mu\,q\,dx$$\frac{C}{\mu}$ provides one particular solution to the non-homogeneous equation, and the second term, $C/\mu=Ce^{-\int p\,dx}$, is a solution to the homogeneous counter par of the original equation: $y'+p(x)\,y=0$. It generalises the solution to the entire solution family.

This is in fact a general principle: $y=y_p+y_h$, i.e., the solution family of a non-homogeneous equation is the sum of one particular solution plus the solution to its homogeneous counterpart.

To see the method in action, consider

$$ \frac{dy}{dx} + \frac{1}{x}\,y = x^2, \qquad x>0. $$

Here $P(x)=1/x$, so

$$ \mu(x)=e^{\int \frac{1}{x}\,dx}=e^{\ln x}=x. $$

Multiply the whole equation by $\mu(x)=x$:

$$ x\frac{dy}{dx} + y = x^3. $$

The left side is exactly the derivative of the product $x\,y$:

$$ \frac{d}{dx}\bigl(xy\bigr) = x^3. $$

Integrate with respect to $x$:

$$ xy = \int x^3\,dx = \frac{x^4}{4} + C. $$

Finally, divide by $x$ to obtain the general solution:

$$ y = \frac{x^3}{4} + \frac{C}{x}. $$

A quick substitution verifies that this function family satisfies the original equation. The arbitrary constant $C$ can be determined later if an initial condition $y(x_0)=y_0$ is given.

Method 3: constant-coefficient linear equations (trial solutions)

Second-order ODEs

Method 1: direct integration

General case. For $y''=f(x)$,

$$y''=f(x)\;\Longrightarrow\;y'=\int f(x)\,dx+C_1\;\Longrightarrow\;y=\int\!\!\left(\int f(x)\,dx\right)dx+C_1x+C_2$$

and likewise $y^{(n)}=f(x)$ by $n$ integrations.

Example: free fall. A ball released above the ground falls under gravity alone, which accelerates it downward at the constant rate $g\approx 9.8\ \mathrm{m\,s^{-2}}$; Newton's second law gives the second-order equation $x''=-g$, of the form above with $f(x)=-g$. Integrating twice,

$$x''=-9.8\;\Longrightarrow\;\frac{dx}{dt}=-9.8t+v_0\;\Longrightarrow\;x(t)=-4.9t^2+v_0t+x_0$$

Numeric scenario: the ball is dropped from rest, $v_0=0$, at height $x_0=19.6\ \mathrm{m}$. It reaches the ground, $x=0$, when

$$0=19.6-4.9t^2\;\Longrightarrow\;t=\sqrt{19.6/4.9}=2\ \text{s}$$

so the two initial conditions have pinned down the whole trajectory.

Method 2: linear equations with constant coefficients

General case.

$$y''+a\,y'+b\,y=f(x)$$

Homogeneous case ($f=0$). The exponential trial $y=e^{rx}$,

y''+a\,y'+b\,y=0,\qquad y=e^{rx}\ \Rightarrow\ r^{2}+a\,r+b=0

gives the characteristic equation $r^2+ar+b=0$, whose roots determine $y_h$:

  • $r_1\neq r_2$ real: $y_h=C_1e^{r_1x}+C_2e^{r_2x}$;
  • $r_1=r_2=r$: $y_h=(C_1+C_2x)e^{rx}$;
  • $r=\alpha\pm i\beta$: $y_h=e^{\alpha x}(C_1\cos\beta x+C_2\sin\beta x)$.

Non-homogeneous case ($f\neq 0$). $y=y_h+y_p$, with $y_p$ found by undetermined coefficients as in Method 3.

Worked demonstration (homogeneous). $y''-3y'+2y=0$: $r^2-3r+2=(r-1)(r-2)=0$,

y''-3y'+2y=0\qquad\Longrightarrow\qquad y=C_{1}e^{x}+C_{2}e^{2x}

Check: $e^x$ gives $(1-3+2)e^x=0$.

Worked demonstration (non-homogeneous). $y''-3y'+2y=2e^{3x}$: keep $y_h$ above, try $y_p=Ae^{3x}$:

$$y_p''-3y_p'+2y_p=(9-9+2)Ae^{3x}=2Ae^{3x}\;\Longrightarrow\;A=1$$

$$y=C_1e^x+C_2e^{2x}+e^{3x}$$

Example: the harmonic oscillator (a mass on a spring). A mass attached to a spring is pulled back towards its rest position by a force $-kx$ proportional to the displacement (Hooke's law); once released it oscillates. Newton's second law models the motion,

$$m\frac{d^2x}{dt^2}=-kx\;\Longrightarrow\;x''+\omega_0^2x=0,\qquad \omega_0=\sqrt{\frac{k}{m}}$$

\frac{d^{2}x}{dt^{2}}+\omega_{0}^{2}x=0

The trial $x=e^{rt}$ gives the characteristic equation $r^2+\omega_0^2=0$ with roots $r=\pm i\omega_0$, the complex-pair case with $\alpha=0$, hence

$$x(t)=A\cos\omega_0t+B\sin\omega_0t$$

with $A,B$ fixed by the initial position and velocity.

A mass on a spring: the harmonic oscillator solution is a sinusoid of fixed amplitude. Credit: Evil saltine (public domain).

Numeric scenario: a mass $m=2\ \mathrm{kg}$ hangs on a spring with $k=8\ \mathrm{N\,m^{-1}}$, so $\omega_0=\sqrt{8/2}=2\ \mathrm{rad\,s^{-1}}$ and the displacement obeys $x''+4x=0$. Pulled $0.10\ \mathrm{m}$ from rest and released, the conditions $x(0)=0.10$, $x'(0)=0$ give $A=0.10$, $B=0$:

$$x(t)=0.10\cos 2t\ \mathrm{m},\qquad P=\frac{2\pi}{\omega_0}=\pi\approx 3.14\ \text{s}$$

After one second $x(1)=0.10\cos 2\approx -0.042\ \mathrm{m}$, and the motion is simple harmonic motion.[1]

Partial differential equations

Two standard techniques give closed-form solutions of linear PDEs: separation of variables, for separable problems on bounded domains, and the method of characteristics, for first-order equations. The wave equation is also solved by the second technique, because its operator factors into two first-order parts. Both methods below are stated in general and then applied to a concrete equation.

Method 1: separation of variables

General form. For a linear homogeneous PDE in two variables on a bounded domain with homogeneous boundary conditions, seek a solution of the separated form

$$u(x,t)=X(x)\,T(t)$$

Substituting into the PDE and dividing by $XT$ separates the variables into one ordinary differential equation in $x$ and one in $t$. Since the two sides are functions of different variables, they can be identically equal only if each equals the same constant, the separation constant $-\lambda$. The $x$-equation together with the boundary conditions is an eigenvalue problem: only a discrete sequence of constants $\lambda_n$, with eigenfunctions $X_n(x)$, is admissible. The $t$-equation then has a solution $T_n(t)$ for each $n$, and every product $X_nT_n$ solves the PDE.

General algebraic solution. The PDE is linear and homogeneous, so the separated modes superimpose:

$$u(x,t)=\sum_n c_n\,X_n(x)\,T_n(t)$$

with the coefficients $c_n$ chosen so that the series equals the initial profile $u(x,0)$; orthogonality of the eigenfunctions $X_n$ determines them.

Example: the heat equation. The temperature of a bar of length $L$ with insulated sides and both ends held at $0$ obeys

$$\frac{\partial u}{\partial t}=\alpha\frac{\partial^2u}{\partial x^2},\qquad u(0,t)=u(L,t)=0$$

Substituting $u=X(x)T(t)$ gives $XT'=\alpha X''T$, and dividing by $\alpha XT$,

u=X(x)\,T(t)\ \Rightarrow\ \frac{X''}{X}=\frac{T'}{\alpha\,T}=-\lambda

The $t$-equation $T'=-\alpha\lambda T$ has solution $T=e^{-\alpha\lambda t}$, and the $x$-equation

$$X''=-\lambda X\;\Longrightarrow\;X=A\cos(\sqrt\lambda\,x)+B\sin(\sqrt\lambda\,x)$$

together with the boundary conditions forces $X(0)=X(L)=0$: hence $A=0$ and $\sin(\sqrt\lambda\,L)=0$, so $\sqrt\lambda\,L=n\pi$, $n=1,2,\dots$. Each $\lambda=(n\pi/L)^2$ gives one mode

$$u_n(x,t)=\sin\frac{n\pi x}{L}\,e^{-\alpha(n\pi/L)^2t}$$

and the general algebraic solution above becomes

u(x,t)=\sum_{n=1}^{\infty}b_{n}\sin\Bigl(\frac{n\pi x}{L}\Bigr)\,e^{-\alpha (n\pi/L)^{2}t}

with $b_n$ determined by the Fourier sine series of the initial profile $u(x,0)$; the decay rate $\alpha(n\pi/L)^2$ grows as $n^2$.

Numeric scenario: a $1\ \mathrm{m}$ iron bar, heated so that its centre is at $100\,^{\circ}\mathrm{C}$ while both ends are held at $0\,^{\circ}\mathrm{C}$, cools by conduction with iron's diffusivity $\alpha\approx 2.3\times10^{-5}\ \mathrm{m^2s^{-1}}$. The initial profile $u(x,0)=100\sin(\pi x/L)$ is exactly the first mode, so only $n=1$ contributes and

$$u(x,t)=100\sin\frac{\pi x}{L}\,e^{-\alpha\pi^2t/L^2}$$

At the centre, with $L=1$ and $\alpha\pi^2\approx 2.3\times10^{-4}\ \text{s}^{-1}$,

$$u\!\left(\tfrac12,t\right)=100\,e^{-2.3\times10^{-4}t}$$

so after one hour $u\approx 100e^{-0.82}\approx 44\,^{\circ}\mathrm{C}$, and $50\,^{\circ}\mathrm{C}$ is reached at $t=\ln 2/(2.3\times10^{-4})\approx 3050\ \text{s}\approx 51$ min.[2]

Method 2: the method of characteristics

General form. The method of characteristics solves first-order PDEs by tracing curves along which the PDE reduces to ordinary differential equations. In two independent variables the general quasilinear first-order equation is

$$A(x,t,u)\,u_x+B(x,t,u)\,u_t=C(x,t,u)$$

A solution $u=u(x,t)$ is a surface in $(x,t,u)$-space. Its tangent plane at each point is spanned by $(1,0,u_x)$ and $(0,1,u_t)$, so a vector $(A,B,C)$ is tangent to the surface exactly when $C=A u_x+B u_t$, the condition expressed by the PDE itself. The solution surface is therefore swept out by the integral curves of the vector field $(A,B,C)$, the characteristic curves, which solve the characteristic system of ordinary differential equations

$$\frac{dx}{ds}=A(x,t,u),\qquad \frac{dt}{ds}=B(x,t,u),\qquad \frac{du}{ds}=C(x,t,u)$$

Given data on a curve that is not itself characteristic, such as $u(x,0)=u_0(x)$, one characteristic issues from each point of the curve, and integrating the system carries the data across the region the characteristics cover. For the linear homogeneous case

$$a(x,t)\,u_x+b(x,t)\,u_t=0$$

the $x$- and $t$-equations do not involve $u$, and the third gives $du/ds=0$: the solution is constant along each characteristic. The characteristics form a one-parameter family; let $\psi(x,t)=\text{const}$ be a first integral, a function constant on each member of the family.

General algebraic solution. Since $u$ is constant on every characteristic and the characteristics are the level sets of $\psi$, the general solution is an arbitrary function of the first integral,

$$u(x,t)=F\bigl(\psi(x,t)\bigr)$$

with $F$ fixed by the initial data. When the right-hand side of the PDE is nonzero, $u$ changes along a characteristic at the rate $C$ (or of the given source term), so the general solution acquires an integral of that term along the curve.

Example: transport of a pollutant. For constant coefficients $c$ the equation $u_t+c\,u_x=0$ has characteristics $dx/dt=c$, the straight lines $x-ct=\text{const}$; hence $\psi=x-ct$, and the general algebraic solution is the travelling wave

$$u(x,t)=F(x-ct),\qquad u(x,0)=F(x)$$

A river flows steadily at speed $c=2\ \mathrm{m\,s^{-1}}$, and a factory releases a concentrated slug of pollutant at one point; as long as mixing and diffusion are negligible, the current simply carries the whole slug downstream without changing it. The concentration obeys $u_t+2u_x=0$ with the Gaussian initial profile

$$u(x,0)=50\,e^{-(x/10)^2}\ \mathrm{mg\,L^{-1}}$$

(peak $50\ \mathrm{mg\,L^{-1}}$ at the release point, falling by $e^{-1}$ ten metres away). The solution above gives

$$u(x,t)=50\,e^{-((x-2t)/10)^2}\ \mathrm{mg\,L^{-1}}$$

After one minute the peak has moved from $x=0$ to $x=ct=120\ \mathrm{m}$, still reading $50\ \mathrm{mg\,L^{-1}}$; pure transport does not spread the slug, which would require the second-order term $\alpha u_{xx}$ of the heat equation. With a source $q(x,t)$, the value accumulates along each characteristic:

$$u(x,t)=F(x-ct)+\int_0^t q\bigl(x-c(t-\tau),\tau\bigr)\,d\tau$$

Example: the wave equation. The wave equation

$$u_{tt}=c^2u_{xx}$$

is second order, yet its operator factors into two first-order transport operators, so the method of characteristics still applies. Introduce the characteristic coordinates

$$\xi=x-ct,\qquad \eta=x+ct$$

in which the operator becomes $u_{tt}-c^2u_{xx}=-4c^2u_{\xi\eta}$, so the equation reads $u_{\xi\eta}=0$. Hence $u_\xi$ depends on $\xi$ alone, and one further integration gives the general algebraic solution (d'Alembert, 1747):

$$u(x,t)=f(x-ct)+g(x+ct)$$

a superposition of two travelling waves, one in each direction. The functions $f,g$ are fixed by the initial displacement and velocity: for a string released from rest with initial displacement $\phi(x)$, the conditions $u(x,0)=\phi(x)$ and $u_t(x,0)=0$ give $f=g=\phi/2$, so

$$u(x,t)=\frac{\phi(x-ct)+\phi(x+ct)}{2}$$

and the initial hump separates into two half-size copies travelling apart at speed $c$.[2]

When no formula exists

Most equations, especially nonlinear ones, fit none of the classes above and have no solution in terms of familiar functions. They are studied in one of three ways:[3][4]

The exact methods occupy the branches on the left; most equations encountered in research fall through to the routes on the right, each treated in its own article.

A short history

The origins of differential equations coincide with those of the calculus, since the calculus supplies the language in which rates of change are expressed and inverted. Newton's laws of motion and of universal gravitation, published in the Philosophiae Naturalis Principia Mathematica (1687), are differential equations; Newton treated them by the geometrical and infinite-series methods of his fluxional calculus. Although Newton developed a notation for fluxions, the differential notation $dy/dx$ introduced by Leibniz in the 1670s proved the more enduring: it exhibits the structure of the equation directly and is the notation adopted in this article.[1]

Isaac Newton (portrait after Godfrey Kneller, 1689). Newton's laws of motion and of gravitation (Principia, 1687) are differential equations. Credit: James Thronill after Godfrey Kneller (public domain).

The consolidation of these techniques into a systematic theory is due in large measure to Leonhard Euler, whose work in the middle decades of the eighteenth century established the principal exact methods. Euler showed that linear equations with constant coefficients are solved by the substitution $y=e^{rx}$, which reduces the problem to an algebraic equation, and he advanced the theory of series solutions. For equations that admitted no closed-form solution, he introduced the step-by-step numerical procedure, described above as Euler's method, that bears his name. The exact methods presented in this article derive, in large part, from his work.[1]

Leonhard Euler (portrait by Jakob Emanuel Handmann, 1753). Credit: Jakob Emanuel Handmann (public domain).

The theory of partial differential equations arose from the demands of eighteenth-century physics. In 1747, Jean le Rond d'Alembert derived the wave equation for the vibrating string and established that its general solution consists of two waves propagating in opposite directions. The problem of heat conduction proved more demanding, because the initial temperature distribution of a conducting body is arbitrary. In his Théorie analytique de la chaleur (1822), Joseph Fourier derived the heat equation from the physical principles of conduction and solved it by expanding the initial data into a trigonometric series. This work established separation of variables as a standard technique of mathematical physics, and the Fourier series introduced for the purpose has since become fundamental to the analysis of periodic phenomena, from acoustics to signal processing.[2]

The limits of closed-form methods became apparent towards the end of the nineteenth century, and the later history of the subject is concerned principally with equations for which elementary solutions do not exist. In his investigation of the three-body problem of celestial mechanics, Henri Poincaré demonstrated that qualitative properties of the motion, such as its equilibria, stability, and long-term behaviour, can be characterised without solving the equations, thereby founding the qualitative theory of dynamical systems. The subsequent development of electronic computing made numerical approximation, of which Euler's method is the simplest instance, a routine and general technique. The two strands converged in 1963, when Edward Lorenz, studying a simplified system of three ordinary differential equations that models atmospheric convection, established the phenomenon of deterministic chaos: although the equations are deterministic, their solutions are aperiodic and depend so sensitively on initial conditions that long-term weather prediction is not feasible in practice. These later approaches, qualitative analysis, numerical approximation, and series and transform methods, are treated in dedicated articles.[4]

References

  1. ↑ ↑ ↑ Tenenbaum, M. (1985). Ordinary Differential Equations (Book). In Ordinary Differential Equations (Book). Dover Publications.
  2. ↑ ↑ ↑ Strauss, W. A. (2008). Partial Differential Equations: An Introduction (Book). In Partial Differential Equations: An Introduction (Book). John Wiley & Sons.
  3. ↑ Boyce, W. E. (2012). Elementary Differential Equations and Boundary Value Problems (Book). In Elementary Differential Equations and Boundary Value Problems (Book). John Wiley & Sons.
  4. ↑ ↑ 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.

Further reading