Calculus › Section G · Differential equations › Topic G.5

First-order linear equations

Separation solves equations that factor neatly; many useful ones do not. First-order linear equations, the kind behind mixing tanks and circuits, always yield to one trick: multiply by the right factor and the left side collapses into a single derivative.

The form this method needs

Separation needs the equation to factor into an \(x\)-piece times a \(y\)-piece. The equation \(y' + y = x\) never will: the sum blocks it. But notice its shape: \(y'\) and \(y\) appear to the first power, added to a function of \(x\). Such equations are called linear, and every first-order linear equation can be arranged in the standard form

y' + P(x)y = Q(x)

Examples: \(y' + 3y = e^{2x}\) is already standard; \(xy' - y = x^3\) becomes standard after dividing by \(x\), with \(P(x) = -\frac{1}{x}\). But \(y' = xy^2\) is not linear, because of the \(y^2\), and neither is \(y' + y^2 = x\).

The integrating factor

The plan is to multiply the whole equation by a cleverly chosen function \(\mu(x)\), chosen so that the left side becomes a single derivative we can integrate at once. The choice is

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

It works because \(\mu' = P\mu\): differentiating \(e^{\int P\,dx}\) brings down a factor \(P\). Multiply the standard form by \(\mu\):

\mu y' + P\mu y = \mu Q

By the product rule the left side is exactly \((\mu y)'\). So the equation reads \((\mu y)' = \mu Q\), and you integrate both sides: \(\mu y = \int \mu Q\,dx + C\). You do not need a \(+C\) inside \(\mu\) itself; any one integrating factor does the job, and constant multiples cancel out.

Worked example: y′ + 3y = e²ˣ

Solve \(y' + 3y = e^{2x}\) with \(y(0) = 1\). The equation is in standard form with \(P = 3\), so \(\mu = e^{\int 3\,dx} = e^{3x}\). Multiplying through: \((e^{3x}y)' = e^{3x} \cdot e^{2x} = e^{5x}\). Integrate: \(e^{3x}y = \frac{e^{5x}}{5} + C\). Divide by \(e^{3x}\): \(y = \frac{e^{2x}}{5} + Ce^{-3x}\). Now the initial condition: \(y(0) = \frac{1}{5} + C = 1\), so \(C = \frac{4}{5}\), giving \(y = \frac{e^{2x}}{5} + \frac{4}{5}e^{-3x}\). Check: \(y' + 3y = \frac{2e^{2x}}{5} - \frac{12e^{-3x}}{5} + \frac{3e^{2x}}{5} + \frac{12e^{-3x}}{5} = e^{2x}\).

Worked example: variable coefficients

Solve \(xy' + 2y = x^3\) with \(y(1) = 2\), for \(x > 0\). First put it in standard form by dividing by \(x\): \(y' + \frac{2}{x}y = x^2\), so \(P(x) = \frac{2}{x}\). Then \(\mu = e^{\int (2/x)\,dx} = e^{2\ln x} = x^2\). Multiplying through gives \((x^2y)' = x^4\), so \(x^2y = \frac{x^5}{5} + C\) and \(y = \frac{x^3}{5} + \frac{C}{x^2}\). The condition \(y(1) = 2\) gives \(C = \frac{9}{5}\), so \(y = \frac{x^3}{5} + \frac{9}{5x^2}\). The step that decides everything is dividing by the coefficient of \(y'\) before reading off \(P\).

Particular plus homogeneous

Look back at \(y = \frac{e^{2x}}{5} + Ce^{-3x}\). It splits into two independent pieces. The piece \(\frac{e^{2x}}{5}\) is a particular solution: it solves the full equation \(y' + 3y = e^{2x}\). The piece \(Ce^{-3x}\) solves the stripped-down equation \(y' + 3y = 0\), the homogeneous equation, and it carries the constant. Every linear equation behaves this way: general solution = (any one particular solution) + (constant times the homogeneous solution). The homogeneous part always has the form \(Ce^{-\int P\,dx}\), which you can confirm by separating \(y' = -Py\). This structure returns in higher courses, so it is worth recognising now.

Worked example: a filling tank

A 300-litre tank starts with pure water. Brine carrying 0.4 kg of salt per litre flows in at 6 litres per minute, the well-mixed solution flows out at 6 litres per minute, and the volume stays 300 litres. Salt enters at \(0.4 \times 6 = 2.4\) kg per minute and leaves at concentration times flow, \(\frac{S}{300} \times 6 = 0.02S\). So

S' = 2.4 - 0.02S, \qquad S' + 0.02S = 2.4

Here \(\mu = e^{0.02t}\): \((e^{0.02t}S)' = 2.4e^{0.02t}\), so \(e^{0.02t}S = 120e^{0.02t} + C\) and \(S = 120 + Ce^{-0.02t}\). Since \(S(0) = 0\), \(C = -120\), giving \(S = 120(1 - e^{-0.02t})\). The salt climbs toward 120 kg, exactly the inflow concentration times the volume.

An RL circuit

In a circuit with a resistor \(R\), an inductor \(L\) and a constant battery voltage \(V\), the current satisfies \(L\frac{dI}{dt} + RI = V\), assuming \(R\), \(L\) and \(V\) are constant. In standard form: \(I' + \frac{R}{L}I = \frac{V}{L}\), so the integrating factor is \(e^{Rt/L}\). Solving as above gives \(I = \frac{V}{R} + Ce^{-Rt/L}\), and starting from no current, \(I(0) = 0\), gives \(C = -\frac{V}{R}\):

I = \frac{V}{R}\left(1 - e^{-Rt/L}\right)

The current does not jump to its final value; it rises toward the Ohm's law value \(\frac{V}{R}\). After one time constant \(\tau = \frac{L}{R}\) it has covered \(1 - \frac{1}{e} \approx 63\%\) of the gap.

Linear, separable, or both?

The two methods cover different ground, with some overlap. The equation \(y' + 2y = 6\) is both: linear, and separable as \(\frac{dy}{6 - 2y} = dt\). The equation \(y' = xy^2\) is separable but not linear, because of the \(y^2\). The equation \(y' + y = x\) is linear but not separable, because the \(x\) cannot join the \(y\) on one side. When an equation is both, use whichever is quicker; separation is often shorter when \(Q = 0\), and the integrating factor is the only option when a stray \(Q(x)\) blocks the split. Classifying the equation before choosing a tool is the real skill.

Why linear equations are dependable

Linear equations come with a guarantee that nonlinear ones lack. If \(P\) and \(Q\) are continuous on an interval containing \(x_0\), then the initial value problem \(y' + Py = Q\), \(y(x_0) = y_0\) has exactly one solution, and it exists on the whole interval. Inside that interval no two solution curves cross, and none blows up. Trouble can come only where \(P\) or \(Q\) fails to be continuous: \(y = \frac{x^3}{5} + \frac{9}{5x^2}\) from the example above blows up at \(x = 0\), exactly where \(P = \frac{2}{x}\) does. Contrast this with the nonlinear equation \(y' = y^2\) from the separation topic: nothing in it is discontinuous, yet its solution \(\frac{1}{1 - t}\) explodes at \(t = 1\).

Common mistakes to avoid

First, skipping standard form: in \(xy' + 2y = x^3\), \(P\), the coefficient of \(y\) after dividing by \(x\), is \(\frac{2}{x}\), not 2, and using the wrong \(P\) ruins the integrating factor. Second, multiplying only the left side by \(\mu\); the equation stays balanced only if both sides are multiplied. Third, the classic slip at the end: from \(e^{3x}y = \frac{e^{5x}}{5} + C\), the answer is \(y = \frac{e^{2x}}{5} + Ce^{-3x}\), not \(\frac{e^{2x}}{5} + C\), because the constant gets divided by \(\mu\) like everything else.

Key takeaways

A first-order linear equation in standard form is \(y' + P(x)y = Q(x)\). Multiply by the integrating factor \(\mu = e^{\int P\,dx}\), which turns the left side into \((\mu y)'\); integrate both sides, then divide by \(\mu\), keeping the constant inside the division. Solutions are always one particular solution plus \(Ce^{-\int P\,dx}\). Mixing tanks and RL circuits follow the same pattern, and with continuous coefficients the initial value problem has exactly one solution, which cannot blow up inside that interval.

Flashcards

Flashcard

y′ + P(x)y = Q(x)

Standard form of a first-order linear equation

Divide by the y′ coefficient first.

Test your understanding

Question 1 of 5

What is the integrating factor for y′ + 5y = sin x?

Question 2 of 5

Solve y′ + 3y = e^(2x) with y(0) = 1.

Question 3 of 5

A 300-litre tank starts with pure water. Brine with 0.4 kg of salt per litre flows in at 6 litres per minute and the mixed solution flows out at 6 litres per minute. What does the salt content approach in the long run?

Question 4 of 5

An RL circuit with constant battery voltage V starts with no current. After one time constant, L/R, what percentage of the final current has been reached?

Question 5 of 5

Which equation is linear but not separable?

Standards: Beyond AP

← Previous topicNext topic →