Differential Equations

Study Sheet

Differential Equations

Everything you need for AP Calculus BC, Topic 9

Verifying Solutions & Modeling

Concept
What a differential equation is

A differential equation (DE) is an equation involving an unknown function and its derivatives, such as dydx=2y\dfrac{dy}{dx}=2y or dPdt=kP\dfrac{dP}{dt}=kP. A solution is a function y=f(x)y=f(x) that makes the equation true when substituted in. The general solution contains an arbitrary constant CC (a whole family of curves); a particular solution is pinned down by an initial condition like y(0)=3y(0)=3.

To verify a proposed solution, differentiate it and substitute both yy and its derivative into the DE; check that the two sides are identical.

Example
Verifying a solution

Show y=3e2xy=3e^{2x} solves dydx=2y\dfrac{dy}{dx}=2y with y(0)=3y(0)=3.

dydx=32e2x=6e2x,2y=23e2x=6e2x.\frac{dy}{dx}=3\cdot 2e^{2x}=6e^{2x},\qquad 2y=2\cdot 3e^{2x}=6e^{2x}.

The two sides agree, and y(0)=3e0=3y(0)=3e^{0}=3. 0MATH1xE0

Modeling. Translate “rate of change” language directly into a derivative. “The rate of change of PP is proportional to PP” becomes dPdt=kP\dfrac{dP}{dt}=kP. “The temperature changes at a rate proportional to the difference from the room temperature 7070^\circ” becomes dTdt=k(T70)\dfrac{dT}{dt}=-k(T-70).

Tip

Tip: The order of a DE is the highest derivative it contains. The number of arbitrary constants in the general solution equals the order (first order \Rightarrow one constant CC).

Slope Fields

Concept
Reading a slope field

A first-order DE dydx=F(x,y)\dfrac{dy}{dx}=F(x,y) gives the slope of the solution curve at every point. A slope field draws a short segment with that slope at a grid of points. To sketch a solution through a given point, start there and “flow” along the segments, always keeping the curve tangent to the nearby marks.

Slope field for dydx=x\dfrac{dy}{dx}=x with the solution through (0,1)(0,-1), namely y=12x21y=\tfrac12 x^2-1. Segments are horizontal along the yy-axis (where x=0x=0) and steepen as x|x| grows.

Matching a slope field to a DE. Check special features:

  • [leftmargin=*]
  • Where are the segments horizontal? Set F(x,y)=0F(x,y)=0.
  • Does the slope depend on xx only, yy only, or both? (If segments in a row look identical, the slope depends on xx only.)
  • Is the slope positive or negative in each region?

Slope field for dydx=y\dfrac{dy}{dx}=y with the solution y=exy=e^{x} through (0,1)(0,1). Now segments are horizontal along the xx-axis (where y=0y=0) and depend only on yy.

Tip

Tip: Equilibrium (constant) solutions appear as horizontal rows of flat segments. For dydx=y\dfrac{dy}{dx}=y the line y=0y=0 is an equilibrium.

Separable Differential Equations & IVPs

Concept
The separation method

A DE is separable if it can be written dydx=g(x)h(y)\dfrac{dy}{dx}=g(x)\,h(y). Separate the variables so each side involves only one letter, then integrate:

1h(y)dy=g(x)dx1h(y)dy=g(x)dx.\frac{1}{h(y)}\,dy=g(x)\,dx \quad\Longrightarrow\quad \int\frac{1}{h(y)}\,dy=\int g(x)\,dx.

Add a single constant +C+C, then apply the initial condition to solve for CC (an initial-value problem, IVP).

Example
A full separable IVP

Solve dydx=xy\dfrac{dy}{dx}=xy with y(0)=3y(0)=3.

1ydy=xdx    1ydy=xdx    lny=x22+C.\frac{1}{y}\,dy = x\,dx \;\Longrightarrow\; \int\frac{1}{y}\,dy=\int x\,dx \;\Longrightarrow\; \ln|y|=\frac{x^2}{2}+C.

Exponentiate: y=Aex2/2y=Ae^{x^2/2} where A=±eCA=\pm e^{C}. Apply y(0)=3y(0)=3: 3=Ae0=A3=Ae^{0}=A. Therefore

y=3ex2/2.\boxed{\,y=3e^{x^2/2}\,}.

Check: y=3ex2/2x=xyy'=3e^{x^2/2}\cdot x = x\cdot y. 0MATH1xE0

Tip

Tip: Apply the initial condition as early as reasonable, and keep exact forms (ln\ln, ee, fractions). Fold ±eC\pm e^{C} into a single constant AA once integration is done.

Exponential Growth & Decay

Concept
The growth/decay law

The single most important DE in the course is

dydt=kyy=y0ekt,\frac{dy}{dt}=ky \quad\Longrightarrow\quad y=y_0\,e^{kt},

where y0=y(0)y_0=y(0) is the initial amount. k>0k>0 gives growth; k<0k<0 gives decay.

Example
Half-life \Rightarrow find kk

A radioactive sample has a half-life of 55 years. Find kk, then the fraction left after 1212 years.

12y0=y0e5k    e5k=12    k=ln125=ln250.1386.\tfrac12 y_0 = y_0 e^{5k}\;\Longrightarrow\; e^{5k}=\tfrac12 \;\Longrightarrow\; k=\frac{\ln\frac12}{5}=-\frac{\ln 2}{5}\approx-0.1386.

After 1212 yr: y(12)y0=e12k=e12ln2/5=212/50.189\dfrac{y(12)}{y_0}=e^{12k}=e^{-12\ln2/5}=2^{-12/5}\approx 0.189, about 18.9%18.9\%.

Example
Newton's Law of Cooling

dTdt=k(TTs)\dfrac{dT}{dt}=-k(T-T_s) (with surroundings TsT_s) is separable. Let u=TTsu=T-T_s, so dudt=ku\dfrac{du}{dt}=-ku and u=u0ektu=u_0 e^{-kt}. Therefore

T(t)=Ts+(T0Ts)ekt.T(t)=T_s+(T_0-T_s)\,e^{-kt}.

A 200200^\circ cup in a 7070^\circ room: T(t)=70+130ektT(t)=70+130\,e^{-kt}, cooling toward 7070^\circ as tt\to\infty.

Tip

Tip: “Doubling time” and “half-life” both give kk via 2=ekTd2=e^{kT_d} or 12=ekTh\tfrac12=e^{kT_h}, so k=ln2Tdk=\dfrac{\ln 2}{T_d} or k=ln2Thk=-\dfrac{\ln 2}{T_h}.

Logistic Growth  (BC)

Concept
The logistic model

When growth is limited by a carrying capacity MM, use

dPdt=kP ⁣(1PM).\frac{dP}{dt}=kP\!\left(1-\frac{P}{M}\right).

When PP is small, 1PM11-\frac{P}{M}\approx1, so growth is nearly exponential; as PMP\to M the factor 0\to0 and growth stalls.

Example
The logistic facts to memorize

For dPdt=kP ⁣(1PM)\dfrac{dP}{dt}=kP\!\left(1-\frac{P}{M}\right):

  • [leftmargin=*]
  • Equilibria: P=0P=0 and P=MP=M (where dPdt=0\frac{dP}{dt}=0).
  • Long-run: limtP(t)=M\displaystyle\lim_{t\to\infty}P(t)=M for any P0P_0 with 0<P0<M0<P_0<M.
  • Fastest growth (inflection point of PP) occurs at P=M2P=\dfrac{M}{2}, where the rate equals kM4\dfrac{kM}{4}.
  • Solution: P(t)=M1+Aekt\displaystyle P(t)=\frac{M}{1+Ae^{-kt}}, with A=MP0P0A=\dfrac{M-P_0}{P_0}.

Logistic slope field (M=4M=4) with the S-shaped solution through (0,1)(0,1). Segments are flat along P=0P=0 and P=MP=M; the curve is steepest as it crosses P=M/2P=M/2.

Tip

Tip: The graph of P(t)P(t) is concave up below M/2M/2 and concave down above it, so the maximum rate of change is exactly at the halfway population P=M/2P=M/2.

Euler's Method  (BC)

Concept
Following the tangent line in steps

When a DE cannot be solved in closed form, approximate the solution numerically. Starting from (x0,y0)(x_0,y_0) with step size hh, repeatedly follow the tangent line:

xn+1=xn+h,yn+1=yn+hF(xn,yn).x_{n+1}=x_n+h,\qquad y_{n+1}=y_n+h\cdot F(x_n,y_n).

Each step uses the slope FF at the current point to predict the next yy.

Example
A full Euler's method table

Approximate y(0.6)y(0.6) for dydx=x+y\dfrac{dy}{dx}=x+y, y(0)=1y(0)=1, using h=0.2h=0.2.

nxnynF=xn+ynyn+1=yn+hF00.01.0001.0001+0.2(1.000)=1.20010.21.2001.4001.2+0.2(1.400)=1.48020.41.4801.8801.48+0.2(1.880)=1.85630.61.856\begin{array}{c|c|c|c|c} n & x_n & y_n & F=x_n+y_n & y_{n+1}=y_n+h\,F\\\hline 0 & 0.0 & 1.000 & 1.000 & 1+0.2(1.000)=1.200\\ 1 & 0.2 & 1.200 & 1.400 & 1.2+0.2(1.400)=1.480\\ 2 & 0.4 & 1.480 & 1.880 & 1.48+0.2(1.880)=1.856\\ 3 & 0.6 & 1.856 & & \end{array}

So y(0.6)1.856y(0.6)\approx\boxed{1.856}. (The exact solution gives y(0.6)1.9436y(0.6)\approx1.9436; Euler underestimates here because the curve is concave up.)

Tip

Tip: If the solution is concave up, Euler's tangent lines lie below the curve, so the estimate is too small; if concave down, the estimate is too large. Smaller hh means smaller error.

Going Deeper: Advanced Differential Equations

Concept
Mixing (tank) problems

Let y(t)y(t) be the amount of a substance in a tank. Then

dydt=(rate in)(rate out),\frac{dy}{dt}=(\text{rate in})-(\text{rate out}),

where each rate is (concentration)×\times(flow). If the tank is well-mixed, the outflow concentration is yV\dfrac{y}{V} (current amount over current volume).

Example
A mixing problem worked out

A tank holds 100100 L with 55 kg of dissolved salt. Brine at 0.20.2 kg/L enters at 33 L/min; the mixture leaves at 33 L/min (volume stays 100100 L).

dydt=(0.2)(3)iny100(3)out=0.60.03y=0.03(y20).\frac{dy}{dt}=\underbrace{(0.2)(3)}_{\text{in}}-\underbrace{\frac{y}{100}(3)}_{\text{out}}=0.6-0.03y=-0.03\,(y-20).

This is separable with solution y=20+(520)e0.03t=2015e0.03ty=20+(5-20)e^{-0.03t}=20-15e^{-0.03t}. As tt\to\infty, y20y\to20 kg (steady state, where inflow salt balances outflow).

Concept
Why the logistic curve is S-shaped (qualitative)

Differentiate dPdt=kP ⁣(1PM)\dfrac{dP}{dt}=kP\!\left(1-\frac{P}{M}\right) with respect to tt to study d2Pdt2\dfrac{d^2P}{dt^2}. It is positive for 0<P<M20<P<\frac M2 (curve concave up, growth accelerating) and negative for M2<P<M\frac M2<P<M (concave down, growth decelerating). The sign change at P=M2P=\frac M2 is the inflection point --- the moment of fastest growth --- which is why the graph rises, bends, and levels off toward MM.

Concept
Euler's method error

Euler's method is first order: the accumulated (global) error is roughly proportional to the step size hh. Halving hh roughly halves the error but doubles the number of steps. The local error each step comes from ignoring curvature (yy''), so more curvature means faster error growth. This is why the concavity of the true solution tells you the direction of the error.

Concept
Direction-field analysis of equilibria

An equilibrium solution satisfies F(x,y)=0F(x,y)=0 (a constant solution). Classify it from the sign of dydx\dfrac{dy}{dx} nearby:

  • [leftmargin=*]
  • Stable (a sink): solutions on both sides move toward it. For logistic growth, P=MP=M is stable.
  • Unstable (a source): nearby solutions move away. For logistic growth, P=0P=0 is unstable.

A phase line records these arrows and predicts long-term behavior without solving the DE.

Example
Reading a phase line

For dydt=(y1)(y4)\dfrac{dy}{dt}=(y-1)(y-4), equilibria are y=1y=1 and y=4y=4. Testing signs: dydt>0\frac{dy}{dt}>0 for y<1y<1, <0<0 for 1<y<41<y<4, >0>0 for y>4y>4. So y=1y=1 is stable (arrows point in) and y=4y=4 is unstable (arrows point out). A solution starting at y(0)=2y(0)=2 decreases toward 11.

Concept
Second-order preview

Higher-order DEs involve yy''. For example, y=ω2yy''=-\omega^2 y models simple harmonic motion, with general solution

y=Acos(ωt)+Bsin(ωt).y=A\cos(\omega t)+B\sin(\omega t).

Two arbitrary constants A,BA,B appear because the equation is second order; two conditions (e.g. y(0)y(0) and y(0)y'(0)) pin down a particular solution. You will meet these systematically in a later course.

Tip

Big picture: Every method answers “how does yy change?” Verify by substituting; visualize with a slope field; solve exactly by separating; model growth with y0ekty_0e^{kt}, bounded growth with the logistic law; and when no formula exists, approximate with Euler's method --- always checking concavity to know which way the estimate leans.

Formulas, Proofs & Tips

Tip
Separable differential equations
dydx=g(x)h(y)  dyh(y)=g(x)dx\frac{dy}{dx}=g(x)h(y) \ \Longrightarrow\ \int\frac{dy}{h(y)}=\int g(x)\,dx

What it means. Get all the yy's on one side and all the xx's on the other, then integrate both sides.

Example. dydx=xy\tfrac{dy}{dx}=xy: dyy=xdxlny=x22+C\int\tfrac{dy}{y}=\int x\,dx\Rightarrow \ln|y|=\tfrac{x^2}{2}+C.

Why it works. Dividing by h(y)h(y) and multiplying by dxdx separates the variables; integrating both sides is valid because each side is the derivative of the same quantity with respect to xx (a chain-rule substitution in reverse).

Tip. Apply the initial condition to find CC before simplifying — it is usually much less algebra.