Differential equation: Difference between revisions
AI-assisted (RonzzWikiCowriter): compress the solution-methods section to derivations in display math with minimal prose; rewrite the history section in a formal academic register, restoring semantic person links. (via update-page on MediaWiki MCP Server) |
AI-assisted (RonzzWikiCowriter): restore scenario introductions to the numerical examples and make each example illustrate the solving process — the scenario is first modelled by a differential equation with concrete numbers, which the method then solves step by step (e.g. the compound-interest scenario now explicitly solves dy/dt = 0.05y, y(0) = 1000). (via update-page on MediaWiki MCP Server) |
||
| Line 73: | Line 73: | ||
== Solving differential equations == | == Solving differential equations == | ||
Closed-form solutions are known only for restricted classes of equations; the standard practice is to identify the class by order, linearity, and coefficients, and to apply that class's method. The linear methods | Closed-form solutions are known only for restricted classes of equations; the standard practice is to identify the class by order, linearity, and coefficients, and to apply that class's method. Each method below is stated in general and then applied to a concrete scenario: the scenario is first translated into a differential equation, which the method then solves step by step. The linear methods follow the two-step structure of the classification section: solve the homogeneous equation, whose general solution carries all arbitrary constants, then add one particular solution of the non-homogeneous equation. | ||
=== First-order ODEs === | === First-order ODEs === | ||
| Line 85: | Line 85: | ||
after which both integrals are evaluated directly. | after which both integrals are evaluated directly. | ||
'''Example: exponential growth and decay.''' | '''Example: exponential growth and decay.''' Growth and decay describe quantities whose rate of change is proportional to their own size: a bank balance earning interest, an unchecked population, a radioactive sample. Each such quantity is modelled by | ||
{{#content:Q1584}} | {{#content:Q1584}} | ||
Separating variables and integrating, | |||
$$\int\frac{dy}{y}=\int k\,dt\;\Longrightarrow\;\ln|y|=kt+C_1\;\Longrightarrow\;y=Ce^{kt}$$ | $$\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$ | The initial condition $y(0)=y_0$ fixes $C=y_0$, giving | ||
{{#content:Q1585}} | {{#content:Q1585}} | ||
Numeric scenario: €1000 is deposited at 5% interest compounded continuously. The balance $y(t)$ changes at the rate $dy/dt=0.05y$, with $y(0)=1000$; substituting $k=0.05$ and $y_0=1000$ into the solved form gives | |||
$$y(t)=1000\,e^{0.05t} | $$y(t)=1000\,e^{0.05t}$$ | ||
$$t_{\text{double}}= | so after ten years $y(10)=1000\,e^{0.5}\approx 1648.7$. The balance doubles when $1000e^{0.05t}=2000$, i.e. at $t_{\text{double}}=\ln 2/0.05\approx 13.9\ \text{yr}$. With $k<0$ the same solution describes decay, as for a radioactive sample, whose half-life $y=y_0/2$ is reached at $t_{1/2}=(\ln 2)/(-k)$. | ||
'''Example: Newton's law of cooling.''' | '''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 gap shrinks at a rate proportional to itself. The temperature is modelled by | ||
{{#content:Q1586}} | {{#content:Q1586}} | ||
$$\int\frac{dT}{T-T_a}=-\int | 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}$$ | |||
with $ | so with $T(0)=T_0$, hence $C=T_0-T_a$, | ||
$$T(t)=T_a+(T_0-T_a)e^{-kt}$$ | $$T(t)=T_a+(T_0-T_a)e^{-kt}$$ | ||
Numeric scenario: a drink at $T_0=80\,^{\circ}\mathrm{C}$ cools in a room at $T_a=20\,^{\circ}\mathrm{C}$ with rate constant $k=0.1\ \mathrm{min}^{-1}$. It obeys $dT/dt=-0.1(T-20)$, $T(0)=80$, and the solution above becomes | |||
$$T(t)=20+ | $$T(t)=20+60\,e^{-0.1t}$$ | ||
<ref>{{#cite:Q1576}}</ref> | The drink reaches $40\,^{\circ}\mathrm{C}$ when $20+60e^{-0.1t}=40$, i.e. at $t=10\ln 3\approx 11$ min.<ref>{{#cite:Q1576}}</ref> | ||
==== Method 2: linear first-order equations (integrating factor) ==== | ==== Method 2: linear first-order equations (integrating factor) ==== | ||
| Line 123: | Line 127: | ||
$$y'+p(x)\,y=q(x)$$ | $$y'+p(x)\,y=q(x)$$ | ||
introduce the integrating factor $\mu=e^{\int p\,dx}$, | 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: | ||
{{#content:Q1613}} | {{#content:Q1613}} | ||
| Line 129: | Line 133: | ||
Integrating both sides, | Integrating both sides, | ||
$$\mu | $$\mu y=\int\mu\,q\,dx+C\;\Longrightarrow\;y=\frac{1}{\mu}\int\mu\,q\,dx+\frac{C}{\mu}$$ | ||
The first term is | The first term is one particular solution of the non-homogeneous equation, and the second term, $C/\mu=Ce^{-\int p\,dx}$, is the general solution of its homogeneous part, so the formula realises the structure $y=y_p+y_h$. | ||
'''Worked demonstration.''' $y'+y=e^{-x}$: $p=1$, $\mu=e^x$, and $(e^x y)'=e^x(y'+y)=1$, so $e^x y=x+C$: | '''Worked demonstration.''' Solve $y'+y=e^{-x}$: $p=1$, $\mu=e^x$, and $(e^x y)'=e^x(y'+y)=1$, so $e^x y=x+C$: | ||
{{#content:Q1607}} | {{#content:Q1607}} | ||
$y(0)=2$ | The condition $y(0)=2$ fixes $C=2$.<ref>{{#cite:Q1576}}</ref><ref>{{#cite:Q1577}}</ref> | ||
'''Example: falling with air resistance.''' Newton's second law | '''Example: falling with air resistance.''' A falling body is pulled down by gravity $mg$ and slowed by air drag $-bv$ proportional to its speed; as the speed grows the drag grows too, until it balances gravity and the speed stops increasing. Newton's second law models the fall, | ||
$$m\frac{dv}{dt}=mg-bv\;\Longrightarrow\;v'+\frac{b}{m}v=g$$ | $$m\frac{dv}{dt}=mg-bv\;\Longrightarrow\;v'+\frac{b}{m}v=g$$ | ||
a linear first-order equation with constant $p=b/m$ and $q=g$, so $\mu=e^{(b/m)t}$ and | |||
$$\frac{d}{dt}\left(e^{(b/m)t}v\right)=g\,e^{(b/m)t}\;\Longrightarrow\;v=\frac{mg}{b}+Ce^{-(b/m)t}$$ | $$\frac{d}{dt}\left(e^{(b/m)t}v\right)=g\,e^{(b/m)t}\;\Longrightarrow\;v=\frac{mg}{b}+Ce^{-(b/m)t}$$ | ||
$v(0)=0$ fixes $C=-mg/b$: | Dropped from rest, $v(0)=0$ fixes $C=-mg/b$: | ||
$$v(t)=\frac{mg}{b}\left(1-e^{-(b/m)t}\right)$$ | $$v(t)=\frac{mg}{b}\left(1-e^{-(b/m)t}\right)$$ | ||
Numeric scenario: a skydiver of mass $m=70\ \mathrm{kg}$ and drag coefficient $b=14\ \mathrm{kg\,s^{-1}}$ jumps from rest. The equation of motion is $dv/dt=9.8-0.2v$, $v(0)=0$ (since $mg/b=49\ \mathrm{m\,s^{-1}}$ and $b/m=0.2\ \mathrm{s^{-1}}$), and the solution reads | |||
$$v(t)=49\left(1-e^{-0.2t}\right)\ \mathrm{m\,s^{-1}}$$ | |||
so $v(5)\approx 31\ \mathrm{m\,s^{-1}}$ and $v(10)\approx 42\ \mathrm{m\,s^{-1}}$, approaching but never reaching the terminal velocity $mg/b=49\ \mathrm{m\,s^{-1}}$.<ref>{{#cite:Q1576}}</ref> | |||
==== Method 3: constant-coefficient linear equations (trial solutions) ==== | ==== Method 3: constant-coefficient linear equations (trial solutions) ==== | ||
| Line 161: | Line 167: | ||
$$(b+a)Ce^{bx}=0\;\Longrightarrow\;b=-a\;\Longrightarrow\;y_h=Ce^{-ax}$$ | $$(b+a)Ce^{bx}=0\;\Longrightarrow\;b=-a\;\Longrightarrow\;y_h=Ce^{-ax}$$ | ||
Exponential growth $y'=ky$ is the case $a=-k$. By linearity the forced equation has general solution | |||
$$y=y_h+y_p | $$y=y_h+y_p$$ | ||
When $q$ is constant, exponential, sinusoidal, or polynomial, $y_p$ is | where $y_p$ is any single solution of $y'+ay=q$. When $q$ is constant, exponential, sinusoidal, or polynomial, $y_p$ is tried in the same family and its coefficient fixed by substitution ('''method of undetermined coefficients'''); a trial that already solves the homogeneous equation is multiplied by $x$. | ||
'''Example: an account with steady withdrawals.''' | '''Example: an account with steady withdrawals.''' A savings account earns 10% interest compounded continuously, and €100 is withdrawn each year; the balance changes at the rate of interest earned minus withdrawals: | ||
$$ | $$y'=0.1y-100,\qquad y(0)=5000$$ | ||
$$y | This is $y'+ay=q$ with constant forcing $q=-100$. The homogeneous part is solved by the trial $y=Ce^{bt}$: substituting into $y'=0.1y$ gives $b=0.1$, hence $y_h=Ce^{0.1t}$. Since the forcing is constant, try the constant particular solution $y_p=A$; substituting gives $0.1A-100=0$, so $A=1000$, and | ||
$$y(t)=1000+Ce^{0.1t}$$ | |||
$$y(10)=1000+4000e\approx 11\,873 | The initial balance, $y(0)=1000+C=5000$, fixes $C=4000$: | ||
$$y(t)=1000+4000\,e^{0.1t}$$ | |||
Check: $y'-0.1y=400e^{0.1t}-(100+400e^{0.1t})=-100$, so the equation is satisfied. After ten years | |||
$$y(10)=1000+4000e\approx 11\,873$$ | |||
whereas without the withdrawals the same €5000 would have grown to $5000e\approx 13\,591$.<ref>{{#cite:Q1576}}</ref> | |||
Further first-order classes, $y'=f(y/x)$, Bernoulli, exact, reduce to these by substitution or by recognising a total differential.<ref>{{#cite:Q1576}}</ref> | Further first-order classes, $y'=f(y/x)$, Bernoulli, exact, reduce to these by substitution or by recognising a total differential.<ref>{{#cite:Q1576}}</ref> | ||
| Line 189: | Line 203: | ||
and likewise $y^{(n)}=f(x)$ by $n$ integrations. | and likewise $y^{(n)}=f(x)$ by $n$ integrations. | ||
'''Example: free fall.''' $x''=-g$ | '''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, | ||
$$\frac{dx}{dt}=- | $$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}$$ | $$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 ==== | ==== Method 2: linear equations with constant coefficients ==== | ||
| Line 227: | Line 243: | ||
$$y=C_1e^x+C_2e^{2x}+e^{3x}$$ | $$y=C_1e^x+C_2e^{2x}+e^{3x}$$ | ||
'''Example: the harmonic oscillator (a mass on a spring).''' Hooke's law | '''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 | $$m\frac{d^2x}{dt^2}=-kx\;\Longrightarrow\;x''+\omega_0^2x=0,\qquad \omega_0=\sqrt{\frac{k}{m}}$$ | ||
{{#content:Q1588}} | {{#content:Q1588}} | ||
$r^2+\omega_0^2=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$$ | $$x(t)=A\cos\omega_0t+B\sin\omega_0t$$ | ||
with $A,B$ fixed by initial position and velocity. | 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).]] | [[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} | $$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 === | === Partial differential equations === | ||
| Line 253: | Line 271: | ||
'''General case.''' For a linear, homogeneous PDE on a simple domain, assume $u(x,t)=X(x)T(t)$; substitution splits the PDE into ordinary equations for $X$ and $T$, boundary conditions select the admissible solutions, and their superposition matches the initial profile. | '''General case.''' For a linear, homogeneous PDE on a simple domain, assume $u(x,t)=X(x)T(t)$; substitution splits the PDE into ordinary equations for $X$ and $T$, boundary conditions select the admissible solutions, and their superposition matches the initial profile. | ||
'''Application.''' The heat equation on a bar of length $L$ with ends held at $0$, | '''Application.''' The heat equation on a bar of length $L$ with insulated sides and both ends held at $0$, | ||
$$\frac{\partial u}{\partial t}=\alpha\frac{\partial^2u}{\partial x^2},\qquad u(0,t)=u(L,t)=0$$ | $$\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}} | {{#content:Q1622}} | ||
The left side depends on $t$ alone and the right on $x$ alone, so both equal one constant, $-\lambda$: | |||
$$T'=-\alpha\lambda T\;\Longrightarrow\;T=e^{-\alpha\lambda t}$$ | $$T'=-\alpha\lambda T\;\Longrightarrow\;T=e^{-\alpha\lambda t}$$ | ||
| Line 267: | Line 285: | ||
$$X''=-\lambda X\;\Longrightarrow\;X=A\cos(\sqrt\lambda\,x)+B\sin(\sqrt\lambda\,x)$$ | $$X''=-\lambda X\;\Longrightarrow\;X=A\cos(\sqrt\lambda\,x)+B\sin(\sqrt\lambda\,x)$$ | ||
The boundary conditions force $X(0)=X(L)=0$: $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 | The boundary conditions force $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}$$ | $$u_n(x,t)=\sin\frac{n\pi x}{L}\,e^{-\alpha(n\pi/L)^2t}$$ | ||
| Line 277: | Line 295: | ||
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$. | 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: travelling waves (method of characteristics) ==== | ==== Method 2: travelling waves (method of characteristics) ==== | ||
| Line 289: | Line 311: | ||
$$u_t+c\,u_x=0$$ | $$u_t+c\,u_x=0$$ | ||
states that $u$ is carried unchanged. The travelling-wave trial $u=f(x-ct)$ gives $u_t=-cf'$ | states that the quantity $u$ is carried along unchanged at speed $c$. The travelling-wave trial $u=f(x-ct)$ gives $u_t=-cf'$ and $u_x=f'$, hence $u_t+cu_x=0$ identically: | ||
$$u(x,t)=f(x-ct),\qquad u(x,0)=f(x)$$ | $$u(x,t)=f(x-ct),\qquad u(x,0)=f(x)$$ | ||
| Line 297: | Line 319: | ||
$$u(x,t)=f(x-ct)+\int_0^t s\bigl(x-c(t-\tau),\tau\bigr)\,d\tau$$ | $$u(x,t)=f(x-ct)+\int_0^t s\bigl(x-c(t-\tau),\tau\bigr)\,d\tau$$ | ||
'''Example: a slug of pollutant in a river.''' A river at $c=2\ \mathrm{m\,s^{-1}}$ carries | '''Example: a slug of pollutant in a river.''' 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 the transport equation $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 $ | 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. | ||
'''Wave equation.''' The second-order wave equation is the two-directional travelling-wave problem: | '''Wave equation.''' The second-order wave equation is the two-directional travelling-wave problem: | ||
Revision as of 19:46, 5 September 2026
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)$. Laws of nature state how quantities change, so differential equations describe pendulums, cooling drinks, growing populations, and discharging capacitors. This article covers the standard analytical solution methods, by class of equation, each stated in general and then demonstrated on a concrete numerical example, and the numerical, series, and qualitative routes used when no exact formula exists. It treats ordinary differential equations (one independent variable) and, briefly, partial differential equations (several).
A first example: slopes and a family of solutions
The simplest differential equation prescribes the slope of a function $y(x)$:
$$\frac{dy}{dx}=2x$$
Integration inverts differentiation, so integrating both sides gives
$$\int\frac{dy}{dx}\,dx=\int 2x\,dx\qquad\Longrightarrow\qquad y(x)=x^{2}+C$$
Every $C$ works, since $\frac{d}{dx}\left(x^2+C\right)=2x$; the solutions form the parabola family $y=x^2+C$, the general solution.
If $y(0)=3$, then
$$3=0^2+C\qquad\Longrightarrow\qquad C=3\qquad\Longrightarrow\qquad y=x^2+3$$
A prescribed value such as this is an initial condition.
Classifying differential equations
Three features decide how to solve an equation: its order, its linearity, and how many independent variables it involves.
Order
The order is the order of the highest derivative present. $dy/dx=2x$ is first order; Newton's second law,
is second order ($x(t)$ position of mass $m$, $F$ net force). Integration introduces one arbitrary constant per integration, so the general solution of an nth-order equation carries $n$ constants, fixed by $n$ initial conditions. For equations of the special form $y^{(n)}=f(x)$ the constants appear exactly as the integration constants of $n$ successive integrations; the free-fall example in the second-order section below works this out for $n=2$.
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)$$
and is 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$).
If $y_1,y_2$ solve a homogeneous linear equation, so does $c_1y_1+c_2y_2$ (the superposition principle): substituting the combination adds the two expressions that already vanish. For a nonlinear equation the combination does not generally solve it: if $y_1'=y_1^2$ and $y_2'=y_2^2$, then
$$(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$.
Superposition also joins the homogeneous and non-homogeneous problems of one linear equation. Write the left-hand side as $L(y)$, so the equation reads $L(y)=q(x)$, with $L(y)=0$ its homogeneous form. If $y_p$ is any single solution of $L(y)=q$ (a particular solution) and $y_h$ runs through all solutions of $L(y)=0$, then every solution of the original equation is
$$y=y_p+y_h$$
because $L(y_p+y_h)=L(y_p)+L(y_h)=q+0=q$, and conversely any two solutions of the non-homogeneous equation differ by a solution of the homogeneous one. The constants of integration therefore live entirely in $y_h$: the general solution of a linear equation is one particular solution plus the whole homogeneous family. This is why each linear method below is presented in two parts, the homogeneous case first.
Ordinary and partial
An ordinary differential equation (ODE) has one independent variable. A partial differential equation (PDE) has several, with partial derivatives. For example, the temperature $u(x,t)$ of an insulated metal bar, which depends on position $x$ and time $t$, obeys the heat equation
where $\alpha$ is the thermal diffusivity.
Slope fields
A first-order equation can be written
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 run tangent to it.

Numerical methods such as Euler's method follow the field: read the slope, step a short distance along it, repeat.[1]
Solving differential equations
Closed-form solutions are known only for restricted classes of equations; the standard practice is to identify the class by order, linearity, and coefficients, and to apply that class's method. Each method below is stated in general and then applied to a concrete scenario: the scenario is first translated into a differential equation, which the method then solves step by step. The linear methods follow the two-step structure of the classification section: solve the homogeneous equation, whose general solution carries all arbitrary constants, then add one particular solution of the non-homogeneous equation.
First-order ODEs
Method 1: separable equations
General case. A first-order equation is separable when it can be brought to the separated form
after which both integrals are evaluated directly.
Example: exponential growth and decay. Growth and decay describe quantities whose rate of change is proportional to their own size: a bank balance earning interest, an unchecked population, a radioactive sample. Each such quantity is modelled by
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
Numeric scenario: €1000 is deposited at 5% interest compounded continuously. The balance $y(t)$ changes at the rate $dy/dt=0.05y$, with $y(0)=1000$; substituting $k=0.05$ and $y_0=1000$ into the solved form gives
$$y(t)=1000\,e^{0.05t}$$
so after ten years $y(10)=1000\,e^{0.5}\approx 1648.7$. The balance doubles when $1000e^{0.05t}=2000$, i.e. at $t_{\text{double}}=\ln 2/0.05\approx 13.9\ \text{yr}$. With $k<0$ the same solution describes decay, as for a radioactive sample, whose half-life $y=y_0/2$ is reached at $t_{1/2}=(\ln 2)/(-k)$.
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 gap shrinks at a rate proportional to itself. The temperature is modelled by
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}$$
Numeric scenario: a drink at $T_0=80\,^{\circ}\mathrm{C}$ cools in a room at $T_a=20\,^{\circ}\mathrm{C}$ with rate constant $k=0.1\ \mathrm{min}^{-1}$. It obeys $dT/dt=-0.1(T-20)$, $T(0)=80$, and the solution above becomes
$$T(t)=20+60\,e^{-0.1t}$$
The drink reaches $40\,^{\circ}\mathrm{C}$ when $20+60e^{-0.1t}=40$, i.e. at $t=10\ln 3\approx 11$ min.[1]
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:
Integrating both sides,
$$\mu y=\int\mu\,q\,dx+C\;\Longrightarrow\;y=\frac{1}{\mu}\int\mu\,q\,dx+\frac{C}{\mu}$$
The first term is one particular solution of the non-homogeneous equation, and the second term, $C/\mu=Ce^{-\int p\,dx}$, is the general solution of its homogeneous part, so the formula realises the structure $y=y_p+y_h$.
Worked demonstration. Solve $y'+y=e^{-x}$: $p=1$, $\mu=e^x$, and $(e^x y)'=e^x(y'+y)=1$, so $e^x y=x+C$:
The condition $y(0)=2$ fixes $C=2$.[1][2]
Example: falling with air resistance. A falling body is pulled down by gravity $mg$ and slowed by air drag $-bv$ proportional to its speed; as the speed grows the drag grows too, until it balances gravity and the speed stops increasing. Newton's second law models the fall,
$$m\frac{dv}{dt}=mg-bv\;\Longrightarrow\;v'+\frac{b}{m}v=g$$
a linear first-order equation with constant $p=b/m$ and $q=g$, so $\mu=e^{(b/m)t}$ and
$$\frac{d}{dt}\left(e^{(b/m)t}v\right)=g\,e^{(b/m)t}\;\Longrightarrow\;v=\frac{mg}{b}+Ce^{-(b/m)t}$$
Dropped from rest, $v(0)=0$ fixes $C=-mg/b$:
$$v(t)=\frac{mg}{b}\left(1-e^{-(b/m)t}\right)$$
Numeric scenario: a skydiver of mass $m=70\ \mathrm{kg}$ and drag coefficient $b=14\ \mathrm{kg\,s^{-1}}$ jumps from rest. The equation of motion is $dv/dt=9.8-0.2v$, $v(0)=0$ (since $mg/b=49\ \mathrm{m\,s^{-1}}$ and $b/m=0.2\ \mathrm{s^{-1}}$), and the solution reads
$$v(t)=49\left(1-e^{-0.2t}\right)\ \mathrm{m\,s^{-1}}$$
so $v(5)\approx 31\ \mathrm{m\,s^{-1}}$ and $v(10)\approx 42\ \mathrm{m\,s^{-1}}$, approaching but never reaching the terminal velocity $mg/b=49\ \mathrm{m\,s^{-1}}$.[1]
Method 3: constant-coefficient linear equations (trial solutions)
General case. For $y'+ay=q(x)$, the homogeneous equation is solved by the exponential trial $y=Ce^{bx}$:
$$(b+a)Ce^{bx}=0\;\Longrightarrow\;b=-a\;\Longrightarrow\;y_h=Ce^{-ax}$$
Exponential growth $y'=ky$ is the case $a=-k$. By linearity the forced equation has general solution
$$y=y_h+y_p$$
where $y_p$ is any single solution of $y'+ay=q$. When $q$ is constant, exponential, sinusoidal, or polynomial, $y_p$ is tried in the same family and its coefficient fixed by substitution (method of undetermined coefficients); a trial that already solves the homogeneous equation is multiplied by $x$.
Example: an account with steady withdrawals. A savings account earns 10% interest compounded continuously, and €100 is withdrawn each year; the balance changes at the rate of interest earned minus withdrawals:
$$y'=0.1y-100,\qquad y(0)=5000$$
This is $y'+ay=q$ with constant forcing $q=-100$. The homogeneous part is solved by the trial $y=Ce^{bt}$: substituting into $y'=0.1y$ gives $b=0.1$, hence $y_h=Ce^{0.1t}$. Since the forcing is constant, try the constant particular solution $y_p=A$; substituting gives $0.1A-100=0$, so $A=1000$, and
$$y(t)=1000+Ce^{0.1t}$$
The initial balance, $y(0)=1000+C=5000$, fixes $C=4000$:
$$y(t)=1000+4000\,e^{0.1t}$$
Check: $y'-0.1y=400e^{0.1t}-(100+400e^{0.1t})=-100$, so the equation is satisfied. After ten years
$$y(10)=1000+4000e\approx 11\,873$$
whereas without the withdrawals the same €5000 would have grown to $5000e\approx 13\,591$.[1]
Further first-order classes, $y'=f(y/x)$, Bernoulli, exact, reduce to these by substitution or by recognising a total differential.[1]
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}$,
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$,
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}}$$
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.

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.[2]
Partial differential equations
Two elementary classes of linear PDE admit closed-form solutions: diffusion on finite domains, by separation of variables, and first-order transport, by travelling waves.
Method 1: separation of variables (the heat equation)
General case. For a linear, homogeneous PDE on a simple domain, assume $u(x,t)=X(x)T(t)$; substitution splits the PDE into ordinary equations for $X$ and $T$, boundary conditions select the admissible solutions, and their superposition matches the initial profile.
Application. The heat equation on a bar of length $L$ with insulated sides and both ends held at $0$,
$$\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$,
The left side depends on $t$ alone and the right on $x$ alone, so both equal one constant, $-\lambda$:
$$T'=-\alpha\lambda T\;\Longrightarrow\;T=e^{-\alpha\lambda t}$$
$$X''=-\lambda X\;\Longrightarrow\;X=A\cos(\sqrt\lambda\,x)+B\sin(\sqrt\lambda\,x)$$
The boundary conditions force $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 superposition gives the general solution
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.[3]
Method 2: travelling waves (method of characteristics)
General case. The transport equation
$$u_t+c\,u_x=0$$
states that the quantity $u$ is carried along unchanged at speed $c$. The travelling-wave trial $u=f(x-ct)$ gives $u_t=-cf'$ and $u_x=f'$, hence $u_t+cu_x=0$ identically:
$$u(x,t)=f(x-ct),\qquad u(x,0)=f(x)$$
so $u$ is constant on the characteristic lines $x-ct=\text{const}$. The non-homogeneous equation $u_t+cu_x=s(x,t)$ accumulates the source along each characteristic:
$$u(x,t)=f(x-ct)+\int_0^t s\bigl(x-c(t-\tau),\tau\bigr)\,d\tau$$
Example: a slug of pollutant in a river. 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 the transport equation $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.
Wave equation. The second-order wave equation is the two-directional travelling-wave problem:
$$u_{tt}=c^2u_{xx}\;\Longrightarrow\;u(x,t)=f(x-ct)+g(x+ct)$$
(d'Alembert, 1747; see the history section).[3]
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:[1][4]
- 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.
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.[2]

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.[2]

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.[3]
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
- ↑ ↑ ↑ ↑ ↑ ↑ ↑ 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.
- ↑ ↑ ↑ Strauss, W. A. (2008). Partial Differential Equations: An Introduction (Book). In Partial Differential Equations: An Introduction (Book). John Wiley & Sons.
- ↑ ↑ 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
- Differential equation, Wikipedia
- Differential Equation, Wolfram MathWorld
- 18.03SC Differential Equations, MIT OpenCourseWare
- Leonhard Euler, MacTutor History of Mathematics