Differential EquationsSolving First-Order Equations6 of 7
Solving First-Order Equations · 6
Exact Equations
We need a way to solve differential equations like (2xy)dx+(x2+2y)dy=0, where x and y cannot be separated and the equation is not linear.
1
Level curves and zero height change
Before solving the differential equation, let's look at the kind of curve its solution comes from: a level curve, which is the path in the x,y plane where a 3D surface stays at a constant height. For the surface x2y+y2 sliced at height 5, the level curve is:
x2y+y2=5
Walking along this curve keeps our height fixed at 5, which links a small step (dx,dy) in the x,y plane directly to the slopes of the surface.
Level curves and zero height change
When we take a derivative with respect to one variable while holding the other variable fixed as a constant, we write ∂ instead of d. Adding the height change from the x step (shown in blue) and the height change from the y step (shown in orange) gives the differential form of the level curve:
∂x∂(x2y+y2)(2xy)dx+∂y∂(x2y+y2)(x2+2y)dy=0
Dividing both sides by dx writes the exact same zero-height-change condition using the slope dxdy:
2xy+(x2+2y)dxdy=0
On the level curve x2y+y2=5, any small step (dx,dy) along the curve makes the height changes (2xy)dx and (x2+2y)dy equal and opposite, so they cancel out and keep the height at 5.
A step stays on the level curve only when the height changes from its horizontal and vertical parts cancel each other out.
2
Solving an exact equation by rebuilding the surface
Now suppose we are given the differential equation on its own and asked to find the curves that solve it:
(2xy)dx+(x2+2y)dy=0
When the dx piece and the dy piece are the x and y derivatives of a single surface, the equation is called an exact equation, and we solve it by undoing those derivatives to rebuild the surface.
Solving an exact equation by rebuilding the surface
(2xy)dx+(x2+2y)dyFunction=0=?
Text solution
Integrate the dx piece with respect to xHolding y constant recovers the terms containing x, while any term made purely of y that disappeared during differentiation becomes an unknown function g(y):
Function=∫2xydx=x2y+g(y)
Take the y derivative and match it to the dy pieceDifferentiating our expression with respect to y while holding x constant must match the dy piece x2+2y:
∂y∂(x2y+g(y))x2+g′(y)g′(y)=x2+2y=x2+2y=2y
Integrate g′(y) with respect to y and set the function equal to CUndoing the y derivative recovers the pure-y term, and slicing the rebuilt surface at any constant height C gives the solution curves:
g(y)x2y+y2=∫2ydy=y2=C
So the solutions are all the level curves where the surface x2y+y2 stays at a constant height C.
3
The exactness test
If we change a single number in our equation, the rebuilding method runs into a contradiction:
(3xy)dx+(x2+2y)dy=0
Before integrating, we need a quick test to tell whether the dx and dy pieces actually come from the same 3D surface.
The exactness test
(3xy)dx+(x2+2y)dy=0
exact?
For any differential equation written in the form
dx pieceMdx+dy pieceNdy=0
the two pieces come from the same smooth surface if and only if taking the opposite derivative of each piece gives the same result:
My∂y∂M=Nx∂x∂N
Here the subscript in My tells us which variable we are differentiating with respect to while holding the other variable fixed.
On our original equation (2xy)dx+(x2+2y)dy=0, the opposite derivatives match:
MyNx=∂y∂(2xy)=2x,=∂x∂(x2+2y)=2x
On the changed equation (3xy)dx+(x2+2y)dy=0, the opposite derivatives disagree, telling us right away that no single surface has both slopes:
My=∂y∂(3xy)=3x=Nx=∂x∂(x2+2y)=2x
Around a tiny dx-by-dy square, stepping dx then dy must reach the same height as stepping dy then dx. That happens when My=Nx, so the exact slopes (2xy,x2+2y) fit a smooth surface patch, while the changed slopes (3xy,x2+2y) leave a height gap that no surface can fit.
Stepping around any small square in either order lands at the same corner height and forms a smooth surface patch only when the two slopes change at matching rates.
4
Rewriting an equation and using an initial condition
An exact equation often starts out solved for dxdy as a fraction, paired with a starting point that picks out one specific level curve:
dxdy=x2+4y3−2xy−3x2,y(1)=1
To test for exactness and rebuild the surface, we first clear the fraction and move every term to one side so the equation equals zero.
Rewriting an equation and using an initial condition
dxdyy(1)level curve=x2+4y3−2xy−3x2=1=?
Text solution
Clear the denominator and move all terms to one sideMultiplying by x2+4y3 and dx puts the equation into Mdx+Ndy=0 form:
(x2+4y3)dy=(−2xy−3x2)dx
(2xy+3x2)dx+(x2+4y3)dy=0
Check that the opposite derivatives matchDifferentiating M with respect to y and N with respect to x confirms the equation is exact:
MyNx=∂y∂(2xy+3x2)=2x,=∂x∂(x2+4y3)=2x
Integrate the dx piece with respect to xHolding y constant recovers the x terms and adds g(y) for any pure-y terms:
Function=∫(2xy+3x2)dx=x2y+x3+g(y)
Take the y derivative and match it to the dy pieceSetting the y derivative of our function equal to N cancels x2 on both sides and leaves g′(y) in terms of y alone:
Set the function equal to C and plug in (1,1)Substituting x=1 and y=1 into the level-curve equation finds the slice height C:
x2y+x3+y4(1)2(1)+(1)3+(1)43=C=C=C
So the solution is the level curve x2y+x3+y4=3, which we leave in this implicit form without solving for y.
Each starting point (x0,y0) sets the slice height C on the surface z=x2y+x3+y4, picking out the level curve through (x0,y0) without solving for y.
Every starting point on the floor has a height on the surface above it, and slicing the surface at that height traces the whole solution curve through the point without ever solving for y.
5
Fixing a non-exact equation with an x-only integrating factor
Now let's take an equation that cannot be separated and also fails the exactness test:
(2y2+3x)dx+(2xy)dy=0
If an exact equation had a common factor divided out of both sides, the right side stayed 0 while M and N changed. We can make it exact again by multiplying the whole equation by an integrating factorμ(x) that depends only on x.
Fixing a non-exact equation with an x-only integrating factor
(2y2+3x)dx+(2xy)dyμ(x)=0=?
An x-only integrating factor μ(x) exists whenever subtracting the opposite derivatives and dividing by N cancels y completely, leaving a function of x alone:
μμ′μ(x)=NMy−Nx(must contain x only),=e∫(My−Nx)/Ndx
Text solution
Check the opposite derivativesDifferentiating M with respect to y and N with respect to x shows they do not match:
MyNx=∂y∂(2y2+3x)=4y,=∂x∂(2xy)=2y
Test NMy−Nx and compute μ(x)Dividing the difference by N=2xy cancels y completely, and integrating in the exponent of e gives the multiplier:
Multiply the entire equation by μ(x)=x and re-check exactnessMultiplying both pieces by x puts back the missing factor so the new opposite derivatives match:
x(2y2+3x)dx+x(2xy)dy(2xy2+3x2)dx+(2x2y)dy=0=0
∂y∂(2xy2+3x2)=4xy=∂x∂(2x2y)
Rebuild the surface from the multiplied equationIntegrating the new dx piece with respect to x and matching its y derivative to the new dy piece gives g′(y)=0:
Setting the rebuilt function equal to C gives the level-curve solutions x2y2+x3=C.
6
Integrating factors that depend on y
When dividing My−Nx by N leaves both x and y in the fraction, as in
(2xy)dx+(2x2+3y)dy=0
we test whether the missing multiplier depends only on y instead, written μ(y).
Integrating factors that depend on y
μ(x):μ(y):μμ′μμ′=NMy−Nx=?
When μ depends on y, taking the y derivative applies the product rule to μ(y)M, which flips the subtraction order in the numerator and divides by M instead of N:
μμ′μ(y)=MNx−My(must contain y only),=e∫(Nx−My)/Mdy
Text solution
Check exactness and test NMy−NxThe opposite derivatives disagree, and dividing by N=2x2+3y fails to cancel y:
MyNxNMy−Nx=∂y∂(2xy)=2x,=∂x∂(2x2+3y)=4x=2x2+3y2x−4x=2x2+3y−2x(still contains both xand y)
Test MNx−My and compute μ(y)Dividing Nx−My by M=2xy cancels x completely and leaves a function of y alone:
Multiply the entire equation by μ(y)=y and verify exactnessMultiplying every term by y makes both opposite derivatives equal 4xy:
y(2xy)dx+y(2x2+3y)dy(2xy2)dx+(2x2y+3y2)dy=0=0
∂y∂(2xy2)=4xy=∂x∂(2x2y+3y2)
Rebuild the surface from the multiplied equationIntegrating the new dx piece with respect to x and matching its y derivative to the new dy piece recovers the missing y3 term:
Setting the rebuilt function equal to C gives the level-curve solutions x2y2+y3=C.
Key concepts
Before testing for exactness, check whether the variables already separate: an equation like (2x)dx+(3y2)dy=0 integrates term-by-term right away, whereas a sum like x2+2y inside (2xy)dx+(x2+2y)dy=0 keeps x and y added together so we cannot separate them.
To solve an equation where x and y cannot be separated, clear any fractions and move all terms to one side so it reads Mdx+Ndy=0, then check the opposite derivatives:
Exact right away (My=Nx)
In (2xy)dx+(x2+2y)dy=0, both My and Nx equal 2x. Rebuild the surface by integrating M with respect to x to get ∫2xydx=x2y+g(y), differentiating with respect to y to match N (x2+g′(y)=x2+2y⟹g(y)=y2), and setting the completed function equal to a constant height: x2y+y2=C.
Needs an x-only multiplier (My=Nx, and NMy−Nx cancels y)
In (2y2+3x)dx+(2xy)dy=0, dividing by the single-term piece N=2xy gives 2xy4y−2y=x1. Multiply the whole equation by μ(x)=e∫(1/x)dx=x before rebuilding the surface.
Needs a y-only multiplier (My=Nx, and MNx−My cancels x)
In (2xy)dx+(2x2+3y)dy=0, dividing by the single-term piece M=2xy gives 2xy4x−2x=y1. Multiply the whole equation by μ(y)=e∫(1/y)dy=y before rebuilding the surface.
Initial condition y(x0)=y0
Plug (x0,y0) directly into your final equation Function=C to find the number C, and leave the curve in implicit form.
7
Practice
1
Solve (2xy+4x)dx+(x2−3y2)dy=0.
Check My and Nx first; after integrating the dx piece with respect to x, what stands in for the pure-y terms that disappeared when taking the x derivative?
Check the opposite derivatives:
MyNx=∂y∂(2xy+4x)=2x,=∂x∂(x2−3y2)=2x
Since My=Nx, the equation is exact. Integrate the dx piece with respect to x:
Function=∫(2xy+4x)dx=x2y+2x2+g(y)
Differentiate with respect to y and match to the dy piece:
x2+g′(y)g′(y)g(y)=x2−3y2=−3y2=∫(−3y2)dy=−y3
Watch out: If you instead integrate both pieces separately, getting x2y+2x2 from M and x2y−y3 from N, remember that x2y is the same shared term seen from both directions; adding it twice gives the wrong answer 2x2y+2x2−y3=C (and leaving off =C writes only the surface x2y+2x2−y3).
Set the completed function equal to C:
x2y+2x2−y3=C
2
Solve dxdy=x3+2y−3x2y−2x with y(1)=2.
Multiply by the denominator and move everything to one side so the equation equals 0 before checking My and Nx.
Clear the fraction and move all terms to the left side:
(x3+2y)dy(3x2y+2x)dx+(x3+2y)dy=(−3x2y−2x)dx=0
Watch out: Moving (−3x2y−2x)dx to the left side without flipping its signs gives (−3x2y−2x)dx+(x3+2y)dy=0, where My=−3x2=Nx=3x2 makes an exact equation look non-exact (or leads to −x3y−x2+y2=1).
Check the opposite derivatives:
MyNx=∂y∂(3x2y+2x)=3x2,=∂x∂(x3+2y)=3x2
Integrate the dx piece with respect to x:
Function=∫(3x2y+2x)dx=x3y+x2+g(y)
Differentiate with respect to y and match to the dy piece:
x3+g′(y)g′(y)g(y)=x3+2y=2y=∫2ydy=y2
Set the function equal to C and substitute x=1,y=2:
x3y+x2+y2(1)3(2)+(1)2+(2)27=C=C=C
Watch out: Swapping the coordinates in y(1)=2 and plugging in x=2,y=1 gives C=(2)3(1)+(2)2+(1)2=13 and the wrong curve x3y+x2+y2=13.
x3y+x2+y2=7
3
Solve (3xy+2y2)dx+(x2+2xy)dy=0.
When My and Nx do not match, factor x out of N=x2+2xy to see how My−Nx simplifies.
Check the opposite derivatives:
MyNx=∂y∂(3xy+2y2)=3x+4y,=∂x∂(x2+2xy)=2x+2y
Since My=Nx, test for an x-only integrating factor by dividing My−Nx by N:
Watch out: Forgetting to multiply the original equation by μ(x)=x before integrating (and integrating the old dx piece 3xy+2y2 instead) gives the wrong answer 23x2y+2xy2=C.
Integrate the new dx piece with respect to x and match its y derivative to the new dy piece:
Compare M=2xy and N=3x2+4y: dividing the difference of the derivatives by which piece will cancel x out completely?
Check the opposite derivatives:
MyNx=∂y∂(2xy)=2x,=∂x∂(3x2+4y)=6x
Since My=Nx and M=2xy is a single term, test for a y-only integrating factor using MNx−My:
MNx−My=2xy6x−2x=2xy4x=y2
Watch out: Using My−Nx instead of Nx−My when dividing by M flips the sign to −y2, giving μ(y)=y−2 instead of y2, and the multiplied equation still fails the exactness test: My=−y22x but Nx=y26x.
Find μ(y) and multiply the entire equation by y2:
μ(y)(2xy3)dx+(3x2y2+4y3)dy=e∫(2/y)dy=e2lny=y2=0
Integrate the new dx piece with respect to x and match its y derivative to the new dy piece:
Since My=Nx, divide My−Nx by N=2y to find μ(x):
NMy−Nxμ(x)=2y2y−0=1=e∫1dx=ex
Multiply the entire equation by μ(x)=ex:
(exy2+2e2x)dx+(2exy)dy=0
Watch out: When multiplying 2ex by ex, add the exponents to get 2e2x (which integrates to e2x); leaving that term as 2ex gives the wrong curve exy2+2ex=3.
Integrate the new dx piece with respect to x and match its y derivative to the new dy piece: