# Differential Equations and Slope Fields

> Equations that involve a derivative. Read slope fields, solve by integrating and by separating variables, and model growth with limits.

From HSC Maths Extension 1 on WhizzNotes, free study notes for NSW students: https://whizznotes.com/mathematics-extension-1/differential-equations/. Updated 3 November 2026.
Year 11 and Year 12 boxes go deeper than the Year 10 text around them.

### Story time: The weather forecaster
A forecaster does not know tomorrow's temperature. What she does know are rules for how temperature, wind and pressure **change** from one moment to the next. Starting from today's readings, she follows those rules forward and builds tomorrow's forecast.

A rule about how something changes is a **differential equation**. It is the most common way scientists write down how the world works: populations, cooling, drug levels, the spread of a rumour. Solving one means finding the quantity itself from the rule about its rate.

**In short:** A differential equation links a function to its derivative, and its solution is a function. A slope field shows the gradient at many points so you can sketch solution curves, and a separable equation is solved by putting the $y$ terms on one side, the $x$ terms on the other, and integrating.

## Starting point: what you already know

- **A derivative** $\dfrac{dy}{dx}$ is the gradient of the curve at each point.
- **Integration undoes differentiation:** $\displaystyle\int x^n\,dx = \frac{x^{n+1}}{n+1} + C$, $\displaystyle\int \frac{1}{y}\,dy = \ln|y| + C$, $\displaystyle\int \frac{dy}{1 + y^2} = \tan^{-1} y + C$.
- **Exponentials and logs:** if $\ln|y| = k$ then $y = \pm e^{k}$.
- **Growth towards a level** (previous chapter): $\dfrac{dN}{dt} = k(N - P)$ gives $N = P + Ae^{kt}$.

## What a differential equation is

A **differential equation** is an equation with a derivative in it, such as $\dfrac{dy}{dx} = 2x$ or $\dfrac{dy}{dx} = xy$. Its **solution** is a function $y$ that makes the equation true.

- The **general solution** has a constant $C$. It is a whole family of curves.
- A **particular solution** uses a starting point, such as $y = 3$ when $x = 1$, to fix $C$.

### Worked example: Just integrate
$\dfrac{dy}{dx} = 2x$ with $y = 3$ when $x = 1$.

General: $y = x^2 + C$. Particular: $3 = 1 + C$, so $C = 2$ and $y = x^2 + 2$.

Check: $\dfrac{d}{dx}(x^2 + 2) = 2x$. Correct.

## Slope fields

A **slope field** draws a short line at many points, each with the gradient the equation gives there. Solution curves follow the little lines, like leaves floating along a stream.

*Diagram: Slope field for dy by dx equals x minus y, drawn on a 7 by 7 grid of points from minus 3 to 3. A solution curve through the origin follows the short lines, dipping slightly and then rising parallel to y equals x minus 1.*
*Slope field for dy/dx = x − y. The thick curve is the solution that passes through the origin.*

### Exam tip: Reading a slope field
Along the line $y = x$ the gradient is $x - y = 0$, so the little lines are flat there. Above that line the gradients are negative. Below it they are positive. Spotting where the slope is zero is often the quickest way to match an equation to its field.

## Separating the variables

When the right side is a function of $x$ times a function of $y$, move all the $y$ parts to one side and all the $x$ parts to the other, then integrate both sides.

### Key idea: Separable equations
$$\frac{dy}{dx} = f(x)\,g(y) \quad\Rightarrow\quad \int \frac{1}{g(y)}\,dy = \int f(x)\,dx$$
Add one constant, on the $x$ side.

### Worked example: dy/dx = xy, with y = 2 when x = 0
Separate: $\displaystyle\int \frac{1}{y}\,dy = \int x\,dx$.

Integrate: $\ln|y| = \dfrac{x^2}{2} + c$.

Remove the log: $y = Ae^{x^2/2}$, where $A$ is a constant.

Use the start: $2 = Ae^0$, so $A = 2$ and $y = 2e^{x^2/2}$.

### Watch out: One constant is enough
Constants on both sides can always be combined into one. Putting $+ C$ on each side and then forgetting one of them leads to errors.

**Mind map**

```text
Differential equations
  Meaning
    An equation with a derivative
    Solution is a function
  Solutions
    General: has C
    Particular: uses a start point
  Slope fields
    Short lines with gradient
    Curves follow the lines
    Look for zero slope
  Methods
    dy/dx = f(x): integrate
    dy/dx = g(y): flip and integrate
    f(x)g(y): separate
  Models
    Cooling
    Logistic growth
```

### Year 11: When the rate depends only on y
$\dfrac{dy}{dx} = 1 + y^2$, with $y = 0$ when $x = 0$.

Separate: $\displaystyle\int \frac{dy}{1 + y^2} = \int dx$, so $\tan^{-1} y = x + C$.

At the start $\tan^{-1} 0 = 0$, so $C = 0$ and $y = \tan x$, for $-\dfrac{\pi}{2} < x < \dfrac{\pi}{2}$.

**Equilibrium (constant) solutions** make the rate zero for every $x$. For $\dfrac{dy}{dx} = y(4 - y)$ they are $y = 0$ and $y = 4$. For $\dfrac{dy}{dx} = (2 - y)\sin x$ the constant solution is $y = 2$, because $\sin x$ is not always zero.

**Separating exponentials and trig.** $\dfrac{dy}{dx} = e^{x + y} = e^x e^y$ separates as $e^{-y}\,dy = e^x\,dx$, so $-e^{-y} = e^x + C$. And $(1 + x^2)\dfrac{dy}{dx} = \sec y$ gives $\cos y\,dy = \dfrac{dx}{1 + x^2}$, so $\sin y = \tan^{-1}x + C$.

**Solutions can blow up.** $\dfrac{dy}{dx} = y^2$ with $y(0) = 1$: $-\dfrac{1}{y} = x - 1$, so $y = \dfrac{1}{1 - x}$, which grows without limit as $x \to 1$. The solution only exists for $x < 1$.

**Checking a solution.** Substitute it in. For $y = 2\cos 3x$: $y'' = -18\cos 3x = -9y$, so it satisfies $y'' + 9y = 0$.

### Year 12: Logistic growth
Fish in a lake cannot grow forever. Food runs short as the numbers rise. A good model is
$$\frac{dP}{dt} = kP\left(1 - \frac{P}{K}\right)$$
where $K$ is the **carrying capacity**, the most fish the lake can support.

- When $P$ is small, the bracket is close to 1, so growth looks exponential.
- When $P$ is close to $K$, the bracket is close to 0, so growth almost stops.
- The rate is greatest when $P = \dfrac{K}{2}$, which is where the graph changes from curving up to curving down.

Separating variables with partial fractions gives $P = \dfrac{K}{1 + Ae^{-kt}}$, an S-shaped curve that levels off at $K$. Exam questions usually give this and ask you to check it, or to use it.

**Solving for the time.** For $P = \dfrac{500}{1 + 4e^{-0.2t}}$ to reach 400: $1 + 4e^{-0.2t} = 1.25$, so $e^{-0.2t} = 0.0625$ and $t = \dfrac{\ln 16}{0.2} \approx 13.9$.

**Harvesting.** If a fraction $h$ of the population is removed each year, $\dfrac{dP}{dt} = kP\left(1 - \dfrac{P}{K}\right) - hP$. The non-zero equilibrium solves $k\left(1 - \dfrac{P}{K}\right) = h$. With $k = 0.5$, $K = 1000$ and $h = 0.1$: $1 - \frac{P}{1000} = 0.2$, so $P = 800$.

## Quick summary

- A differential equation links a function and its derivative. Its solution is a function.
- General solutions have a constant. A starting point gives the particular solution.
- A slope field shows the gradient at many points. Solution curves follow it.
- Separable: $\displaystyle\int \frac{1}{g(y)}\,dy = \int f(x)\,dx$.
- Logistic growth levels off at the carrying capacity $K$ and grows fastest at $\dfrac{K}{2}$.

## Quiz

Try these questions from the chapter quiz.

1. Which of these is a differential equation?
   - A. $y = x^2 + 1$
   - B. $\dfrac{dy}{dx} = 3y$
   - C. $x^2 + y^2 = 4$
   - D. $y = e^x$
   - Answer: B. $\dfrac{dy}{dx} = 3y$. It contains a derivative.

2. The general solution of $\dfrac{dy}{dx} = 6x^2$ is:
   - A. $y = 12x$
   - B. $y = 2x^3 + C$
   - C. $y = 6x^3 + C$
   - D. $y = 2x^3$
   - Answer: B. $y = 2x^3 + C$. Integrate and add a constant.

3. Solve $\dfrac{dy}{dx} = 2x$ given $y = 5$ when $x = 2$.
   - A. $y = x^2 + 5$
   - B. $y = x^2 + 1$
   - C. $y = x^2 + 3$
   - D. $y = 2x + 1$
   - Answer: B. $y = x^2 + 1$. $5 = 4 + C$, so $C = 1$.

The whole chapter quiz is on the page, for signed-in students: https://whizznotes.com/mathematics-extension-1/differential-equations/#quiz
