Linear First-Order Equations
Integrating factors and the systematic approach
Beyond Separation
In previous chapters, we solved differential equations by separating variables: moving all the y terms to one side, all the x terms to the other, then integrating. This works beautifully when it works. But many equations resist separation.
Consider the equation . Try as you might, the y and x terms cannot be untangled. The right side mixes the variables in a way that prevents separation. We need a different approach.
The remarkable news is that there exists a method that solves every linear first-order equation. Not sometimes. Always. This method is algorithmic and systematic. Once you learn it, you can solve any equation of this type.
Interactive: Why Separation Fails
This is a linear first-order equation. The slope field shows the direction of solutions at each point.
Notice how the slopes depend on both x and y. Can we solve this by separation of variables?
The key insight is this: if we cannot separate the equation, perhaps we can transform it into something we can integrate directly. We multiply both sides by a carefully chosen function that makes the left side become a perfect derivative. This function is called an integrating factor.
The Standard Form
Before applying the method, we must recognize what kind of equation we are dealing with. A linear first-order equation is one where and appear only to the first power and are not multiplied together.
Every such equation can be written in standard form:
Here and are functions of only. The coefficient of must be 1. If it is not, divide through to make it so.
Some examples:
- has and
- has and
- must first be divided by to get
The first step in applying our method is always to rewrite the equation in standard form. This makes and explicit, which is essential for the next step.
The Integrating Factor
Here is where the magic happens. We seek a function such that when we multiply both sides of the equation by it, the left side becomes a perfect derivative.
Why would this help? Think about what we want. After multiplying by , we get:
Now recall the product rule: . If we could arrange for the left side to equal , we could integrate directly.
Interactive: Deriving the Integrating Factor
Start with standard form
Every linear first-order equation can be written this way.
Comparing with , we see they match if . This is itself a separable equation for ! Separating and integrating:
We can drop the absolute value and choose because any nonzero multiple of works equally well (the constant factor cancels when we divide at the end).
This is the integrating factor. With it, the left side becomes exactly , and we can integrate:
Then we solve for by dividing through by .
The Method: A Five-Step Algorithm
Here is the complete procedure for solving any linear first-order equation :
Step 1: Standard form. Write the equation with the coefficient of equal to 1. Identify and .
Step 2: Compute the integrating factor. Calculate:
Step 3: Multiply. Multiply both sides by . Recognize that the left side becomes .
Step 4: Integrate. Integrate both sides:
Step 5: Solve for y. Divide by :
Interactive: Practice the Method
The Equation
Standard form with P(x) = 2 and Q(x) = 1
Adjust coefficients to see how the solution changes. Click the dots to step through the method.
A practical note: when computing , you do not need to include a constant of integration. Any antiderivative works because adding a constant to the exponent would multiply by , which cancels when you divide at the end.
A Complete Example
Let us work through a full example with a non-constant coefficient. This will solidify the method.
Interactive: Worked Example
The Problem
Solve the initial value problem:
The example above solves with initial condition . Notice how the integrating factor arises naturally from integrating :
After multiplying by , the left side becomes , which is exactly what the product rule gives us: . This recognition is the heart of the method.
Visualizing Solutions
The solutions to linear first-order equations have a characteristic structure. The general solution contains two parts: a particular solution that satisfies the non-homogeneous equation, plus the general solution to the homogeneous equation (where Q = 0).
For :
- The homogeneous solution decays or grows exponentially
- The particular solution depends on Q and may oscillate, grow, or approach a constant
Interactive: Solution Explorer
P > 0: Solutions are attracted toward a particular solution (stable).
The blue curve is the solution through (0, 0.0). Gray curves show other solutions.
Adjust the parameters above to see how solutions behave. When , the homogeneous part decays exponentially, and solutions approach the particular solution. When , solutions diverge from it. The forcing function Q(x) determines what the solutions are attracted to or repelled from.
Why This Method Always Works
Unlike separation of variables, which only applies to certain special forms, the integrating factor method works for every linear first-order equation. This is a powerful guarantee.
The reason is structural. The operation of multiplying by and recognizing a product derivative is always valid when . And since always satisfies this equation, the method never fails.
The integrals and might be difficult to compute in closed form. But that is a separate issue from whether the method applies. The method itself is universal.
Another Example: The Mixing Tank
Consider a practical application. A tank contains 100 liters of water with 10 kg of dissolved salt. Brine containing 0.5 kg of salt per liter flows in at 4 liters per minute, and the well-mixed solution flows out at the same rate. How much salt is in the tank at time ?
Let be the amount of salt (in kg) at time minutes. Salt enters at rate kg/min. Salt leaves at rate kg/min (concentration times flow rate).
The differential equation is:
Rewriting in standard form: .
Here and . The integrating factor is:
Multiplying through and recognizing the product:
Integrating: .
So . With , we get .
The solution is . As , the salt amount approaches 50 kg, the equilibrium level.
Handling Initial Value Problems
When given an initial condition , we use it to determine the constant in our general solution.
The process is straightforward: after finding the general solution , substitute and , then solve for .
For instance, in the mixing tank example with , we substituted into to get , giving .
There is also an elegant definite integral form:
This formula automatically incorporates the initial condition. The first term accounts for the initial value, while the integral accumulates the effect of the forcing function from the initial point onward.
Common Pitfalls
A few errors to avoid:
Forgetting standard form. If the coefficient of is not 1, divide through first. The equation must become before identifying . Otherwise, your integrating factor will be wrong.
Including a constant in the integrating factor. When computing , any antiderivative works. Adding a constant just multiplies by a constant factor, which cancels when you divide at the end. Keep it simple: use the simplest antiderivative.
Forgetting to divide by . After integrating to get , you must divide by to solve for . This step is easy to overlook.
Sign errors in . Watch the sign when rewriting in standard form. In , we have , not .
Looking Ahead
Linear first-order equations are just the beginning. In the next chapter, we explore exact equations, where the differential equation is secretly the total derivative of some function . The integrating factor method sometimes transforms non-exact equations into exact ones.
Later, we will see that second-order linear equations have a similar structure, but with more elaborate solutions involving characteristic equations and complementary functions. The integrating factor idea reappears in different guises throughout differential equations.
Key Takeaways
- A linear first-order equation has the form , where and appear linearly
- The integrating factor is derived by requiring that the left side become a perfect derivative
- After multiplying by , we recognize and integrate directly
- This method always works for any linear first-order equation, unlike separation of variables
- The general solution is
- For initial value problems, substitute the initial condition to determine
- Always put the equation in standard form first, with the coefficient of equal to 1