Skip to content

Unit 7: Differential Equations

AP Calc cheatsheet

Open ↗

Loading…

A differential equation usually does not tell you the value of a function directly. Instead, it tells you how the function changes. That is why differential equations show up whenever the important information is a rate: population growth, cooling, radioactive decay, motion, spread of a disease, charging a capacitor, or any situation where the future depends on the current state.

For example, saying

dPdt=0.2P\frac{dP}{dt}=0.2P

does not give the population P(t)P(t) immediately. It says the population grows at a rate proportional to how much population is already present. Solving the differential equation turns that rate rule into an actual population model.

For

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

the slope at a point depends on the coordinates of that point. A solution curve is a function whose tangent slope matches the differential equation everywhere it passes through.

However, a solution to a differential equation may be valid only on an interval, even if the algebraic expression looks broader. Restrictions can come from:

  • division by zero during separation,
  • logarithms introduced while integrating,
  • initial conditions that choose one branch,
  • points where the differential equation itself is undefined.

When solving an initial value problem, the interval of validity is usually the largest interval containing the initial input where the solution and differential equation both make sense.


A slope field shows small line segments representing dy/dxdy/dx at many points.

In a slope field, each small segment represents the slope assigned by the differential equation at that point. Solution curves should follow the little segments smoothly. They should not cross each other for the same initial value problem because one input-output point should determine one local direction.

To sketch a solution curve through an initial condition, start at the given point and move in the direction of the nearby line segments. Do not connect the segments with sharp corners; the solution should be a smooth curve whose tangent direction matches the field. You can reason about the solution without solving the differential equation by asking where slopes are positive, negative, zero, steep, or shallow.

xysolutionsfollowslopes

Euler’s method is repeated linear approximation. At each step, use the current slope to move forward:

ynew=yold+(step size)(slope at old point).y_{new} = y_{old} + (\text{step size})(\text{slope at old point}).

Starting from (x0,y0)(x_0,y_0) with step size hh:

yn+1=yn+hf(xn,yn),y_{n+1} = y_n + h f(x_n,y_n),

where

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

Also keep track of the input:

xn+1=xn+h.x_{n+1}=x_n+h.

The approximation improves when the step size is smaller, but AP questions usually care more about setting up the method correctly than about perfect numerical accuracy.

Euler’s method is like repeatedly using a tangent line for a short time. At (xn,yn)(x_n,y_n), the differential equation gives the slope f(xn,yn)f(x_n,y_n). If the step size is hh, then the tangent-line estimate says

Δy≈h⋅f(xn,yn).\Delta y\approx h\cdot f(x_n,y_n).

So the next point is

(xn+1,yn+1)=(xn+h, yn+hf(xn,yn)).(x_{n+1},y_{n+1})=(x_n+h,\ y_n+h f(x_n,y_n)).

The important detail is that each step uses the slope at the old point, not at the new point. After taking the step, you recalculate the slope using the new estimated point.

Example. Given dydx=x+y\dfrac{dy}{dx}=x+y with y(0)=1y(0)=1, use Euler’s method with step size h=0.5h=0.5 to approximate y(1)y(1) in two steps.

At each step the new yy is the old yy plus hh times the slope at the current point. Start at (x0,y0)=(0,1)(x_0,y_0)=(0,1).

Step 1. The slope at (0,1)(0,1) is f(0,1)=0+1=1f(0,1)=0+1=1, so

y1=y0+h f(x0,y0)=1+0.5(1)=1.5,x1=0.5.y_1 = y_0 + h\,f(x_0,y_0) = 1 + 0.5(1) = 1.5,\qquad x_1 = 0.5.

Step 2. The slope at (0.5,1.5)(0.5,1.5) is f(0.5,1.5)=0.5+1.5=2f(0.5,1.5)=0.5+1.5=2, so

y2=y1+h f(x1,y1)=1.5+0.5(2)=2.5,x2=1.y_2 = y_1 + h\,f(x_1,y_1) = 1.5 + 0.5(2) = 2.5,\qquad x_2 = 1.

Collecting the steps in a table:

nxnynf(xn,yn)001110.51.52212.5−\begin{array}{c|c|c|c} n & x_n & y_n & f(x_n,y_n) \\ \hline 0 & 0 & 1 & 1 \\ 1 & 0.5 & 1.5 & 2 \\ 2 & 1 & 2.5 & - \end{array}

So Euler’s method gives the approximation y(1)≈2.5y(1)\approx 2.5.


A separable equation has the variables separated into an xx part and a yy part.

If

dydx=g(x)h(y),\frac{dy}{dx} = g(x)h(y),

rewrite as

1h(y) dy=g(x) dx\frac{1}{h(y)}\,dy = g(x)\,dx

and integrate both sides.

The constant of integration belongs after integration, and an initial condition turns the general solution into a particular solution.

A general solution contains an arbitrary constant and represents a whole family of possible solution curves. A particular solution uses an initial condition to choose exactly one curve from that family.

For example, after separating variables you might get

y2=x2+C.y^2=x^2+C.

That is a general solution because different values of CC give different curves. If the problem also says y(0)=2y(0)=2, then you substitute that point to find C=4C=4, giving the particular solution

y=x2+4.y=\sqrt{x^2+4}.

Example. Solve dydx=xy\dfrac{dy}{dx}=\dfrac{x}{y} with the initial condition y(0)=2y(0)=2.

Separate the variables, moving all yy factors with dydy and all xx factors with dxdx:

y dy=x dx.y\,dy = x\,dx.

Integrate both sides:

y22=x22+C.\frac{y^2}{2} = \frac{x^2}{2} + C.

Multiplying by 22 and renaming the constant gives the general solution

y2=x2+C.y^2 = x^2 + C.

Apply the initial condition y(0)=2y(0)=2:

(2)2=(0)2+C⟹C=4.(2)^2 = (0)^2 + C \quad\Longrightarrow\quad C = 4.

Since y(0)=2>0y(0)=2>0, take the positive square root to get the particular solution

y=x2+4.y = \sqrt{x^2 + 4}.

A first-order linear differential equation has the form

dydx+P(x)y=Q(x).\frac{dy}{dx}+P(x)y=Q(x).

The standard method of solving is to multiply by an integrating factor

μ(x)=e∫P(x) dx.\mu(x)=e^{\int P(x)\,dx}.

Then the left side becomes the derivative of a product:

ddx[μ(x)y]=μ(x)Q(x).\frac{d}{dx}\bigl[\mu(x)y\bigr]=\mu(x)Q(x).

After that, integrate both sides and solve for yy.

Example. Solve

dydx+2y=6\frac{dy}{dx}+2y=6

with y(0)=1y(0)=1.

Here

P(x)=2,Q(x)=6.P(x)=2, \qquad Q(x)=6.

The integrating factor is

μ(x)=e∫2 dx=e2x.\mu(x)=e^{\int 2\,dx}=e^{2x}.

Multiply the differential equation by e2xe^{2x}:

e2xdydx+2e2xy=6e2x.e^{2x}\frac{dy}{dx}+2e^{2x}y=6e^{2x}.

The left side is

ddx(e2xy).\frac{d}{dx}\left(e^{2x}y\right).

So

ddx(e2xy)=6e2x.\frac{d}{dx}\left(e^{2x}y\right)=6e^{2x}.

Integrate both sides:

e2xy=3e2x+C.e^{2x}y=3e^{2x}+C.

Divide by e2xe^{2x}:

y=3+Ce−2x.y=3+Ce^{-2x}.

Use y(0)=1y(0)=1:

1=3+C⟹C=−2.1=3+C \quad\Longrightarrow\quad C=-2.

Therefore the particular solution is

y=3−2e−2x.y=3-2e^{-2x}.

Second derivative from a differential equation

Section titled “Second derivative from a differential equation”

If

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

then

d2ydx2\frac{d^2y}{dx^2}

often comes from differentiating implicitly:

d2ydx2=ddx[f(x,y)].\frac{d^2y}{dx^2} = \frac{d}{dx}[f(x,y)].

When differentiating, remember that yy depends on xx. After finding d2y/dx2d^2y/dx^2, use its sign to describe whether solution curves are concave up or concave down.

Example. For solutions of

dydx=x−y,\frac{dy}{dx}=x-y,

find d2ydx2\frac{d^2y}{dx^2} in terms of xx and yy, then determine the concavity at the point (2,1)(2,1).

Differentiate both sides with respect to xx:

d2ydx2=ddx(x−y).\frac{d^2y}{dx^2} = \frac{d}{dx}(x-y).

Since yy depends on xx,

d2ydx2=1−dydx.\frac{d^2y}{dx^2}=1-\frac{dy}{dx}.

Substitute dydx=x−y\frac{dy}{dx}=x-y:

d2ydx2=1−(x−y)=1−x+y.\frac{d^2y}{dx^2}=1-(x-y)=1-x+y.

At (2,1)(2,1),

d2ydx2=1−2+1=0.\frac{d^2y}{dx^2}=1-2+1=0.

The solution curve has zero second derivative at that point, so this test alone says the curve is an inflection point of the curve.


If the rate of change is proportional to the amount present:

dydt=ky\frac{dy}{dt} = ky

then

y=Cekt.y = Ce^{kt}.

Proof (Exponential model equation). If

dydt=ky,\frac{dy}{dt}=ky,

then the relative rate of change is constant:

1ydydt=k.\frac{1}{y}\frac{dy}{dt}=k.

Integrating gives

ln⁡∣y∣=kt+C.\ln\lvert y\rvert=kt+C.

Exponentiating both sides gives

y=Cekt.y=Ce^{kt}.

So exponentials are the natural functions whose rate of change stays proportional to their current value.

Example. A radioactive sample decays according to dydt=ky\dfrac{dy}{dt}=ky and has a half-life of 55 years. Find the decay constant kk, and determine how much of an initial 8080-gram sample remains after 1515 years.

The solution has the form y=Cekty=Ce^{kt}, where CC is the initial amount. A half-life of 55 years means that after t=5t=5 the amount is half of CC:

12C=Ce5k⟹e5k=12.\tfrac{1}{2}C = Ce^{5k} \quad\Longrightarrow\quad e^{5k} = \tfrac{1}{2}.

Take the natural log of both sides and solve for kk:

5k=ln⁡12=−ln⁡2⟹k=−ln⁡25≈−0.1386.5k = \ln\tfrac{1}{2} = -\ln 2 \quad\Longrightarrow\quad k = -\frac{\ln 2}{5} \approx -0.1386.

With C=80C=80, the amount after 1515 years is

y(15)=80 e15k=80 e−3ln⁡2=80⋅2−3=80⋅18=10.y(15) = 80\,e^{15k} = 80\,e^{-3\ln 2} = 80\cdot 2^{-3} = 80\cdot\tfrac{1}{8} = 10.

So 1010 grams remain. This matches the intuition that 1515 years is exactly three half-lives, leaving (12)3=18\left(\tfrac{1}{2}\right)^3=\tfrac{1}{8} of the original.


Equilibrium solutions are constant solutions where dy/dx=0dy/dx = 0. For an autonomous differential equation

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

an equilibrium solution occurs when

f(y)=0.f(y)=0.

At those yy-values, the slope is zero for every xx, so the solution can remain constant.

Stability:

  • stable if nearby solutions move toward it,
  • unstable if nearby solutions move away,
  • semistable if nearby solutions move toward it from one side and away from it on the other.

For autonomous equations dy/dx=f(y)dy/dx = f(y), a sign chart on f(y)f(y) is an efficient way to classify equilibria.

Example. Classify the equilibrium solutions of

dydx=y(4−y).\frac{dy}{dx}=y(4-y).

Set the right side equal to zero:

y(4−y)=0.y(4-y)=0.

Thus the equilibrium solutions are

y=0andy=4.y=0 \qquad\text{and}\qquad y=4.

Test the sign of y(4−y)y(4-y) on the intervals determined by 00 and 44:

  • If y<0y<0, then y(4−y)<0y(4-y)<0, so solutions move downward.
  • If 0<y<40<y<4, then y(4−y)>0y(4-y)>0, so solutions move upward.
  • If y>4y>4, then y(4−y)<0y(4-y)<0, so solutions move downward.

Solutions move away from y=0y=0, so y=0y=0 is unstable. Solutions move toward y=4y=4 from both sides, so y=4y=4 is stable.


The logistic model is

dydt=ky(1−yL)\frac{dy}{dt} = ky\left(1-\frac{y}{L}\right)

where LL is the carrying capacity.

Behavior:

  • equilibrium solutions at y=0y=0 and y=Ly=L,
  • growth is fastest near y=L/2y=L/2,
  • solutions below LL increase toward LL.

Example. A population is modeled by dydt=0.1 y(1−y2000)\dfrac{dy}{dt}=0.1\,y\left(1-\dfrac{y}{2000}\right). State the carrying capacity, the population at which growth is fastest, and the value of dydt\dfrac{dy}{dt} at that population.

Comparing with the standard form dydt=ky(1−yL)\dfrac{dy}{dt}=ky\left(1-\dfrac{y}{L}\right), we read off k=0.1k=0.1 and L=2000L=2000. The carrying capacity is therefore

L=2000.L = 2000.

Growth is fastest at half the carrying capacity:

y=L2=1000.y = \frac{L}{2} = 1000.

At y=1000y=1000, the rate of change is

dydt=0.1(1000)(1−10002000)=100⋅12=50.\frac{dy}{dt} = 0.1(1000)\left(1-\frac{1000}{2000}\right) = 100\cdot\frac{1}{2} = 50.

So the population grows fastest, at 5050 individuals per unit time, when it reaches 10001000.


Differential equation questions often move among four representations:

  • a formula for dy/dxdy/dx,
  • a slope field,
  • a particular solution through an initial condition,
  • a verbal model of growth, decay, or limiting behavior.