The linear first-order equation y' + P(x)y = Q(x) is the one family in this chapter that can always be solved, with no cleverness required. Multiplying by the integrating factor turns the left-hand side into the derivative of a single product, after which one integration finishes the problem.
Quick Reference
| Item | Statement |
|---|---|
| General linear form | |
| Standard form | , with and |
| Integrating factor | |
| Key identity | I(x)\left[y' + P(x)y\right] = \dfrac{d}{dx}\left[I(x)y(x)\right] |
| After multiplying | |
| Integrated form | |
| General solution | |
| Homogeneous solution |
The Standard Form
A linear differential equation of first-order is one of the form
a(x)\frac{dy}{dx} + b(x)y(x) = f(x) \tag{9}
where , , and are functions defined on an interval . If on , we can divide both sides of (9) to obtain the standard form
\frac{dy}{dx} + P(x)\,y(x) = Q(x) , \tag{10}
where and .
This equation is first-order because the first derivative of is the highest derivative occurring, and it is linear because and its derivative both have exponent one and are not multiplied together. The coefficient and the forcing term may be arbitrary functions of ; nothing about them affects linearity.
The requirement is not a technicality. Points where vanishes are called singular points, and the division that produces standard form fails there. In x y' + y = x^2, dividing by gives , which blows up at the origin, and solutions can behave badly there. Always note the interval on which the standard form is valid.
Method 1: The Integrating Factor
To solve this equation, we look for an integrating function such that
I(x)\left[\frac{dy(x)}{dx} + P(x)\,y(x)\right] = \frac{d}{dx}\left[I(x)\,y(x)\right] \tag{11}
recalling the product rule \left(uv\right)' = u'v + uv'.
The idea is worth pausing on. The left side of the standard form is a sum of two unrelated-looking terms. Equation (11) asks for a multiplier that fuses them into a single derivative, so that the equation can be integrated in one step.
If a suitable function can be found, the differential equation can be written as
and integrating both sides yields
I(x)\,y(x) = \int I(x)\,Q(x)\,dx + c \tag{12}
where is an arbitrary constant.
To find a suitable , expand both sides of Equation (11):
The term cancels from both sides, and dividing what remains by leaves a condition on alone:
This is a separable equation for . Writing it as
and integrating, we obtain
where is a constant. Because one integrating factor suffices, we may set , or any other value we like. Thus
I(x) = \exp\left(\int P(x)\,dx + k\right) = \underbrace{\exp(k)}_{=\,1 \text{ if } k\,=\,0}\ \exp\left(\int P(x)\,dx\right) \tag{13}
Because , combining Equations (12) and (13) gives the general solution of Equation (10):
In words: multiply the forcing term by the integrating factor, integrate, add an arbitrary constant, then divide the whole thing by the integrating factor.
Practical advice. Do not memorize the boxed formula. Memorize the procedure: put the equation in standard form, compute , multiply through, recognize the left side as \left(Iy\right)', integrate, divide by . Executing the steps is faster and far less error-prone than substituting into the formula.
Method 2: Solve the Homogeneous Equation First, Then Vary the Constant
There is a second route that generalizes to higher order equations, where it is known as variation of parameters.
First find the solution of the homogeneous equation, that is, the case , and call it :
Integrating both sides,
where is a constant. Taking exponentials of both sides,
where if and if .
The second step is the clever one: replace the constant by an unknown function , substitute into the full equation, and solve the resulting equation for . The terms involving itself always cancel, precisely because solves the homogeneous equation, leaving a simple equation for c'(x).
Worked Examples
Find the general solution of the equation
Solution
We use Method 2. First find the solution of the homogeneous equation:
Integrating both sides, and writing the constant as for convenience,
Now vary the constant. Let . Then by the product rule,
\frac{dy}{dx} = y'(x) = c'(x)\sin x + c(x)\cos x .Substitute into the original equation:
c'(x)\sin x + c(x)\cos x - \frac{\cos x}{\sin x}\,c(x)\sin x = x \sin xThe second and third terms on the left cancel exactly, since . This cancellation is guaranteed, because solves the homogeneous equation. What remains is
c'(x)\sin x = x\sin x \quad \Longrightarrow \quad c'(x) = x \quad \Longrightarrow \quad c(x) = \frac{1}{2}x^2 + k .Thus
Note the structure of the answer: a particular solution plus an arbitrary multiple of the homogeneous solution . Every linear equation's general solution has this shape.
Solve using the integrating factor.
Solution
The equation is already in standard form with and . The integrating factor is
Multiplying through by ,
The left side is exactly , which is the whole point of the factor. So
Dividing by ,
Again a particular solution plus a multiple of the homogeneous solution .
Solve the initial value problem , , and state the interval of validity.
Solution
First put the equation in standard form by dividing by , which requires :
The integrating factor is
Multiplying through,
Integrating,
Applying gives , so and
The initial point is , and the solution is undefined at , so the interval of validity is . Note that the original equation xy' + 2y = 4x^2 looks perfectly well behaved at the origin; the trouble appears only after dividing by , and it is real.
Solve , and identify the homogeneous and particular parts.
Solution
Here and , so . Multiplying,
Integrate the right side by parts, with and , so and :
Therefore
The homogeneous part is and the particular part is . You can check the latter directly: (-x-1)' - (-x-1) = -1 + x + 1 = x.
Exercises
Solve y' + 2xy = x.
Solution
Here , so . Multiplying,
Integrating with the substitution ,
Note that is an equilibrium solution, obtained by taking .
Solve the initial value problem y' + y\tan x = \sin 2x, .
Solution
The integrating factor is
Multiplying and using ,
Integrating, , so
Applying gives , so and
The interval of validity is , since blows up at the endpoints.
A tank holds liters of pure water. Brine containing grams of salt per liter flows in at liters per minute, and the well-stirred mixture flows out at the same rate. Find the amount of salt at time .
Solution
Salt enters at grams per minute. The concentration in the tank is grams per liter, so salt leaves at grams per minute. Therefore
a linear equation with . Multiplying,
So . Since the tank starts with pure water, gives , and
As , grams, which is the tank at the inflow concentration of grams per liter, exactly as expected.
Frequently Asked Questions
What makes a first-order equation linear?
It can be written as y' + P(x)y = Q(x): the unknown and its derivative each appear to the first power, are not multiplied by each other, and are not inside any nonlinear function. The coefficients and may be any functions of whatsoever. Terms like , yy', , or destroy linearity.
Why does multiplying by work?
Because that factor is designed so that I' = IP. With that property the product rule gives
\left(Iy\right)' = Iy' + I'y = Iy' + IPy = I\left(y' + Py\right) ,which is exactly times the left side of the standard form. So multiplying collapses two terms into one derivative, and the equation becomes directly integrable.
Do I need the constant of integration inside the integrating factor?
No. Including would multiply by the constant , which then divides out at the end. Since any one integrating factor suffices, always take and keep the expression clean.
Should I use absolute values when produces a logarithm?
You can drop them in practice. If , then , so the absolute value disappears on its own for even powers. For odd powers, the sign difference amounts to multiplying by , which is another valid integrating factor. Just be sure to work on an interval that avoids the singular point.
Which method should I use, the integrating factor or varying the constant?
The integrating factor is faster and more mechanical for first-order problems, so use it by default. Method 2 is worth understanding anyway, because it is the first appearance of variation of parameters, which is the standard tool for higher order linear equations and for systems where no integrating factor exists.
Why does the general solution always split into two pieces?
Because the equation is linear. If is any particular solution and solves the homogeneous equation, then solves the full equation for every , and every solution has that form. So the answer is always "one particular solution plus the general homogeneous solution". This structural fact carries through the entire rest of the book.
What if the equation is linear in rather than in ?
Then swap the roles of the variables. The equation is nonlinear in , but inverting gives , that is, , which is linear in with integrating factor . Always check this when an equation looks hopeless in its given orientation.