Femtobytes
Problem type

First order linear equation with an integrating factor

What it solves
Solve a first order linear differential equation of the form y' + a y = b + c x with a starting value, by the integrating factor method: find the factor, integrate (by parts where needed), fit the starting value, and check the answer in the equation.
Subject
Differential Equations
Topic
First order equations
Also called
integrating factor, first order ODE, linear differential equation
Your problem

Solve this starting value problem.

y′+2y=4x+3,y(0)=1y' + 2y = 4 x + 3, \qquad y(0) = 1
Invent a new one:
The problem

Solve this starting value problem.

y′+2y=4x+3,y(0)=1y' + 2y = 4 x + 3, \qquad y(0) = 1
The result
y=2x+12+12e−2xy = 2 x + \frac{1}{2} + \frac{1}{2} e^{-2 x}

Found with the integrating factor e2xe^{2 x} and checked in the original equation.

checked 5 lines of this solution were evaluated with exact arithmetic before it was shown to you. A solution with a false line is never served.
Picture 1 of 7Step 1: See what kind of equation this is, and what would make it easy
-1.5-1-0.500.511.522.533.50123456xystart (0, 1)the solution through the starting pointthe line every solution is compared withthe slope the equation demands there
The little strokes show the slope the equation demands at each point, which is 4x + 3 minus 2 times y. A solution is a curve that follows the strokes everywhere. The bright curve is the one that passes through the starting point.
1

See what kind of equation this is, and what would make it easy

Why this step

The unknown here is a whole function y(x)y(x), and the equation ties its slope y′y' to its own value. We cannot simply integrate both sides, because yy is tangled up on the left with its own derivative. The idea that unlocks it: the left side ALMOST looks like the result of the product rule. If it were exactly the derivative of a product, one integration would finish the job. So we ask what we could multiply by to make it so.

y′+2y=4x+3,y(0)=1y' + 2y = 4 x + 3, \qquad y(0) = 1
y′y' means the derivative of yy with respect to xx: the slope of the graph of yy. The second statement is the starting value, which will single out one solution from a whole family.
2

Find the integrating factor

Why this step

Multiply the equation by an unknown function μ(x)\mu(x) (the Greek letter mu). The left side becomes μy′+2μy\mu y' + 2 \mu y. The product rule says (μy)′=μy′+μ′y(\mu y)' = \mu y' + \mu' y. These two match exactly when μ′=2μ\mu' = 2 \mu: a function whose derivative is 22 times itself. Exponentials are the functions that do that.

μ(x)=e2x\mu(x) = e^{2 x}
The derivative of ekxe^{kx} is kekxk e^{kx}, so this μ\mu satisfies μ′=2μ\mu' = 2 \mu. In general the integrating factor is e∫p(x) dxe^{\int p(x) \, dx}, and here ∫2 dx=2x\int 2 \, dx = 2 x.
3

Multiply through and recognise a product rule

Why this step

This is the moment the method was designed for. After multiplying by μ\mu, the left side is no longer two tangled terms; it is the derivative of the single product μy\mu y, and a derivative is something we know how to undo.

e2xy′+2e2xy=e2x(4x+3)e^{2 x} y' + 2 e^{2 x} y = e^{2 x} \left( 4 x + 3 \right)
Every term multiplied by e2xe^{2 x}.
(e2x y)′=e2x(4x+3)\left( e^{2 x} \, y \right)' = e^{2 x} \left( 4 x + 3 \right)
The left side is exactly what the product rule gives for (e2xy)′\left( e^{2 x} y \right)': first times derivative of second, plus derivative of first, 2e2x2 e^{2 x}, times second.
4

Integrate both sides

Why this step

Integrating the left side simply removes the derivative and leaves μy\mu y. All the real work is on the right: we need a function whose derivative is e2x(4x+3)e^{2 x} \left( 4 x + 3 \right). A polynomial times an exponential calls for integration by parts, which is the product rule run backwards: it trades the integral for an easier one in which the polynomial has been differentiated away.

Take u=4x+3u = 4 x + 3, so du=4 dxdu = 4 \, dx; and dv=e2x dxdv = e^{2 x} \, dx, so v=12e2xv = \frac{1}{2} e^{2 x}. Then:

∫e2x(4x+3)dx=12e2x(4x+3)−∫(2e2x) dx\int e^{2 x} \left( 4 x + 3 \right) dx = \frac{1}{2} e^{2 x} \left( 4 x + 3 \right) - \int \left( 2 e^{2 x} \right) \, dx
uvu v minus the integral of v duv \, du. The remaining integral has only an exponential in it.
=12e2x(4x+3)−e2x+C= \frac{1}{2} e^{2 x} \left( 4 x + 3 \right) - e^{2 x} + C
∫ekxdx=1kekx\int e^{kx} dx = \frac{1}{k} e^{kx}, and now the constant of integration CC appears: it is what will later absorb the starting value.
2e2x(2x+12)+2e2x=e2x(4x+3)2 e^{2 x} \left( 2 x + \frac{1}{2} \right) + 2 e^{2 x} = e^{2 x} \left( 4 x + 3 \right)
Check the integral by differentiating the answer, e2x(2x+12)e^{2 x} \left( 2 x + \frac{1}{2} \right), with the product rule. It returns the function we integrated. (Evaluated at several values of xx.) checked
e2x y=e2x(2x+12)+Ce^{2 x} \, y = e^{2 x} \left( 2 x + \frac{1}{2} \right) + C
Both sides integrated, with the right side collected into one bracket.
5

Divide by the integrating factor

Why this step

We introduced μ\mu only as scaffolding. Dividing by it, which is safe because an exponential is never zero, leaves yy on its own. What appears is a whole family of solutions, one for each value of CC, and the two parts of it mean different things: one part is forced by the right side of the equation, the other is the free response of the equation itself.

y=2x+12+Ce−2xy = 2 x + \frac{1}{2} + C e^{-2 x}
Dividing CC by e2xe^{2 x} gives Ce−2xC e^{-2 x}. This is the general solution.
6

Use the starting value to find the constant

Why this step

A first order equation has one free constant, and one piece of information fixes it. Without the starting value the equation describes every possible history of the system; the starting value picks out the one that actually happened.

y(0)\displaystyle y(0)==12+C\displaystyle \frac{1}{2} + C
Put x=0x = 0 into the general solution. e0=1e^0 = 1, so the exponential disappears. checked
==1\displaystyle 1
This must equal the starting value, which fixes C=1−12=12C = 1 - \frac{1}{2} = \frac{1}{2}. checked
y=2x+12+12e−2xy = 2 x + \frac{1}{2} + \frac{1}{2} e^{-2 x}
The solution of the starting value problem.
7

Check the answer in the original equation

Why this step

A differential equation hands us the perfect test of any proposed answer: differentiate it, put it in, and see whether the two sides agree for EVERY xx. No trust in the method is required; the check would expose a slip in any of the steps above.

y′=2−e−2xy' = 2 - e^{-2 x}
Differentiate the solution. The derivative of ek(x−x0)e^{k(x - x_0)} is kek(x−x0)k e^{k(x - x_0)}.
2−e−2x+2(2x+12+12e−2x)=4x+32 - e^{-2 x} + 2 \left( 2 x + \frac{1}{2} + \frac{1}{2} e^{-2 x} \right) = 4 x + 3
y′+2yy' + 2 y with our yy put in. The exponentials cancel and the right side of the equation appears. (Evaluated at several values of xx.) checked
y(0)=1y(0) = 1
The starting value. checked