Navigation

Differential Equations · Topic 23 of 23

Qualitative and Numerical Methods for Differential Equations

For an autonomous equation y=f(y)y'=f(y) the roots of ff and the sign of ff between them decide every long-run limit — no solution formula required. Euler's method turns the same tangent-line idea into numbers, stepping forward with yn+1=yn+hF(xn,yn)y_{n+1}=y_n+h\,F(x_n,y_n) at a global error of only O(h)O(h).

5 min readOccasional on exams8 formulas6 quick checks
01

Key ideas

5 things to remember
  1. 1

    The equation hands you every slope

    For y=F(x,y)y'=F(x,y), any solution through (a,b)(a,b) has slope F(a,b)F(a,b) — so you can sketch solution curves before solving anything. The level-kk isocline F(x,y)=kF(x,y)=k collects the points where the field slope is kk.

  2. 2

    Equilibria are the roots of ff

    If y=f(y)y'=f(y) is autonomous, every root cc of ff gives the constant solution y(t)=cy(t)=c. Solve f(y)=0f(y)=0 — not the differential equation — and never skip a repeated root.

  3. 3

    Arrows classify, the derivative confirms

    f>0f>0 pushes yy up, f<0f<0 pushes it down. Arrows in from both sides means stable, out from both means unstable, through means semi-stable; f(c)<0f'(c)<0 stable, f(c)>0f'(c)>0 unstable, f(c)=0f'(c)=0 decides nothing.

  4. 4

    Solutions are monotone and never cross

    A non-equilibrium solution stays in one sign-interval of ff forever, so it is strictly monotone — it can never oscillate. Bounded, it converges to the equilibrium the arrow points at; unbounded, it may escape in finite time.

  5. 5

    Euler walks along tangent lines

    Each step replaces the curve by its tangent, so Euler undershoots a concave-up solution and overshoots a concave-down one. The global error is O(h)O(h): halving hh only halves it, and doubles the work.

123456246xyy = 4 stableinflection at y = 2y(0) = 0.5y(0) = 6y = 0 is unstable
The phase line for y=y(1y/4)y'=y(1-y/4), drawn as solutions. Arrows point up on (0,4)(0,4) and down above 44, so every start with y(0)>0y(0)>0 runs to the carrying capacity 44 and none of them crosses it. The rising curve turns over at the half-capacity level y=2y=2.
0.51.01.52.02468xyEuler, h = 0.5(0, 1)y₄ = 5.0625exact ≈ 7.389exact y = eˣ
Euler's method on y=yy'=y, y(0)=1y(0)=1 with h=0.5h=0.5: four straight steps, each one a tangent line of the curve it is standing on. Because exe^{x} is concave up every tangent lies below it, so the polygon falls behind — y4=5.0625y_4=5.0625 against e27.389e^{2}\approx 7.389.
02

Formulas

What to have memorised
  • Slope field and isoclines

    dydx=F(x,y),isocline of level k: F(x,y)=k\frac{dy}{dx}=F(x,y),\qquad \text{isocline of level } k:\ F(x,y)=k

    Field slope at (a,b)(a,b) is F(a,b)F(a,b); the nullcline k=0k=0 is where tangents are horizontal.

  • Equilibrium of an autonomous equation

    y=f(y),f(c)=0  y(t)=c solves ity'=f(y),\quad f(c)=0\ \Longrightarrow\ y(t)=c \text{ solves it}

    Autonomous means tt never appears on the right-hand side.

  • Derivative test for stability

    f(c)<0  stable,f(c)>0  unstablef'(c)<0\ \Rightarrow\ \text{stable},\qquad f'(c)>0\ \Rightarrow\ \text{unstable}

    f(c)=0f'(c)=0 is inconclusive — go back to the sign chart of ff.

  • Concavity of a solution curve

    y=ddtf(y)=f(y)f(y)y''=\frac{d}{dt}f(y)=f'(y)\,f(y)

    Chain rule on the equation itself. An inflection sits where ff' changes sign.

  • Logistic equation

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

    P=0P=0 unstable, P=MP=M stable; growth is fastest at P=M2P=\frac{M}{2}, rate kM4\frac{kM}{4}.

  • Logistic solution

    P(t)=M1+Aekt,A=MP0P0P(t)=\frac{M}{1+Ae^{-kt}},\qquad A=\frac{M-P_0}{P_0}

    Needs P00P_0\neq 0; then P(t)MP(t)\to M for every P0>0P_0>0.

  • Euler's method

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

    Read the slope at the point you are standing on, then advance both.

  • Euler's error

    y(xn)yn=O(h)\left|y(x_n)-y_n\right|=O(h)

    Each step costs O(h2)O(h^2), and there are N=(ba)/hN=(b-a)/h steps: first-order accuracy.

03

Read $y'=f(y)$ off a phase line

The steps, in order
  1. 1

    Solve f(y)=0f(y)=0 for every root, repeated ones included. Each root cc is an equilibrium, the constant solution y(t)=cy(t)=c.

  2. 2

    Mark the roots on a vertical yy-axis and test the sign of ff between them: arrow up where f>0f>0, down where f<0f<0.

  3. 3

    Classify each root: arrows in from both sides is stable, out from both is unstable, through is semi-stable.

  4. 4

    Confirm with f(c)f'(c) — negative stable, positive unstable, zero inconclusive. A repeated root always lands in the zero case.

  5. 5

    For a given y(0)y(0), follow the arrow of its interval. The solution is monotone and can never reach or cross an equilibrium.

  6. 6

    State the limit: the equilibrium the arrow points at, or ±\pm\infty — which may arrive in finite time.

  7. 7

    For shape, use y=f(y)f(y)y''=f'(y)f(y): an inflection sits at each level where ff' changes sign.

04

Watch out

The mistakes that cost marks
  • ✗ Wrong

    For y=xyy'=x-y the segments are horizontal along y=xy=x, so y=xy=x is a solution.

    ✓ Right

    y=xy=x has slope 11, not 00. The solution is y=x1y=x-1, where F=x(x1)=1F=x-(x-1)=1 matches its own slope.

    Why: An isocline records the field's slope, not the curve's.

  • ✗ Wrong

    f(c)=0f'(c)=0, so cc is stable.

    ✓ Right

    f(c)=0f'(c)=0 is precisely the inconclusive case; classify from the sign of ff on each side of cc.

    Why: f(y)=(y1)2(y+2)f(y)=(y-1)^2(y+2) has f(1)=0f'(1)=0 and y=1y=1 is semi-stable.

  • ✗ Wrong

    For y=y24y'=y^2-4 the equilibrium is y=0y=0.

    ✓ Right

    Set the right-hand side to zero: y24=0y^2-4=0 gives the equilibria y=2y=-2 and y=2y=2.

    Why: Equilibria are the roots of ff, not the zeros of the solution.

  • ✗ Wrong

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

    ✓ Right

    yn+1=yn+hF(xn,yn)y_{n+1}=y_n+h\,F(x_n,y_n): slope at the point you are on, then advance xx and yy together.

    Why: Dropping hh or advancing xx early wrecks every later row.

  • ✗ Wrong

    Halving hh quarters Euler's error.

    ✓ Right

    That is the local error, O(h2)O(h^2). Over a fixed interval the accumulated error is O(h)O(h), so halving hh roughly halves it.

    Why: There are N=(ba)/hN=(b-a)/h steps, and NO(h2)=O(h)N\cdot O(h^2)=O(h).

  • ✗ Wrong

    Euler's method always underestimates.

    ✓ Right

    Only for a concave-up solution. For y=32yy'=3-2y, y(0)=1y(0)=1, y=2(32y)<0y''=-2(3-2y)<0 and Euler overestimates.

    Why: A tangent lies below a concave-up curve and above a concave-down one.

05

Quick check

Commit to an answer before you reveal one
  1. Q1easy

    Consider dydx=xy\dfrac{dy}{dx}=x-y.

    (a) Give the slope of the field segment at (0,0)(0,0), (1,0)(1,0), (0,1)(0,1) and (2,1)(2,1). (b) Find the isocline of level kk and describe the family. (c) Show that y=x1y=x-1 is a solution but y=xy=x is not.

    Hint

    The field slope at (a,b)(a,b) is just F(a,b)F(a,b); the level-kk isocline is the curve F(x,y)=kF(x,y)=k.

    Show answer

    Answer

    (a) 0, 1, 1, 10,\ 1,\ -1,\ 1. (b) y=xky=x-k — parallel lines of slope 11. (c) y=x1y=x-1 works; y=xy=x has slope 11 where the field prescribes 00.

    Steps

    (a) F(x,y)=xyF(x,y)=x-y, so the slopes are 00=00-0=0, 10=11-0=1, 01=10-1=-1 and 21=12-1=1.

    (b) xy=kx-y=k rearranges to y=xky=x-k: a family of parallel lines of slope 11, one per kk. The nullcline k=0k=0 is y=xy=x, where every segment is horizontal.

    (c) For y=x1y=x-1: left side ddx(x1)=1\frac{d}{dx}(x-1)=1, right side x(x1)=1x-(x-1)=1, equal for all xx. For y=xy=x: left side 11, right side xx=0x-x=0, and 101\neq 0.

  2. Q2easy

    Use Euler's method with h=0.1h=0.1 and two steps to estimate y(1.2)y(1.2) for dydx=xy\dfrac{dy}{dx}=xy, y(1)=2y(1)=2. Then solve the initial value problem exactly, compare, and explain the sign of the error using concavity.

    Hint

    Evaluate the slope at the point you are standing on, then advance both xx and yy.

    Show answer

    Answer

    y(1.2)2.442y(1.2)\approx 2.442; exactly y=2e(x21)/2y=2e^{(x^2-1)/2}, so y(1.2)=2e0.222.4922y(1.2)=2e^{0.22}\approx 2.4922. Euler underestimates by about 0.0500.050 because the solution is concave up.

    Steps

    y1=2+0.1(1)(2)=2.2y_1=2+0.1(1)(2)=2.2 at x1=1.1x_1=1.1, then

    y2=2.2+0.1(1.1)(2.2)=2.2+0.242=2.442at x2=1.2.y_2=2.2+0.1(1.1)(2.2)=2.2+0.242=2.442\quad\text{at } x_2=1.2 .

    Separating: dyy=xdx\frac{dy}{y}=x\,dx, so lny=x22+C\ln y=\frac{x^2}{2}+C and y=Aex2/2y=Ae^{x^2/2}. From y(1)=2y(1)=2, A=2e1/2A=2e^{-1/2} and y=2e(x21)/2y=2e^{(x^2-1)/2}, giving y(1.2)=2e0.222.4922y(1.2)=2e^{0.22}\approx 2.4922.

    The error is 0.0502\approx 0.0502. Differentiating the equation, y=y+xy=y(1+x2)>0y''=y+xy'=y(1+x^2)>0, so the curve is concave up and each tangent step lands below it.

  3. Q3medium

    For dydt=y24\dfrac{dy}{dt}=y^2-4:

    (a) find every equilibrium and classify it, confirming with the derivative test; (b) give limty(t)\lim_{t\to\infty}y(t) for y(0)=5y(0)=-5, y(0)=0y(0)=0 and y(0)=3y(0)=3.

    Hint

    Factor the right-hand side and take the sign of ff on the three intervals its roots create.

    Show answer

    Answer

    (a) y=2y=-2 stable, y=2y=2 unstable. (b) 2-2 and 2-2; from y(0)=3y(0)=3 the solution increases without bound — it blows up at t=ln54t=\frac{\ln 5}{4}, so the limit does not exist.

    Steps

    (a) f(y)=(y2)(y+2)=0f(y)=(y-2)(y+2)=0 gives y=±2y=\pm 2. Signs: f>0f>0 for y<2y<-2, f<0f<0 on (2,2)(-2,2), f>0f>0 for y>2y>2. Arrows point at 2-2 (stable) and away from 22 (unstable). Check: f(y)=2yf'(y)=2y, so f(2)=4<0f'(-2)=-4<0 and f(2)=4>0f'(2)=4>0.

    (b) From 5-5: increasing, trapped below 2-2, so y2y\to -2. From 00: decreasing toward the equilibrium beneath it, y2y\to -2. From 33: increasing with nothing above it. Separating gives y=10+2e4t5e4ty=\frac{10+2e^{4t}}{5-e^{4t}}, which escapes at t=ln540.40t=\frac{\ln 5}{4}\approx 0.40.

  4. Q4medium

    Consider dydt=(y1)2(y+2)\dfrac{dy}{dt}=(y-1)^2(y+2).

    (a) Find all equilibria and classify each, stating where the derivative test fails and why. (b) Describe the long-run behaviour for y(0)=3y(0)=-3, y(0)=0y(0)=0 and y(0)=1.5y(0)=1.5.

    Hint

    A squared factor cannot change sign — think about the arrows on either side of that root.

    Show answer

    Answer

    (a) y=2y=-2 unstable; y=1y=1 semi-stable, with f(1)=0f'(1)=0 so the derivative test says nothing there. (b) yy\to-\infty; y1y\to 1; y+y\to+\infty.

    Steps

    (a) f(y)=0f(y)=0 at y=2y=-2 and at the double root y=1y=1. Since (y1)20(y-1)^2\ge 0, the sign of ff is the sign of y+2y+2: f<0f<0 for y<2y<-2, and f>0f>0 on both (2,1)(-2,1) and (1,)(1,\infty). So arrows flee 2-2 (unstable) and point up on both sides of 11 (semi-stable).

    f(y)=2(y1)(y+2)+(y1)2=3(y1)(y+1)f'(y)=2(y-1)(y+2)+(y-1)^2=3(y-1)(y+1), so f(2)=9>0f'(-2)=9>0 confirms unstable, while f(1)=0f'(1)=0 is the inconclusive repeated-root case.

    (b) Follow the arrows: down from 3-3 without bound; up from 00 to 11; up from 1.51.5 without bound.

  5. Q5medium

    Let y(t)y(t) solve dydt=y(4y)\dfrac{dy}{dt}=y(4-y) with y(0)=1y(0)=1.

    (a) Without solving, say where the solution curve is concave up and where concave down, and give the yy-value of its inflection. (b) Solve explicitly and find the exact time at which the inflection occurs.

    Hint

    Differentiate the equation itself with the chain rule: y=f(y)f(y)y''=f'(y)\,f(y).

    Show answer

    Answer

    (a) Concave up for 1y<21\le y<2, concave down for 2<y<42<y<4; inflection at height y=2y=2. (b) y(t)=41+3e4ty(t)=\dfrac{4}{1+3e^{-4t}}, with the inflection at t=ln340.275t=\dfrac{\ln 3}{4}\approx 0.275.

    Steps

    (a) With f(y)=y(4y)f(y)=y(4-y) and f(y)=42yf'(y)=4-2y,

    y=f(y)f(y)=2(2y)y(4y).y''=f'(y)f(y)=2(2-y)\,y\,(4-y).

    The solution starts at y=1y=1 and uniqueness traps it in (0,4)(0,4), where y>0y>0 and 4y>04-y>0, so the sign of yy'' is the sign of 2y2-y: concave up below the level 22, concave down above it.

    (b) This is logistic with k=4k=4, M=4M=4 and A=My0y0=3A=\frac{M-y_0}{y_0}=3, so y=41+3e4ty=\frac{4}{1+3e^{-4t}}. Setting y=2y=2 gives e4t=13e^{-4t}=\frac13, hence t=ln340.275t=\frac{\ln 3}{4}\approx 0.275.

  6. Q6hard

    Apply Euler's method to dydx=y\dfrac{dy}{dx}=y, y(0)=1y(0)=1 on [0,1][0,1] with h=1/Nh=1/N.

    (a) Show the approximation to y(1)y(1) is exactly (1+h)1/h(1+h)^{1/h}. (b) Give it and its error for h=1, 0.5, 0.25, 0.125h=1,\ 0.5,\ 0.25,\ 0.125, plus the ratio of consecutive errors. (c) What order of accuracy do those ratios show, and what is limh0+(1+h)1/h\lim_{h\to 0^+}(1+h)^{1/h}?

    Hint

    Write y1y_1, y2y_2, y3y_3 in terms of y0y_0 and look for the pattern before computing anything.

    Show answer

    Answer

    (a) yn+1=(1+h)yny_{n+1}=(1+h)y_n, so yN=(1+h)N=(1+h)1/hy_N=(1+h)^N=(1+h)^{1/h}. (b) 22, 2.252.25, 2.44142.4414, 2.56582.5658; errors 0.71830.7183, 0.46830.4683, 0.27690.2769, 0.15250.1525; ratios 1.531.53, 1.691.69, 1.821.82. (c) First order, O(h)O(h); the limit is ee.

    Steps

    (a) F(x,y)=yF(x,y)=y makes the update yn+1=yn+hyn=(1+h)yny_{n+1}=y_n+hy_n=(1+h)y_n, a geometric recursion, so yn=(1+h)ny_n=(1+h)^n. Reaching x=1x=1 takes N=1/hN=1/h steps, hence yN=(1+h)1/hy_N=(1+h)^{1/h}.

    (b) The exact value is y(1)=e2.71828y(1)=e\approx 2.71828. Then 21=22^1=2, 1.52=2.251.5^2=2.25, 1.254=2.441411.25^4=2.44141 and 1.12582.565781.125^8\approx 2.56578; subtracting each from ee gives the errors, whose consecutive ratios are 1.531.53, 1.691.69, 1.821.82.

    (c) An error Chp\approx Ch^p would shrink by 2p2^p when hh halves. The ratios climb toward 22, so p=1p=1: first-order, O(h)O(h). The values converge to limh0+(1+h)1/h=e\lim_{h\to 0^+}(1+h)^{1/h}=e.

06

On the exam

How this topic is marked
  • Phase-line marks live in the sign chart: show f(y)=0f(y)=0 solved, the sign of ff on each interval, the arrows, then read the limit off the picture.

  • Lay Euler's method out as a table with one row per step — xnx_n, yny_n, F(xn,yn)F(x_n,y_n), yn+1y_{n+1} — and keep every digit; a slip in row one poisons the rest.

  • If asked whether the estimate is too big or too small, compute yy'' and name the concavity. "Euler undershoots" with no reason earns nothing.

Keep going