πŸ“² Free Maths PDF app for iPhone and AndroidDownload β†’
Skip to content
Maths PDF – Otto the owl teaching maths: free lessons, worksheets, quizzes and tests

Differential equations – university Year 1 maths lesson to download as PDF

University differential equations revision notes – Otto the owl, Maths PDF
University Maths Year 1 – Lessons – PDF
Prefer a book?The same course as a ready-to-print PDF Β· Β£7.99See the book

This University differential equations revision notes is written for pupils aged 18-19. In short, it shows you how to solve separable, linear and constant-coefficient differential equations. Before you start, it helps to revise eigenvalues and eigenvectors and multivariable calculus, because this lesson builds on them.

University differential equations revision notes: what you will learn

Differential equations relate a function to its derivatives. They model growth, cooling, circuits, mechanics and epidemics, and they are the language of applied mathematics.

Starter activity

A cup of tea at \(90^\circ\)C is left in a kitchen at \(20^\circ\)C. Sketch how you think its temperature changes over an hour. When is the tea cooling fastest? What would you expect the graph to look like in the long run? Now suggest a rule connecting the rate of change of the temperature with the temperature itself. You have just invented a differential equation!

Basic ideas

Definition: differential equation, order and general solution

A differential equation (DE) relates a function to its derivatives. Its order is the highest derivative that appears. A general solution contains as many arbitrary constants as the order. An initial value problem (IVP) adds conditions such as \(y(0)=1\) that fix the constants.

Separable equations

Rule: separation of variables

If \(\dfrac{dy}{dx}=f(x)g(y)\), then \(\displaystyle\int\frac{dy}{g(y)}=\int f(x)\,dx\).

Method: separable equations

  1. Move all \(y\) terms to one side and all \(x\) terms to the other.
  2. Integrate both sides, with one constant.
  3. Rearrange for \(y\) if possible.
  4. Use the initial condition to find the constant.

Example 1

Solve \(\dfrac{dy}{dx}=xy\), and solve \(\dfrac{dy}{dx}=y^2\) with \(y(0)=1\).

First: \(\int\frac{dy}y=\int x\,dx\), so \(\ln|y|=\frac{x^2}2+c\) and \(y=Ce^{x^2/2}\). Second: \(\int y^{-2}dy=\int dx\) gives \(-\frac1y=x+c\); \(y(0)=1\) gives \(c=-1\), so \(y=\frac1{1-x}\), which blows up at \(x=1\).

First-order linear equations

Rule: integrating factor

For \(y'+P(x)y=Q(x)\), multiply by \(\mu(x)=e^{\int P\,dx}\). Then \((\mu y)'=\mu Q\), so \(y=\dfrac1\mu\displaystyle\int\mu Q\,dx\).

Example 2

Solve \(y'+2y=e^{-x}\), and solve \(y'-y=x\) with \(y(0)=0\).

First: \(\mu=e^{2x}\), so \((e^{2x}y)'=e^{x}\), \(e^{2x}y=e^x+C\) and \(y=e^{-x}+Ce^{-2x}\). Second: \(\mu=e^{-x}\), \((e^{-x}y)'=xe^{-x}\), giving \(y=-x-1+Ce^x\); \(y(0)=0\) gives \(C=1\).

Second-order linear equations

Rule: constant coefficients

For \(ay''+by'+cy=0\), try \(y=e^{mx}\) to get the auxiliary equation \(am^2+bm+c=0\). Real distinct roots: \(y=Ae^{m_1x}+Be^{m_2x}\). Repeated root: \(y=(A+Bx)e^{mx}\). Complex roots \(\alpha\pm i\beta\): \(y=e^{\alpha x}(A\cos\beta x+B\sin\beta x)\).

Example 3

Solve \(y''-5y'+6y=0\), \(y''+4y=0\), \(y''+2y'+y=0\) and \(y''+2y'+5y=0\).

The roots are \(2,3\) so \(y=Ae^{2x}+Be^{3x}\); then \(\pm2i\) so \(y=A\cos2x+B\sin2x\); then \(-1\) twice so \(y=(A+Bx)e^{-x}\); then \(-1\pm2i\) so \(y=e^{-x}(A\cos2x+B\sin2x)\), a decaying oscillation.

Example 4: IVP

Solve \(y''-y=0\) with \(y(0)=1\) and \(y'(0)=0\).

The general solution is \(Ae^x+Be^{-x}\). The conditions give \(A+B=1\) and \(A-B=0\), so \(A=B=\frac12\) and \(y=\cosh x\).

Non-homogeneous equations

Rule: complementary function and particular integral

For \(ay''+by'+cy=f(x)\) the general solution is \(y=y_c+y_p\): the complementary function \(y_c\) (the solution of the homogeneous equation) plus a particular integral \(y_p\).

Method: choosing the particular integral

  1. Choose \(y_p\) in the same form as \(f\): a constant for a constant, \(ke^{px}\) for \(e^{px}\), a polynomial of the same degree for a polynomial, \(k_1\cos+k_2\sin\) for trigonometric terms.
  2. If the guess already solves the homogeneous equation, multiply it by \(x\).
  3. Substitute and compare coefficients.
  4. Add \(y_c\), then apply conditions.

Example 5

Solve \(y''-3y'+2y=4\), and find a particular integral for \(y''+y'-2y=e^{3x}\).

First: try \(y_p=2\), and \(y_c=Ae^x+Be^{2x}\), so \(y=Ae^x+Be^{2x}+2\). Second: try \(ke^{3x}\): \((9+3-2)k=1\), so \(k=\frac1{10}\).

Modelling

Key fact: standard models

  • Exponential growth \(\frac{dP}{dt}=rP\) gives \(P=P_0e^{rt}\); with \(r=0.03\) the doubling time is \(\frac{\ln2}{0.03}\approx23.1\).
  • Newton's law of cooling \(\frac{dT}{dt}=-k(T-T_s)\).
  • Logistic growth \(y'=y(1-y)\), \(y(0)=\frac12\) gives \(y=\frac1{1+e^{-x}}\).
  • Simple harmonic motion \(x''+\omega^2x=0\) has period \(\frac{2\pi}\omega\).
  • Mixing \(\frac{dQ}{dt}=4-\frac Q{25}\), \(Q(0)=0\) gives \(Q=100(1-e^{-t/25})\).

Example 6

A drink at \(90^\circ\)C cools in a \(20^\circ\)C room and reaches \(50^\circ\)C after 10 minutes. Find \(k\).

\(T=20+70e^{-kt}\). At \(t=10\): \(\frac{30}{70}=e^{-10k}\), so \(k=\frac{\ln(7/3)}{10}\approx0.0847\).

Watch out

  • Losing the constant of integration before applying initial conditions.
  • Forgetting to divide by \(\mu\), or mishandling the sign in \(e^{\int P}\).
  • Treating a repeated root as two simple ones.

Starting from the structure of an equation

Method: choosing a strategy

  1. Write the equation in the form \(y'=\dots\) and decide whether the right-hand side factorises as \(f(x)g(y)\). If it does, separate the variables.
  2. If it has the form \(y'+P(x)y=Q(x)\), use an integrating factor.
  3. If it has constant coefficients and a second derivative, write the auxiliary equation and classify its roots.
  4. If a right-hand side is present, add a particular integral to the complementary function.
  5. Only at the end apply the initial conditions, and check by substitution.

Worked example 7: A decay problem with a half-life

A radioactive sample satisfies \(\dfrac{dN}{dt}=-\lambda N\) and halves in 8 days. Find \(\lambda\) and the fraction left after 20 days.

Solving gives \(N=N_0e^{-\lambda t}\). The half-life condition \(\tfrac12=e^{-8\lambda}\) gives \(\lambda=\dfrac{\ln2}8\approx0.0866\) per day. After 20 days the fraction left is \(e^{-20\lambda}=2^{-2.5}\approx0.177\), so about 17.7 per cent of the sample remains. Notice that no value of \(N_0\) was needed: the fraction depends only on the rate.

Worked example 8: A separable equation that cannot be solved for y

Solve \(\dfrac{dy}{dx}=\dfrac{x}{y^2}\) with \(y(0)=1\).

Separate to get \(\int y^2dy=\int x\,dx\), so \(\dfrac{y^3}3=\dfrac{x^2}2+c\). The condition gives \(c=\tfrac13\). Multiplying by 3, \(y^3=\tfrac32x^2+1\), and taking a cube root gives \(y=\left(1+\tfrac32x^2\right)^{1/3}\). In other cases an implicit relation between \(x\) and \(y\) is the best you can do, and that is a perfectly acceptable answer.

Worked example 9: An integrating factor with a trigonometric term

Solve \(y'+y\cot x=\cos x\) for \(0\lt x\lt \pi\).

Here \(P=\cot x\), so \(\mu=e^{\int\cot x\,dx}=e^{\ln\sin x}=\sin x\). Then \((y\sin x)'=\sin x\cos x\), and integrating gives \(y\sin x=\tfrac12\sin^2x+C\). So \(y=\tfrac12\sin x+C\csc x\). The integrating factor turned a hard-looking equation into a product-rule problem, which is exactly what it is designed to do.

Worked example 10: Repeated roots

Find the general solution of \(y''-6y'+9y=0\) and the solution with \(y(0)=1\), \(y'(0)=0\).

The auxiliary equation is \((m-3)^2=0\), so \(y=(A+Bx)e^{3x}\). The first condition gives \(A=1\). Differentiating, \(y'=(B+3A+3Bx)e^{3x}\), so \(y'(0)=B+3=0\) and \(B=-3\). The solution is \(y=(1-3x)e^{3x}\). It crosses zero at \(x=\tfrac13\) and then becomes large and negative.

Worked example 11: A particular integral for a polynomial right-hand side

Find a particular integral for \(y''+3y'+2y=4x+2\).

The right-hand side is a polynomial of degree 1, so try \(y_p=ax+b\). Then \(y_p'=a\) and \(y_p''=0\), so the left side is \(3a+2ax+2b\). Comparing the coefficients of \(x\) gives \(2a=4\), so \(a=2\). Comparing constants gives \(3a+2b=2\), so \(b=-2\). A particular integral is \(y_p=2x-2\). Neither \(1\) nor \(x\) appears in the complementary function \(Ae^{-x}+Be^{-2x}\), so no extra factor of \(x\) was needed.

Worked example 12: The logistic equation

A population satisfies \(y'=y(1-y)\) with \(y(0)=\tfrac12\). Solve it.

Partial fractions give \(\dfrac1{y(1-y)}=\dfrac1y+\dfrac1{1-y}\), so \(\ln\left|\dfrac y{1-y}\right|=x+c\). With \(y(0)=\tfrac12\) the left side is \(\ln1=0\), so \(c=0\) and \(\dfrac y{1-y}=e^x\). Solving for \(y\) gives \(y=\dfrac{e^x}{1+e^x}=\dfrac1{1+e^{-x}}\). The graph is an S-shaped curve that rises from near 0 to near 1.

The logistic curve y = 1/(1+e^-x) levels off at 1-6-4-22460.51

Reading the model behind an equation

Key fact: what the terms of a model mean

  • In \(\dfrac{dP}{dt}=rP\) the rate of change is proportional to the amount: growth if \(r>0\) and decay if \(r<0\).
  • In \(\dfrac{dT}{dt}=-k(T-T_s)\) the temperature moves towards the surrounding value \(T_s\), and the rate is proportional to the gap.
  • In \(\dfrac{dQ}{dt}=\text{rate in}-\text{rate out}\) a mixing or drug problem is a balance sheet, and its steady state is found by setting the derivative to zero.
  • In \(x''+\omega^2x=0\) the restoring force is proportional to displacement, which is why the motion is a sine wave.

Worked example 13: A mixing problem with no inflow of salt

A tank holds 100 litres of brine with 30 kg of salt. Pure water flows in at 4 litres per minute and the mixture leaves at the same rate. Find the salt left after 25 minutes.

Salt only leaves, at rate \(4\times\dfrac Q{100}=\dfrac Q{25}\) kg per minute, so \(\dfrac{dQ}{dt}=-\dfrac Q{25}\). This is exponential decay, with solution \(Q=30e^{-t/25}\). After 25 minutes \(Q=30e^{-1}\approx11.0\) kg, so about 37 per cent of the salt remains. After a further 25 minutes it would be multiplied by \(e^{-1}\) again: constant proportional decay is the signature of this equation.

Worked example 14: Finding the steady state first

For \(\dfrac{dy}{dt}=6-2y\) with \(y(0)=10\), find the steady state and then the full solution.

The steady state is where the derivative is zero: \(6-2y=0\), so \(y=3\). Writing \(z=y-3\) turns the equation into \(z'=-2z\), so \(z=z_0e^{-2t}\) with \(z_0=10-3=7\). Therefore \(y=3+7e^{-2t}\). The solution approaches 3 from above, and the gap \(y-3\) halves roughly every \(\ln2/2\approx0.35\) time units.

Worked example 15: Underdamped oscillations

Describe the long-term behaviour of \(y''+2y'+26y=0\).

The auxiliary equation has roots \(-1\pm5i\), so \(y=e^{-t}(A\cos5t+B\sin5t)\). The oscillation has angular frequency 5, so its period is \(\dfrac{2\pi}5\approx1.26\), and the factor \(e^{-t}\) makes the amplitude shrink to about 37 per cent each time unit. The solution therefore tends to zero while changing sign again and again: a decaying oscillation, like a plucked guitar string.

Note: general and particular solutions

A general solution has as many arbitrary constants as the order of the equation, and describes a whole family of curves. A particular solution is one member of that family, chosen by initial or boundary conditions. For a first-order equation one condition is needed; for a second-order equation two are needed, usually the value of the function and of its derivative at the same point. Always find the general solution first, and apply the conditions at the end.

Watch out: dividing by zero

When you separate variables you divide by \(g(y)\). If \(g(y_0)=0\) then the constant function \(y=y_0\) is also a solution, and you might lose it. For example, \(y'=y(1-y)\) has the solutions \(y=0\) and \(y=1\) as well as the S-shaped curves. Also remember to keep the constant of integration on one side only, and to apply the initial condition before you rearrange anything involving \(\pm e^c\).

Did you know?

Differential equations became central to science when Isaac Newton and Gottfried Leibniz developed calculus in the late seventeenth century. Newton used them to explain the motion of the planets. Today, a weather forecast is produced by solving enormous systems of differential equations on a supercomputer, and the logistic equation, first proposed by Pierre Verhulst in 1838, is still used to model populations and the spread of diseases.

Otto's tip

Always check by substituting your solution back into the equation and the initial conditions.

How to use this University differential equations revision notes

First, read the key points so that you know where the University differential equations revision notes is going. Then work through each definition and worked example, and cover the solution before you read it. After that, practise with the differential equations worksheet and check every question with the worksheet answers. When you feel ready, test yourself with the multiple choice questions or the quick quiz. Finally, sit the differential equations test and mark it with the test answers.

Also, the starters are a good warm-up, so you can keep the key facts fresh. Moreover, all the pages of this chapter work together, so you can move between them at any time. For example, many pupils read the lesson on Monday, practise on Wednesday and test themselves on Friday. In short, this University differential equations revision notes gives you everything you need for the chapter.