8.4 Linear firstorder differential equations
General form
 Definition

A linear firstorder ordinary differential equation is a firstorder ordinary differential equation that may be written in the form
x'(t) + a(t)x(t) = b(t)for functions a and b of a single variable.
Coefficient of x(t) constant
Consider first the case in which a(t) is a constant independent of t. Then, using a to denote the value of the constant (rather than the function), we havex'(t) + ax(t) = b(t) for all t.
If the lefthand side were the derivative of some function and we could find an antiderivative of b then we could solve the equation by integrating each side. Now, the lefthand side looks something like the derivative of a product. But for it to be exactly the derivative of a product of the form
f(t)x(t) we would need f(t) = 1 and f'(t) = a for all t, which is not possible.
Suppose that we multiply both sides by g(t) for each t. Then we have
g(t)x'(t) + ag(t)x(t) = g(t)b(t) for all t.
For the lefthand side of this equation to be the derivative of a product of the form f(t)x(t) we need f(t) = g(t) and f'(t) = ag(t). Is there any function f with this
property? Yes! If f(t) = e^{at} then f'(t) = ae^{at} = af(t).
Thus if we set g(t) = e^{at}, so that we have
e^{at}x'(t) + ae^{at}x(t) = e^{at}b(t),
then an antiderivative of the lefthand side is
e^{at}x(t),
and hence the solution of the equation is given by
e^{at}x(t) = C + ∫^{t}e^{as}b(s)ds,
(where ∫^{t}f(s)ds is, as before, an antiderivative of f evaluated at t), or
x(t) = e^{−at}[C + ∫^{t}e^{as}b(s)ds].
This conclusion is summarized in the following result.
 Proposition

The general solution of the linear firstorder ordinary differential equation
x'(t) + ax(t) = b(t),where a is a constant and b is a continuous function, is given byx(t) = e^{−at}[C + ∫^{t}e^{as}b(s)ds].If b is a constant function, with b(s) = b for all s, and a ≠ 0, then this general solution isx(t) = Ce^{−at} + b/a.
In the case in which b is a constant function and a ≠ 0, for the initial condition x(t_{0}) = x_{0} to be satisfied we need
x_{0} = Ce^{−at}^{0} + b/a.
Thus the solution of the firstorder initial value problem
x'(t) + ax(t)  =  b 
x(t_{0})  =  x_{0} 
x(t) = (x_{0} − b/a)e^{a(t0 − t)} + b/a.
This solution is constant only if x_{0} = b/a, in which case the solution is equal to b/a. Thus b/a is the unique equilibrium of the differential equation.
As t increases without bound, x(t) converges to b/a if a > 0, and grows without bound if a < 0 and x_{0} ≠ b/a. That is, the equilibrium is globally stable if a > 0 and unstable if a < 0.
The following result summarizes these findings.
 Proposition

The linear firstorder ordinary differential equation
x'(t) + ax(t) = bwith a ≠ 0 has a unique equilibrium, b/a. This equilibrium is globally stable if a > 0 and is unstable if a < 0.
 Example

Consider the differential equation
x'(t) + 2x(t) = 6.By the previous result, the general solution of this equation isx(t) = Ce^{−2t} + 3.For the initial condition x(0) = 10, we obtain C = 7, so that the solution isx(t) = 7e^{−2t} + 3.This solution is stable, because 2 > 0.
 Example

When the price of a good is p, the total demand is D(p) = a − bp and the total supply is S(p) = α + βp, where a, b, α, and β are positive constants. When demand exceeds supply, price rises, and when supply exceeds demand it falls. The speed at which the price changes is
proportional to the difference between supply and demand. Specifically,
p'(t) = λ[D(p(t)) − S(p(t))]with λ > 0. Given the forms of the supply and demand functions, we thus havep'(t) + λ(b + β)p(t) = λ(a − α).The general solution of this differential equation isp(t) = Ce^{−λ(b + β)t} + (a − α)/(b + β).The equilibrium price is (a − α)/(b + β), and, given λ(b + β) > 0, this equilibrium is globally stable.
Coefficient of x(t) dependent on t
We may generalize these arguments to the differential equationx'(t) + a(t)x(t) = b(t),
in which a is a function that is not constant. For g(t) times the lefthand side of this equation to be the derivative of f(t)x(t) we need f(t) = g(t) and f'(t) = a(t)g(t) for all
t. The function g(t) = e^{∫ta(s)ds} has this property, because the derivative of ∫^{t}a(s)ds is a(t). Multiplying the equation by this factor, we have
e^{∫}^{t}^{a(s)ds}x'(t) + a(t)e^{∫}^{t}^{a(s)ds}x(t) =
e^{∫}^{t}^{a(s)ds}b(t),
or
(d/dt)[x(t)e^{∫}^{t}^{a(s)ds}] = e^{∫}^{ t}^{a(s)ds}b(t).
Thus
x(t)e^{∫}^{t}^{a(s)ds} = C + ∫^{t}e^{∫}^{u}^{a(s)ds}b(u)du,
or
x(t) = e^{−∫}^{t}^{a(s)ds}[C + ∫^{t}e^{∫}^{u}^{a(s)ds}b(u)du].
In summary, we have the following result.
 Proposition

The general solution of the linear firstorder ordinary differential equation
x'(t) + a(t)x(t) = b(t),where a and b are continuous functions, is given byx(t) = e^{−∫}^{t}^{a(s)ds}[C + ∫^{t}e^{∫}^{u}^{a(s)ds}b(u)du] for all t.
 Example

Consider the differential equation
x'(t) + (1/t)x(t) = e^{t}for t > 0. We have∫^{t}(1/s)ds = ln tsoe^{∫}^{t}^{(1/t)dt} = t.Thus the solution of the equation is
x(t) = (1/t)(C + ∫^{t}ue^{u}du) = (1/t)(C + te^{t} − ∫^{t}e^{u}du) = (1/t)(C + te^{t} − e^{t}) = C/t + e^{t} − e^{t}/t. x'(t) + x(t)/t = −C/t^{2} + e^{t} − e^{t}/t + e^{t}/t^{2} + C/t^{2} + e^{t}/t − e^{t}/t^{2} = e^{t}.