5.18 Differential equations

5.18 Differential equations

IB Maths: Analysis and Approaches HL: Revision notes

Studying this course? Keep your progress in one place.

Key facts

  • The general solution has an arbitrary constant (a family of curves); a particular solution uses an initial condition.
  • Euler's method: yn+1=yn+hf(xn,yn)y_{n+1}=y_{n}+hf(x_{n},y_{n}); concave up means an underestimate.
  • Separable: ∫1h(y) dy=∫g(x) dx\int\dfrac{1}{h(y)}\,\mathrm{d}y=\int g(x)\,\mathrm{d}x; include +c+c immediately.
  • Logistic dndt=kn(a−n)\dfrac{\mathrm{d}n}{\mathrm{d}t}=kn(a-n): partial fractions, limit aa, fastest growth at n=a2n=\frac{a}{2}.
  • Homogeneous: y=vxy=vx then separate. Linear: integrating factor e∫P dxe^{\int P\,\mathrm{d}x}, then ddx(yI)=QI\frac{\mathrm{d}}{\mathrm{d}x}(yI)=QI.
246810121416182020406080100xycarrying capacity 100fastest growth (4.39, 50)n = 100/(1 + 9e^(−0.5t))
A logistic curve levels off at the carrying capacity 100.

First order equations

A first order equation involves only dydx\frac{\mathrm{d}y}{\mathrm{d}x}. Its general solution is a family of curves; an initial condition picks out a particular solution.

A differential equation links a function with its derivatives. A first order equation involves only dydx\dfrac{\mathrm{d}y}{\mathrm{d}x}, for example dydx=x+y\dfrac{\mathrm{d}y}{\mathrm{d}x}=x+y.

The general solution has an arbitrary constant. A particular solution uses an initial condition, such as y=2y=2 when x=0x=0, to fix it. Check any solution by differentiating and substituting back.

−3−2−1123−4−2246810xyy = x² + c
y = x² + c: drag the slider to see the family of curves.

Solve dydx=2x\dfrac{\mathrm{d}y}{\mathrm{d}x}=2x given that y=3y=3 when x=1x=1.

Euler's method

Step along tangent lines with a fixed step length hh: yn+1=yn+hf(xn,yn)y_{n+1}=y_{n}+hf(x_{n},y_{n}).

When dydx=f(x,y)\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x,y) cannot be solved exactly, Euler's method uses yn+1=yn+h f(xn,yn)y_{n+1}=y_{n}+h\,f(x_{n},y_{n}) and xn+1=xn+hx_{n+1}=x_{n}+h, where hh is the step length.

If the solution is concave up (d2ydx2>0\frac{\mathrm{d}^{2}y}{\mathrm{d}x^{2}}>0), tangents lie below it and Euler underestimates; concave down gives an overestimate. A smaller hh usually gives a better approximation but needs more steps.

0.050.10.150.20.250.30.350.40.450.50.811.21.41.61.8xy(0, 1)(0.1, 1.1)exact solution
Euler points (h = 0.1) lie below the exact curve, which is concave up.

Worked example

Use Euler's method with h=0.1h=0.1 to estimate y(0.2)y(0.2) for dydx=x+y\dfrac{\mathrm{d}y}{\mathrm{d}x}=x+y, y(0)=1y(0)=1.

For dydx=2y\dfrac{\mathrm{d}y}{\mathrm{d}x}=2y, y(0)=1y(0)=1 and h=0.5h=0.5, what is y1y_{1}?

Separating the variables

If dydx=g(x)h(y)\frac{\mathrm{d}y}{\mathrm{d}x}=g(x)h(y), rearrange and integrate each side. The logistic equation is separable.

If dydx=g(x)h(y)\dfrac{\mathrm{d}y}{\mathrm{d}x}=g(x)h(y), it is separable: ∫1h(y) dy=∫g(x) dx\int\dfrac{1}{h(y)}\,\mathrm{d}y=\int g(x)\,\mathrm{d}x. Add the constant immediately. Since ln⁡∣y∣=x3+c\ln|y|=x^{3}+c gives ∣y∣=ecex3|y|=e^{c}e^{x^{3}}, the constant becomes a multiplier: y=Aex3y=Ae^{x^{3}}, not ex3+ce^{x^{3}}+c.

The logistic equation dndt=kn(a−n)\dfrac{\mathrm{d}n}{\mathrm{d}t}=kn(a-n) needs partial fractions: 1n(a−n)=1a(1n+1a−n)\frac{1}{n(a-n)}=\frac{1}{a}\left(\frac{1}{n}+\frac{1}{a-n}\right). The solution n=a1+Be−aktn=\frac{a}{1+Be^{-akt}} levels off at the carrying capacity aa. Growth is fastest when n=a2n=\frac{a}{2}.

246810121416182020406080100xycarrying capacity 100fastest growth (4.39, 50)n = 100/(1 + 9e^(−0.5t))
Growth is fastest at half the carrying capacity.

Worked example

Solve dydx=3x2y\dfrac{\mathrm{d}y}{\mathrm{d}x}=3x^{2}y.

Solve dydx=2y\dfrac{\mathrm{d}y}{\mathrm{d}x}=2y given y=3y=3 when x=0x=0.

Homogeneous equations

Substitute y=vxy=vx, which makes the equation separable in vv and xx. Finally replace vv by yx\frac{y}{x}.

A homogeneous equation can be written dydx=f(yx)\dfrac{\mathrm{d}y}{\mathrm{d}x}=f\left(\dfrac{y}{x}\right), for example xy+yx\dfrac{x}{y}+\dfrac{y}{x}. To test, divide top and bottom by the highest power of xx and check only yx\frac{y}{x} is left.

Let y=vxy=vx, so dydx=v+xdvdx\dfrac{\mathrm{d}y}{\mathrm{d}x}=v+x\dfrac{\mathrm{d}v}{\mathrm{d}x} (product rule). Then ∫1f(v)−v dv=∫1x dx\int\dfrac{1}{f(v)-v}\,\mathrm{d}v=\int\dfrac{1}{x}\,\mathrm{d}x.

  • y=vxy=vxdydx=v+xdvdx\dfrac{\mathrm{d}y}{\mathrm{d}x}=v+x\dfrac{\mathrm{d}v}{\mathrm{d}x}

Worked example

Solve dydx=xy+yx\dfrac{\mathrm{d}y}{\mathrm{d}x}=\dfrac{x}{y}+\dfrac{y}{x} given y(1)=2y(1)=2.

With the substitution y=vxy=vx, what is dydx\dfrac{\mathrm{d}y}{\mathrm{d}x}?

Linear equations: integrating factor

Multiply through by the integrating factor e∫P dxe^{\int P\,\mathrm{d}x}. The left side becomes the derivative of a product.

A linear first order equation has the form dydx+P(x)y=Q(x)\dfrac{\mathrm{d}y}{\mathrm{d}x}+P(x)y=Q(x). Multiply by the integrating factor I(x)=e∫P(x) dxI(x)=e^{\int P(x)\,\mathrm{d}x}. Then ddx(yI)=QI\dfrac{\mathrm{d}}{\mathrm{d}x}(yI)=QI, so yI=∫QI dxyI=\int QI\,\mathrm{d}x.

Put the equation in standard form first: for xdydx+2y=x3x\frac{\mathrm{d}y}{\mathrm{d}x}+2y=x^{3}, divide by xx to get P=2xP=\frac{2}{x}. Divide the constant by II at the end too.

  1. 1

    Standard form

    dydx+P(x)y=Q(x)\frac{\mathrm{d}y}{\mathrm{d}x}+P(x)y=Q(x)

  2. 2

    Integrating factor

    I=e∫P dxI=e^{\int P\,\mathrm{d}x}

  3. 3

    Multiply through

    the left side becomes ddx(yI)=QI\frac{\mathrm{d}}{\mathrm{d}x}(yI)=QI

  4. 4

    Integrate and solve

    yI=∫QI dx+CyI=\int QI\,\mathrm{d}x+C, then use the initial condition

Method for a linear first order equation.

Worked example

Solve dhdt+ht+1=6\dfrac{\mathrm{d}h}{\mathrm{d}t}+\dfrac{h}{t+1}=6 given h(0)=5h(0)=5.

What is the integrating factor for dydx+3y=x\dfrac{\mathrm{d}y}{\mathrm{d}x}+3y=x?

Try an exam question

Solve dydx=3x2y\dfrac{\mathrm{d}y}{\mathrm{d}x}=3x^{2}y given that y=2y=2 when x=0x=0. Give yy in terms of xx.

[4 marks]

That's the notes covered.

Carry on to the next subtopic.

Try a question

Find y1y_1.

1 mark, marked against the mark scheme

Revision notes