Differential EquationsSolving First-Order Equations5 of 7
Solving First-Order Equations · 5
Linear Equations and the Integrating Factor
We want to solve differential equations where y′ and y are added together, like
y′+2y=ex
For this equation, we can't integrate both sides directly, because we don't know what y is, and we can't separate the variables, because moving 2y across gives y′=ex−2y, which isn't a function of x times a function of y.
Why Separation Fails on y′ + 2y = eˣ
y′+2yy=ex=?
An equation where y′ and y appear to the first power on the left and x-only terms sit on the right is written in standard form as
first-order linear differential equationy′+P(x)y=Q(x)
1
Turning the Left Side into a Product Rule
To solve
y′+2y=ex
we multiply the whole equation by a function M(x) chosen so the left side becomes a single product rule derivative:
Fixing the Broken Product Rule
1⋅y′+2M′⋅yM⋅y′+M′⋅y=ex=(M⋅y)′
M=?
Text solution
Find a multiplier M whose derivative is 2MFor M⋅y′+2M⋅y to match the product rule M⋅y′+M′⋅y, we need M′=2M, which holds when M is e2x.
MM′=e2x=2e2x
Multiply every term by e2x and collapse the left sideMultiplying the whole equation by e2x makes the left side an exact product rule expansion, so it collapses into the single derivative of e2x⋅y.
e2x⋅y′+2e2x⋅ydxd(e2x⋅y)=e2x⋅ex=e3x
Integrate both sides with respect to xIntegrating undoes the derivative on the left side and integrates e3x on the right.
∫dxd(e2x⋅y)dxe2x⋅y=∫e3xdx=31e3x+C
Divide every term by e2xDividing both sides by the multiplier e2x isolates y.
y=31ex+Ce−2x
So y=31ex+Ce−2x is the general solution to y′+2y=ex.
In the (x,y) plane, the slope y′ in y′+2y=ex depends on both x and y, while the derivative of the product e2xy depends only on x. That means changing C simply shifts the curve e2xy=31e3x+C up or down, while dividing back by e2x pulls all the solution curves y=31ex+Ce−2x toward 31ex as x grows.
Multiplying by the integrating factor turns these solutions into simple vertical shifts of one curve, and dividing back shrinks those gaps as you move right so every curve pinches toward the same path.
2
The Integrating Factor Formula
Now consider an equation with a function of x in front of y instead of a constant:
y′+3x2y=6x2
Here we need a multiplier M whose derivative brings down 3x2 in front of M:M′=3x2⋅M.
The Integrating Factor Formula
y′+3x2yM=6x2=?
For any equation in the standard form y′+P(x)y=Q(x), this multiplier is called the integrating factor:
integrating factor M(x)μ(x)=e∫P(x)dx
The Greek letter μ (pronounced "mu") is the standard symbol for the multiplier M(x). We leave off +C when integrating ∫P(x)dx in the exponent because we only need one multiplier that fixes the product rule, not every possible one.
Text solution
Integrate the coefficient of y in the exponent of eWith P(x)=3x2 sitting in front of y, integrating 3x2 in the exponent of e gives the multiplier.
MM=e∫3x2dx=ex3
Multiply by ex3 and collapse the left sideMultiplying every term by ex3 turns the left side into the derivative of the product ex3⋅y.
ex3y′+3x2ex3ydxd(ex3⋅y)=6x2ex3=6x2ex3
Integrate both sides with respect to xOn the right side, 6x2 is 2 times the derivative of the exponent x3, so integrating gives 2ex3+C.
ex3⋅yex3⋅y=∫6x2ex3dx=2ex3+C
Divide every term by ex3Dividing both sides by ex3 gets y alone.
y=2+Ce−x3
So y=2+Ce−x3 solves the equation. Whenever you collapse the left side into dxd(M⋅y), take two seconds to expand the product rule in your head: checking that the derivative of ex3 really is 3x2ex3 catches any slip in your multiplier before you integrate.
Because the area ∫P(x)dx sits in the exponent of μ(x)=e∫P(x)dx, the slope μ′(x) at every x is P(x)μ(x), which makes μ(x)y′+P(x)μ(x)y match dxd(μ(x)y).
For any curve you draw, putting its shaded area in the exponent makes the multiplier's slope match the coefficient in front of y everywhere, so the left side always folds into one derivative.
3
Clearing the Front of y′ and Simplifying Logs
Next, take an equation that starts with an x in front of y′:
xy′+2y=4x2
Our product rule match only works when y′ is by itself, so we first divide the whole equation by x, and then simplify the logarithm that shows up in the multiplier.
Clearing the Front of y′ and Simplifying Logs
xy′+2yy=4x2=?
Text solution
Divide every term by x to clear the front of y′Dividing the entire equation by x puts y′ by itself and shows that the coefficient in front of y is x2.
y′+x2y=4x
Integrate x2 in the exponent and simplify the logarithmMoving the factor of 2 inside the natural log as an exponent lets e and ln cancel completely.
MMMM=e∫x2dx=e2lnx=eln(x2)=x2
Multiply the cleared equation by x2 and collapse the left sideMultiplying y′+x2y=4x by x2 makes the coefficient of y equal to 2x, the derivative of x2.
x2y′+2xydxd(x2⋅y)=4x3=4x3
Integrate both sides and divide every term by x2Integrating gives x4+C on the right, and dividing the entire equation by x2 divides C by x2 as well.
x2⋅yy=x4+C=x2+x2C
So the solution is y=x2+x2C. Notice that we don't need absolute value bars from ∫x1dx=ln∣x∣ because squaring gives x2 whether x is positive or negative, and even with odd powers a ± sign on the multiplier divides out of both sides of the equation.
At any chosen point (x0,y0) in the slope field of xy′+2y=4x2, the curve y=x2+x2C follows the slope arrows everywhere. Adding +C at the end without dividing it by x2 gives y=x2+C, which cuts across the slope field whenever C=0 because the x2C term is needed for the derivatives to balance.
Dividing the constant by the integrating factor bends the curve to follow the slope field, while just adding the constant at the end shifts the curve without changing its slopes.
4
Lining Up Terms and Negative Signs
Now look at an equation where y′ and y start on opposite sides of the equals sign:
y′=2y+e2x
To pack y′ and y into a product rule, both terms have to sit on the left side, and subtracting 2y attaches a minus sign to the coefficient of y.
Lining Up Terms and Negative Signs
y′y=2y+e2x=?
Text solution
Subtract 2y to bring y′ and y to the left sideMoving 2y to the left puts the equation in standard form with −2 in front of y.
y′−2y=e2x
Integrate −2 in the exponent to find the multiplierKeeping the negative sign attached to 2 inside the integral gives a negative exponent on e.
MM=e∫−2dx=e−2x
Multiply by e−2x and collapse the left sideBecause the derivative of e−2x is −2e−2x, the left side packs into dxd(e−2x⋅y), while on the right side e−2x⋅e2x adds exponents to become e0=1.
e−2xy′−2e−2xydxd(e−2x⋅y)=e−2x⋅e2x=1
Integrate both sides and divide by e−2xIntegrating 1 gives x+C, and dividing by e−2x multiplies each term on the right by e2x.
e−2x⋅yy=x+C=xe2x+Ce2x
So y=xe2x+Ce2x is the solution.
5
Putting the Whole Method Together
Every first-order linear differential equation follows the same four steps from initial setup to final division.
The Four-Step Story
y′+P(x)yy=Q(x)=?
Key concepts
Before reaching for an integrating factor, check whether a simpler method already works: if the equation only has x's on the right, like y′=2x, integrate directly to get y=x2+C; if the right side is a function of x times a function of y, like y′=2y, divide by y and separate variables. Use the integrating factor when y′ and y are added or subtracted and the variables won't separate, like y′+2y=ex, where y′=ex−2y is a difference of an x term and a y term rather than a product.
To solve any first-order linear equation, follow the four moves that build and undo the product rule:
Line up and clear the front of y′
into the standard form y′+P(x)y=Q(x). Move the y term to the left and divide every term by whatever sits in front of y′ (so xy′=2y+x3 becomes y′−x2y=x2).
Find the multiplier
by integrating the entire coefficient P(x), including its plus or minus sign, in the exponent of e:
M(x)=e∫P(x)dx
If a logarithm appears in the exponent, move the number in front (sign included) inside the log as an exponent so e and ln cancel directly (e−2lnx=eln(x−2)=x−2).
Multiply and collapse
the left side into a single product derivative:
dxd(M⋅y)=M⋅Q(x)
Quickly differentiate M⋅y in your head to verify that M′ matches the term in front of y.
Integrate and divide
both sides, including +C, by the multiplier M to isolate y:
y=M∫M⋅Q(x)dx+C
6
Practice
1
Solve y′+3y=e2x.
The equation is already in y′+P(x)y=Q(x) form. What number sits in front of y, and what multiplier M has a derivative equal to 3M?
With P(x)=3, integrate 3 in the exponent of e to find the multiplier:
MM=e∫3dx=e3x
Multiply every term by e3x and collapse the left side into a single derivative:
e3xy′+3e3xydxd(e3x⋅y)=e3x⋅e2x=e5x
(Watch out: remember to multiply the right side e2x by e3x as well, adding the exponents to get e5x; leaving the right side as e2x leads to the wrong answer y=21e−x+Ce−3x.)
Integrate both sides with respect to x and divide every term, including C, by e3x:
e3x⋅yy=51e5x+C=51e2x+Ce−3x
2
Solve y′+2xy=4x.
A function of x sits in front of y. Integrate P(x)=2x in the exponent of e to get the multiplier, then notice how the derivative of your new exponent, times 2, sits right out in front on the right side.
Integrate P(x)=2x in the exponent of e:
MM=e∫2xdx=ex2
Multiply every term by ex2 and collapse the left side:
ex2y′+2xex2ydxd(ex2⋅y)=4xex2=4xex2
Integrate both sides (using u=x2, where du=2xdx is half of 4xdx) and divide by ex2:
ex2⋅yex2⋅yy=∫4xex2dx=2ex2+C=2+Ce−x2
(Watch out: when integrating 4xex2, the factor 2x gets absorbed as the derivative of the exponent x2; integrating 4x to 2x2 as if ex2 were a constant gives the wrong answer y=2x2+Ce−x2.)
3
Solve xy′+3y=5x2.
Is y′ by itself yet? Clear the front of y′ before reading off P(x), and simplify the logarithm in the multiplier before multiplying.
Divide every term by x so y′ stands alone:
y′+x3y=5x
(Watch out: reading P(x)=3 before dividing by x gives the wrong multiplier e3x, and forgetting to divide the right side 5x2 by x leaves 5x2 and leads to the wrong answer y=65x3+x3C.)
Find the multiplier and move the 3 inside the log so e and ln cancel:
MMMM=e∫x3dx=e3lnx=eln(x3)=x3
Multiply the cleared equation by x3, collapse the left side, integrate, and divide every term by x3:
x3y′+3x2ydxd(x3⋅y)x3⋅yy=5x4=5x4=x5+C=x2+x3C
4
Solve y′=4y+e4x.
Bring the y term to the left side first. What sign stays attached to the coefficient of y when you set up the integral for the multiplier?
Subtract 4y from both sides to line up y′ and y on the left:
y′−4y=e4x
Integrate P(x)=−4 in the exponent of e:
MM=e∫−4dx=e−4x
(Watch out: dropping the minus sign and using M=e4x fails to fix the product rule on the left, and if you keep going anyway, it turns the right side into e8x and gives the wrong answer y=81e4x+Ce−4x.)
Multiply by e−4x, collapse the left side, integrate 1, and divide by e−4x:
Line up the y term on the left and clear the front of y′ before integrating for the multiplier. When simplifying e−2lnx, does the minus sign move inside the log along with the 2?
Subtract 2y to bring it to the left side, then divide every term by x to clear the front of y′:
xy′−2yy′−x2y=x3=x2
Integrate −x2 in the exponent of e and move the entire −2 inside the logarithm as an exponent:
MMMM=e∫−x2dx=e−2lnx=eln(x−2)=x−2
(Watch out: dropping the minus sign to get M=x2 instead of x−2 turns the right side into x4 and leads to the wrong answer y=51x3+Cx−2.)
Multiply the cleared equation by x−2, collapse the left side, integrate 1, and divide by x−2: