When a differential equation has only x on the right, like dxdy=2x, we find y by taking an antiderivative: y=x2+C. But in dxdy=−yx, we can't integrate the right side with respect to x, because y is the unknown function of x we're trying to find.
You may recognise −yx from implicit differentiation on the circle x2+y2=25:
x2+y22x+2ydxdydxdy=25=0=−yx
So this derivative came from a circle. The question is how to run that step backwards when we don't know the curve yet.
Solve dxdy=−yx with y(0)=3
Text solution
Multiply both sides by yNow every y is on the left beside dxdy, and by the chain rule each side is a derivative with respect to x.
ydxdy=−x→dxd(2y2)=dxd(−2x2)
One constant, a family of circlesTwo functions with the same derivative differ by a constant, so one C on the right is enough.
2y2=−2x2+C→x2+y2=2C
Pick the circle, then the halfThe point (0,3) gives 2C=9. A function is only one half of the circle, and y(0)=3 is positive, so we take the upper half. Starting from y(0)=−3 would give the lower half, y=−9−x2.
x2+y2=9→y=9−x2
On the slope field of −yx, every circle centred at the origin lies along the marks, and the start (0,3) picks out the top half of one of them.
2
Where the constant goes
In dxdy=xy, the right side is an x-part times a y-part. We call an equation like that separable, because dividing by the y-part separates the two variables, the same way multiplying by y did in the last section. This time the question is where the constant ends up. Is the answer just e2x2+C?
Solve dxdy=xy
Text solution
Separate and integratey1dy=xdx is shorthand for y1dxdy=x, and the left side is the derivative of ln∣y∣.
∫y1dy=∫xdx→ln∣y∣=2x2+C
The constant becomes a factorRaising e to both sides turns the added C into a factor eC. Dropping the bars gives ±eC, any non-zero number, and y=0 is a solution too, so one constant A covers every number.
∣y∣=eC⋅e2x2→y=Ae2x2
Why not e2x2+C?Through (0,3) that would be e2x2+2, but its slope isn't x times its height: it's off by 2x.
(e2x2+2)′=xe2x2
x(e2x2+2)=xe2x2+2x
The starting value is AAt x=0,e0=1, so A=y(0). A negative A is possible only because of the absolute value bars.
y(0)=3→y=3e2x2
y(0)=−2→y=−2e2x2
Here is the reason on the slope field. The slope at each point has to be x times the height. Multiplying by 3 triples the height and the slope together, so 3e2x2 follows the marks. Adding 2 raises the height without changing the slope, so e2x2+2 cuts across them.
Why does the constant multiply the exponential after separation?
3
Finding C before solving for y
With an initial condition, we have two things to find, y and C, and a choice of which comes first. These two equations show why it pays to find C first, and the second one can't be solved for y at all.
Solve dxdy=2xey with y(0)=0, and (2+cosy)dxdy=2x with y(0)=π
dxdy=2xey,y(0)=0
y=?
Text solution
Separate and integrateDividing by ey is multiplying by e−y, and the derivative of −e−y is e−y.
e−ydy=2xdx→−e−y=x2+C
Find C while it's alonePlugging in (0,0) now takes one line. Solving for y first would put C inside a natural log, as y=−ln(−x2−C), and we'd have to dig it out.
−e0=0+C→C=−1
Then solve for yMultiply by −1 and take the natural log. Its derivative, 1−x22x, equals 2xey, so it checks.
e−y=1−x2→y=−ln(1−x2)
When y can't be isolatedIn 2y+siny,y is both outside and inside the sine, so no algebra solves for it. Plugging in (0,π) still gives C, and the equation is the answer.
2y+siny=x2+C,2π+sinπ=0+C→C=2π
2y+siny=x2+2π
4
Where a solution is valid
A formula for y isn't the whole answer. The solution through an initial point is one continuous curve, so we also need the interval of x-values where it holds. Let's find both for dxdy=y2.
Solve dxdy=y2 with y(0)=1, and find where it is valid
dxdy=y2,y(0)=1
y=?,for which x?
Text solution
Separate, integrate, find CThe integral of y−2 is −y1, and (0,1) gives C=−1.
−y1=x−1→y=1−x1
Keep the piece through (0,1)The asymptote at x=1 splits the graph in two. Our point is on the left piece, where y goes to infinity as x approaches 1, so the solution can't continue past it.
y=1−x1,x<1
The circle from section 1At x=±3,y=0, so −yx is undefined there.
y=9−x2,−3<x<3
The right-hand piece of 1−x1 also follows the slope field, but it's a different solution: it passes through (2,−1), so it solves the problem with y(2)=−1. To reach it from (0,1) we'd have to jump across the asymptote.
Does every initial value give the same interval of solution?
5
Telling whether an equation is separable
So far, every equation had dxdy as an x-part times a y-part from the start. Often it takes a step of algebra to see the product, and three rewrites come up again and again.
Factoring out x
dxdy=xy+x=x(y+1)
y+1dy=xdx
Splitting the exponent
dxdy=ex−y=ex⋅e−y
eydy=exdx
Solving for dy/dx
xdxdydxdy=3−y=(3−y)⋅x1
3−ydy=xdx
Not every equation separates, though. Let's check these three, and then one where no rewrite gives a product.
Tell whether dxdy=xy+x,dxdy=ex−y,xdxdy=3−y, and dxdy=x+y are separable
dxdyxdxdy=xy+x=3−ydxdydxdy=ex−y=x+y
separable?
dxdydxdyxdxdydxdy=xy+x=ex−y=3−y=x+y
separable?
Text solution
The first three separateEach rewrite above gives an x-part times a y-part, so we move the y-part to the left with dy, keep the x-part on the right with dx, and integrate.
dxdy=x+y doesn'tThere's no common factor, and dividing by y leaves yx, with both variables together. No algebra step turns x+y into a product. Slope fields and Euler's method still approximate its solutions, and a later lesson shows how to solve it.
y1dxdy=yx+1
Summary
Telling whether an equation is separable
Separable
dxdydxdy=xy+x=x(y+1)=ex−y=ex⋅e−y
Not separable
dxdy=x+y
An equation is separable if you can write dxdy as an x-part times a y-part. Factoring or splitting an exponent can turn a sum or difference into a product. If x and y stay added together, like x+y, the equation is not separable.
Separating and integrating
dxdy∫y1dyln∣y∣=xy=∫xdx=2x2+C
Move all the y terms to the left with dy, and all the x terms to the right with dx. Then integrate each side. You only need one constant +C, because any constant from the left combines with the constant on the right.
Where the constant goes
ln∣y∣y=2x2+C=Ae2x2
eyy=ex+C=ln(ex+C)
Write +C right after integrating, and carry it along as you solve for y. Raising e to both sides of ln∣y∣=2x2+C turns the +C in the exponent into a multiplying factor eC. So y=Ae2x2, where A=±eC, and not e2x2+C. For ey=ex+C, taking the natural log gives y=ln(ex+C), not x+C.
Finding the sign of y
x2+y2=9,y(0)=−3→y=−9−x2
y=Ae2x2,y(0)=−2→y=−2e2x2
An initial condition fixes both the constant and the sign of y. Because y(0)=−3 is negative, choose the negative square root. The same happens with y=Ae2x2. At x=0,e0=1, so A is just y(0). Because y(0)=−2,A=−2, and the solution is y=−2e2x2.
Finding C before solving for y
−e−y=x2+C,y(0)=0→C=−1→y=−ln(1−x2)
Plug in the initial condition right after integrating, while C stands alone on the right side. That keeps C out of later steps like logs or roots. Once you have C, solve for y. If we can't solve the equation for y with algebra, substitute the value of C and leave the answer as an equation.
The interval of a solution
dxdy=y2,y(0)=1→y=1−x1,x<1
A particular solution is the single continuous piece of the graph that passes through the initial point. For y=1−x1 with y(0)=1, the vertical asymptote at x=1 splits the graph, so the solution through (0,1) is valid only for x<1.
6
Practice
Give exact values unless a problem asks for a decimal.
1
Solve dxdy=ycosx with y(0)=3.
Divide both sides by y to separate the variables. What is ∫y1dy?
How can you write esinx+C as a constant times esinx?
If you got y=esinx+2esinx+C is eC⋅esinx, so the constant multiplies esinx instead of adding to it.
Divide both sides by y to separate the variables, then integrate.
y1dyln∣y∣=cosxdx=sinx+C
Raise e to both sides, and replace ±eC with a single constant A.
∣y∣y=esinx+C=eC⋅esinx=Aesinx
Plug in x=0 and y=3 to find A.
3Ay=Ae0=3=3esinx
2
Solve dxdy=y2x with y(0)=−3.
Multiply both sides by y and integrate to get y2=2x2+2C. What is 2C when x=0 and y=−3?
Taking the square root gives y=2x2+9 or y=−2x2+9. Which one matches y(0)=−3?
If you got y=2x2+9 Check the sign of y(0). The positive square root gives y(0)=3, not −3.
Multiply both sides by y to separate the variables, integrate, and multiply by 2.
ydy2y2y2=2xdx=x2+C=2x2+2C
Plug in x=0 and y=−3 to find 2C.
(−3)2y2=0+2C=2x2+9
Taking the square root gives a positive and a negative root. The initial value y(0)=−3 is negative, so choose the negative root.
yory=2x2+9=−2x2+9
y(0)=−3<0→y=−2x2+9
3
Find the general solution of dxdy=xy+x.
Factor an x out of xy+x. Which factor contains y?
If ln∣y+1∣=2x2+C, what do you get when you raise e to both sides?
If you got y=e2x2+C Remember that e2x2+C is eC⋅e2x2, which means the constant multiplies the exponential instead of adding to it. Subtracting 1 from y+1=Ae2x2 gives y=Ae2x2−1.
Factor the right side as x(y+1), then divide by y+1 to separate the variables.
xy+xy+1dy=x(y+1)=xdx
Integrate both sides.
ln∣y+1∣=2x2+C
Raise e to both sides, replace ±eC with the constant A, and subtract 1 to isolate y.
∣y+1∣y+1y=eC⋅e2x2=Ae2x2=Ae2x2−1
4
Solve dxdy=ex−y with y(0)=ln2.
Rewrite ex−y as a product of two powers of e.
In ey=ex+C, plug in x=0 and y=ln2 to find C before taking the natural log.
If you got y=x+ln2 Check where the constant was added. Integrating gives ey=ex+C, so finding C before taking the log keeps the constant inside the natural log.
Split ex−y into ex⋅e−y, then multiply both sides by ey to separate the variables.
ex−yeydy=ex⋅e−y=exdx
Integrate both sides.
ey=ex+C
Find C using x=0 and y=ln2 while it's still outside the natural log.
eln22C=e0+C=1+C=1
Take the natural log of both sides to get y by itself.
eyy=ex+1=ln(ex+1)
5
Let y solve (1+ey)dxdy=3x2 with y(0)=0. Find x when y=1.
Multiply both sides by dx and integrate. What is the antiderivative of 1+ey with respect to y?
In y+ey=x3+C, plug in x=0 and y=0. What is e0?
If you got x=31+e Check the value of e0. It's 1, not 0, so C=1.
Multiply both sides by dx to separate the variables, then integrate.
(1+ey)dyy+ey=3x2dx=x3+C
Plug in x=0 and y=0 to find C, remembering that e0=1.
0+e0Cy+ey=0+C=1=x3+1
Plug y=1 directly into the equation to solve for x.
1+ex3x=x3+1=e=3e
6
Solve dxdy=1+y2 with y(0)=1.
Divide both sides by 1+y2. What function has derivative 1+y21?
Plug x=0 and y=1 into arctany=x+C. What angle has tangent equal to 1?
If you got y=tanx+1 Check where C is added. The integral gives arctany=x+C, so taking the tangent of both sides puts C inside the tangent.
Divide both sides by 1+y2 to separate the variables, then integrate.
1+y2dyarctany=dx=x+C
Plug in x=0 and y=1 to find C before taking the tangent.
arctan1C=0+C=4π
Take the tangent of both sides to solve for y.
y=tan(x+4π)
7
Which of these differential equations is separable?
In equation (C), factor y out of the right side, then divide by x. Can you write dxdy as a function of x alone times a function of y alone?
If you got (B) Factoring xy−x2 gives x(y−x), but the factor y−x still has both x and y, so it can't be separated.
Factor out y on the right side and divide by x to separate the variables.
xdxdydxdyydy=y+xy=y(1+x)=y⋅x1+x=x1+xdx
In (B), the factor y−x still contains both variables. In (A), x+y is a sum that doesn't factor, and in (D), x and y are multiplied inside the sine function.
(B)xy−x2=x(y−x)
(A)x+y,(D)sin(xy)
8
Let y=f(x) be the solution of dxdy=2xy2 with f(1)=1. (Challenge) (a) Use the tangent line to the graph of f at x=1 to approximate f(1.1). (b) Is the approximation in (a) greater than or less than f(1.1)? Explain using dx2d2y. (c) Find f(x) and the interval on which it is the solution.
The slope at (1,1) comes from the differential equation. What is 2xy2 at x=1 and y=1?
(b)
Differentiate 2xy2 with respect to x using the product rule and chain rule, remembering that y is a function of x. What is the sign of dx2d2y at (1,1)?
<x<
Divide by y2 to get y−2dy=2xdx. What is ∫y−2dy?
Where is the denominator of f(x) equal to 0? Which continuous piece contains x=1?
If you got f(x)=x21 Check the integral of y−2. The power rule gives −1y−1=−y1, not y1.
If you got all x=±2 The solution must be continuous on a single open interval containing the initial point x=1.
Tangent line approximationFind the slope at (1,1), write the tangent line, and plug in x=1.1.
dxdy(1,1)f(1.1)=2⋅1⋅12=2≈1+2(0.1)=1.2
ConcavityDifferentiate dxdy using the product and chain rules. Since the second derivative is positive at (1,1), the curve is concave up, so the tangent line lies below the curve and the estimate is less than f(1.1).
dx2d2y=2y2+4xydxdy=2(1)2+4(1)(1)(2)=10>0
Separate and find CSeparate the variables, integrate both sides, and plug in (1,1) to find C.
y−2dy−y1−1C=2xdx=x2+C=1+C=−2
Solve for y, then choose the interval between the vertical asymptotes that contains the initial point x=1.