Differential EquationsSolving First-Order Equations4 of 7
Solving First-Order Equations · 4
Separable Equations
We want to find a function y whose derivative depends on both x and y, starting with:
dxdy=2x⋅y2
When the right side only depends on x, we can integrate with respect to x right away, but having y2 mixed in on the right stops us from integrating directly.
Why You Can't Just Integrate Both Sides
y=∫2x⋅y2dx=?
Trying to integrate ∫2x⋅y2dx right away doesn't work because y changes as x changes, and we don't know what formula y has yet.
1
Separating variables into tiny steps
To fix that, we treat dxdy as a fraction of two tiny steps, dy and dx, and use algebra to group all the y's with dy and all the x's with dx before we integrate.
Separating Variables as Tiny Steps
Dividing both sides by y2 and multiplying by dx puts each variable with its own step, turning both sides into ordinary integrals:
∫y21dy=∫2xdx
Along a solution curve, the steps dy and dx have different sizes that change from point to point, but y21dy and 2xdx stay equal everywhere.
Along a solution curve, the raw x and y steps change size at different rates, but scaling each one makes every tiny step match and keeps their running totals equal the whole way.
2
Integrating both sides and handling +C
Now that the left side only has y and the right side only has x, we can integrate each side on its own and solve for y.
Integrating Both Sides and Handling +C
∫y21dyy=∫2xdx=?
Text solution
Divide by y2 and multiply by dxMoving y2 to the left and dx to the right gives a standard power-rule integral on each side.
y21dy∫y−2dy=2xdx=∫2xdx
Integrate both sides with a single +C on the x-sideBoth integrals produce an unknown constant, but moving the constant from the left over to the right just combines them into one unknown constant, so we write a single +C on the right as soon as we integrate.
−y1=x2+C
Multiply by −1 and flip the entire right side togetherSince +C is already part of the equation, multiplying by −1 gives −C, a new constant that we still call C, and taking the reciprocal flips the entire right side C−x2 into one denominator rather than flipping x2 alone.
y1y1y=−x2−C=C−x2=C−x21
3
Particular solutions and the interval of validity
To find the one curve in the family y=C−x21 that passes through a given starting point, we use an initial condition:
dxdy=2x⋅y2,y(0)=1
Once we find the formula for that curve, we also have to check how far it can go to the left and right of x=0 before hitting a break.
Particular Solutions and the Interval of Validity
yy(0)y=C−x21=1=?x∈?
Text solution
Plug in x=0 and y=1 to find CPlugging the starting point (0,1) into our family of solutions gives C=1.
1Cy=C−021=1=1−x21
Keep the single unbroken branch containing x=0The denominator 1−x2 becomes zero at x=−1 and x=1, creating two vertical asymptotes that split the graph into three separate pieces, and our starting point x=0 sits on the middle piece between them.
Interval of validity: (−1,1)
For y=C−x21 with C positive, the vertical asymptotes at x=−C and x=C split the graph into three branches, and the starting point (x0,y0) picks which branch is our solution.
Vertical asymptotes split this curve into three separate branches, and only the single unbroken branch through your starting point is a valid solution.
4
Recognizing when an equation is separable
Before trying to separate every differential equation, compare what happens when x and y are added together, like in dxdy=x+y, versus when they are multiplied together.
When an Equation Is Separable
dxdydxdy=x+y=xy+3x
separable?
Division only separates the variables when the right side is an x-part times or divided by a y-part. When you see addition or subtraction, check if you can factor the right side into a product first:
dxdy=xy+3x=stuff with xx⋅stuff with y(y+3)
Once factored, dividing both sides by y+3 and multiplying by dx separates the equation cleanly into y+31dy=xdx.
5
Natural logs and the constant multiplier A
Now let's solve that factored equation with an initial condition:
dxdy=x(y+3),y(0)=1
Here, integrating y+31dy gives a natural log, which puts +C up in the exponent when we take e to the power of both sides. To bring +C down out of the exponent, we use the exponent rule in reverse:
ea+b=ea⋅eb
Natural Logs and the Constant Multiplier A
∫y+31dyy(0)y=∫xdx=1=?
Text solution
Integrate both sides to get a natural logIntegrating y+31 with respect to y gives ln∣y+3∣ on the left side.
∫y+31dyln∣y+3∣=∫xdx=21x2+C
Take e to the power of both sides and split the exponentTaking e to the power of both sides cancels the natural log, and splitting e21x2+C turns the added +C in the exponent into a multiplied constant eC.
∣y+3∣∣y+3∣=e21x2+C=e21x2⋅eC
Drop the absolute value bars and rename ±eC as ARemoving the absolute value bars puts a ± sign in front, and replacing the entire constant ±eC with a single letter A gives the family of solutions solved for y.
y+3y+3y=A±eC⋅e21x2=Ae21x2=Ae21x2−3
6
Constant solutions lost when dividing by zero
Before we plug in y(0)=1, look back at the first algebra step where we divided by y+3: dividing assumes y+3=0, which can leave out a flat horizontal line that solves the equation.
Constant Solutions Lost When Dividing by Zero
dxdyy=x(y+3)=Ae21x2−3
y=−3?
Text solution
Check the flat line where the term you divided by is zeroSetting y+3=0 gives the horizontal line y=−3, which satisfies dxdy=x(y+3) with 0=0 and is included in y=Ae21x2−3 when we allow A=0. (By contrast, in dxdy=2x⋅y2, dividing by y2 loses the flat line y=0, which must be listed separately because C−x21 can never equal 0.)
A=0⟹y=0⋅e21x2−3=−3
Plug in x=0 and y=1 to find APlugging in the starting point (0,1) gives A=4, and because e21x2 is defined for all x, the solution is valid on the entire real line.
11Ay=Ae21⋅02−3=A−3=4=4e21x2−3on (−∞,∞)
In y=Ae21x2−3, setting A=0 gives the flat line y=−3 right back, whereas in y=C−x21,C grows toward infinity as the curve approaches y=0 without the formula ever reaching y=0.
As a curve flattens onto the equilibrium line, one general solution catches it with a zero constant while the other misses it completely.
7
Choosing a square-root branch and open endpoints
Now consider an initial value problem where y starts in the denominator on the right:
dxdy=−yx,y(0)=−3
Multiplying by y gives an integral that produces y2, so solving for y requires taking a square root and picking between the positive and negative branches.
Choosing a Square-Root Branch and Open Endpoints
Text solution
Multiply by y and dx and integrate both sidesIntegrating both sides gives 21y2 on the left, and multiplying both sides by 2 gives 2C, a new constant that we still call C.
∫ydy21y2y2y2=∫−xdx=−21x2+C=−x2+2C=C−x2
Use the negative initial value y(0)=−3 to choose the minus branchTaking the square root gives y=±C−x2, and since y(0)=−3 is negative while x is never negative, our curve must be the negative branch.
y−33y=−C−x2=−C−02=C⟹C=9=−9−x2
Leave the endpoints open where dxdy=−yx divides by zeroThe square root 9−x2 is defined on [−3,3], but at the endpoints x=−3 and x=3 we get y=0, which makes the original derivative dxdy=−yx divide by zero.
Interval of validity: (−3,3)
Geometrically, the circle x2+y2=C splits into the top semicircle when y0>0 and the bottom semicircle when y0<0, stopping short of the x-axis points (−C,0) and (C,0) where the tangent line goes vertical.
Every starting point picks only one half of its circle, above or below the x-axis, and stops at the open endpoints where the slope is vertical.
8
Implicit solutions when you can't solve for y
Finally, we want to solve an initial value problem where integrating the y-side produces two different kinds of y terms:
dxdy=2y+cos(y)3x2,y(2)=0
Implicit Solutions When You Can't Isolate y
dxdyy(2)y=2y+cos(y)3x2=0=?
Text solution
Multiply by 2y+cos(y) and dx and integrateMoving the entire denominator 2y+cos(y) to the left side with dy gives a straightforward integral on each side.
∫(2y+cosy)dyy2+sin(y)=∫3x2dx=x3+C
Plug (2,0) straight into the implicit equationBecause no algebra can get y by itself from y2+sin(y), we plug x=2 and y=0 directly into the equation to find C and leave the equation in that form.
Even on problems where you can solve for y, plugging your initial point (x0,y0) in right after integrating is often the fastest way to find C before doing the rest of the algebra.
9
Putting the whole method together
Every separable equation follows the same steps from separating the tiny steps dy and dx to checking where the solution curve is valid.
The Complete Flow for Separable Equations
Key concepts
Check if the right side factors into a product before separating
You can only separate variables when dxdy=(stuff with x)⋅(stuff with y). An equation like dxdy=xy+3x factors into x(y+3) and separates to y+31dy=xdx, whereas dxdy=x+y cannot be factored into a product, so separation of variables won't work on sums that don't factor.
Keep +C inside the algebra from the moment you integrate, and check what you divided by
Write a single +C on the x-side as soon as you integrate, and check whether setting the y-term you divided by equal to zero gives a flat-line solution:
Reciprocal of y:−y1=x2+C flips the whole right side together to give y=C−x21, and because C−x21 can never equal 0, the flat line y=0 lost when dividing by y2 must be listed separately.
Natural log of y:ln∣y+3∣=21x2+C turns into y=Ae21x2−3 with A=±eC, and allowing A=0 includes the flat line y=−3.
Square of y:y2=C−x2 splits into y=±C−x2, where the sign of y(x0) picks the branch.
Different y terms: When you cannot solve for y, as in y2+sin(y)=x3+C, plug in (x0,y0) right away and leave the implicit equation.
Cut the interval of validity at asymptotes and vertical tangents
Keep only the single open interval containing x0 where both the formula for y and the original derivative dxdy are defined, stopping at vertical asymptotes like x=±1 in y=1−x21 and leaving out endpoints like x=±3 in y=−9−x2 where y=0 makes dxdy=−yx divide by zero.
10
Practice
1
Determine which of the following differential equations are separable, and rewrite each separable equation with all y terms with dy and all x terms with dx: (a) dxdy=x−3y, (b) dxdy=xy−3x.
Check whether the two terms on the right share a common factor that turns the subtraction into a part with x times a part with y.
In (a), dxdy=x−3y has no common factor to pull out.
Watch out: A common mistake is dividing by y to write y1dy=(yx−3)dx or moving 3ydx to the left as dy+3ydx=xdx, neither of which separates the variables because x and y are still mixed together on one side.
In (b), both terms on the right share a factor of x:
dxdyy−31dy=x(y−3)=xdx
Watch out: Don't divide only the first term by y to get y1dy=(x−3x)dx; you have to factor x(y−3) first and divide the entire right side by y−3.
Answer: (a) Not separable, because x−3y cannot be factored into a product of an x-part and a y-part. (b) Separable: factoring gives dxdy=x(y−3), which separates to y−31dy=xdx (for y=3).
2
Solve the initial value problem dxdy=2x(y+2),y(0)=1, and state the interval of validity.
Divide by y+2 to get a natural log on the left, then rewrite ex2+C using a constant multiplier A in front of ex2.
Separate the variables and integrate both sides:
∫y+21dyln∣y+2∣y+2y=∫2xdx=x2+C=Aex2=Aex2−2
Watch out: A common mistake is adding +C onto the end after taking e to the power of both sides to write y+2=ex2+C, which gives C=2 and the wrong answer y=ex2. Because +C starts inside the exponent ex2+C, it becomes a front multiplier A.
Now plug in x=0 and y=1:
1A=Ae02−2=3
Since ex2 is defined for all x, the solution is defined everywhere.
Answer:y=3ex2−2 on (−∞,∞).
3
Solve the initial value problem dxdy=3y2+cos(y)2x,y(1)=0.
Multiply both sides by 3y2+cos(y) and integrate; check whether you can get y by itself before trying to solve for it.
Separate the variables and integrate each side:
∫(3y2+cos(y))dyy3+sin(y)=∫2xdx=x2+C
Because y is in both y3 and sin(y), we cannot solve for y, so we plug x=1 and y=0 straight into the implicit equation:
03+sin(0)0C=12+C=1+C=−1
Watch out: Don't see y(1)=0 and automatically assume C=0 (which gives the wrong answer y3+sin(y)=x2); the right side is plugged in at x=1, not x=0.
Answer:y3+sin(y)=x2−1.
4
Solve the initial value problem dxdy=2x⋅y2,y(0)=41, and state the interval of validity.
Integrate y−2dy=2xdx, flip the entire right side together with +C, and find where the denominator equals zero around x=0.
Separate variables and integrate:
∫y−2dy−y1y1y=∫2xdx=x2+C=C−x2=C−x21
Watch out: Flipping x2 by itself and leaving +C outside gives the wrong formula y=−x21+C. The entire right side C−x2 flips together into the denominator.
Plug in x=0 and y=41:
41y=C−021⟹C=4=4−x21
The denominator 4−x2 is zero at x=−2 and x=2, so the single branch containing x=0 runs between −2 and 2.
Answer:y=4−x21 on (−2,2).
5
Solve the initial value problem dxdy=−yx,y(0)=−4, and state the interval of validity.
After integrating to y2=C−x2, use the sign of y(0)=−4 to pick the square-root branch, and check the original derivative dxdy=−yx at the endpoints where y=0.
Separate variables and integrate:
∫ydy21y2y2y=∫−xdx=−21x2+C=C−x2=±C−x2
Since y(0)=−4 is negative, we choose the negative branch and plug in (0,−4):
−4y=−C−02⟹C=16=−16−x2
Watch out: Two common mistakes here are keeping the positive root y=16−x2 (which gives y(0)=4 instead of −4) or writing the closed interval [−4,4] because 16−x2 is defined at x=±4. At x=±4,y=0, which makes dxdy=−yx divide by zero, so the endpoints must be left open.
Answer:y=−16−x2 on (−4,4).
6
Find all solutions to the differential equation dxdy=3x2⋅y2, including any constant solutions lost when separating variables.
After dividing by y2 and integrating to find the family of curves, check what happens in the original equation when the term you divided by, y2, equals zero.
Assuming y=0, divide by y2 and integrate:
∫y−2dy−y1y=∫3x2dx=x3+C=C−x31
Now check the value left out when we divided by y2: setting y2=0 gives the flat line y=0, which satisfies dxdy=3x2⋅y2 with 0=0.
Watch out: Stopping at y=C−x31 misses y=0 completely, because no number plugged in for C can ever make C−x31 equal zero.