Chalk−1

Math · Calculus II · Concept

Separable differential equations

A differential equation relates a function to its derivatives, and solving it means finding the function. A first-order equation is separable when it can be written d⁢y⁢/⁢d⁢x=g⁡(x)⁢h⁢(y), and it is solved by separation of variables. Divide by h⁢(y), put d⁢x on the other side, and integrate each side with respect to its own variable. The result, with one constant of integration, is the general solution. An initial condition such as y⁢(0)=3 picks out one particular solution.

Try one — Chalk checks each line

A concrete case

A rule for the slope

A curve passes through the point (0,3), and at every point its slope is 2 times x times its height. At (0,3) the slope is 2⋅0⋅3=0. Wherever the curve goes, the rule says how steep it must be there.

The curve y=3ex2 obeys that rule. At x=1 its height is 3⁢e≈8.155. Its derivative, 6⁢xex2, gives a slope of 6⁢e≈16.310 there, and the rule asks for 2⋅1⋅8.155=16.310. The table checks two more points, and they agree as well.

The rule is a differential equation, d⁢y⁢/⁢d⁢x=2⁢x⁢y. It does not say what y is. It says how y changes, and the job is to find the function that changes that way. The method on this page finds y=3ex2 from the rule and the starting point alone.

d⁢yd⁢x=2⁢x⁢y,y⁢(0)=3
The curve y =3ex2 against the rule d⁢y⁢/⁢d⁢x =2⁢x⁢y
xHeight, 3ex2Slope from the derivative, 6⁢xex2Slope the rule asks for, 2⁢x⁢y
0302⁢(0)⁢(3) =0
0.53.8523.8522⁢(0.5)⁢(3.852) =3.852
18.15516.3102⁢(1)⁢(8.155) =16.310
1.528.46385.3902⁢(1.5)⁢(28.463) =85.390

The rule

Differential equations and their solutions

A differential equation is an equation that contains the derivative of an unknown function. A solution is a function that makes the equation true at every x in an interval. Most equations have a whole family of solutions, one for each value of a constant. The family is called the general solution.

An initial condition, such as y⁢(0)=3, names one point the solution must pass through. An equation together with an initial condition is an initial value problem. The condition picks one member of the family, called the particular solution.

y=Aex2 for any ⁢Ay=3ex2 when ⁢y⁢(0)=3
y=Aex2 for any ⁢Ay=3ex2 when ⁢y⁢(0)=3

Separable equations

A first-order equation is separable when its right side is a function of x times a function of y, d⁢y⁢/⁢d⁢x=g⁡(x)⁢h⁢(y). The x-part, g⁡(x), contains no y. The y-part, h⁢(y), contains no x.

A separable equation is solved by separation of variables. Wherever h⁢(y)≠0, divide by h⁢(y), put d⁢x on the right, and integrate each side with respect to its own variable. The table shows how to find the two factors, and two equations that do not split.

d⁢yd⁢x=g⁡(x)h⁢(y)⟹∫d⁢yh⁢(y)=∫g⁡(x)d⁢x
d⁢yd⁢x=g⁡(x)h⁢(y)⟹∫d⁢yh⁢(y)=∫g⁡(x)d⁢x
Finding g⁡(x) and h⁢(y)
EquationSeparable?g⁡(x)h⁢(y)
d⁢y⁢/⁢d⁢x =2⁢x⁢yYes2⁢xy
d⁢y⁢/⁢d⁢x =y2Yes1y2
d⁢y⁢/⁢d⁢x =x⁢/y2Yesx1⁢/y2
d⁢y⁢/⁢d⁢x =x⁢y+xYes, after factoring it as x⁢(y+1)xy+1
d⁢y⁢/⁢d⁢x =ex+yYes, because ex+y =ex⋅eyexey
d⁢y⁢/⁢d⁢x =x+yNo, a sum of x and y does not factor
d⁢y⁢/⁢d⁢x =x2−y2No, it factors only as (x−y)⁢(x+y)

Why it works

Why separating works

Writing d⁢y⁢/⁢y=2⁢x d⁢x looks like splitting the derivative d⁢y⁢/⁢d⁢x as if it were a fraction. It is shorthand for a substitution, and it can be justified without the shortcut.

Suppose y⁢(x) solves d⁢y⁢/⁢d⁢x=g⁡(x)⁢h⁢(y). Divide both sides by h⁢(y) to get (1⁢/⁢h⁢(y))⋅d⁢y⁢/⁢d⁢x=g⁡(x). Both sides are functions of x that are equal at every x, so their antiderivatives with respect to x differ only by a constant. On the left, y is a function of x and d⁢y⁢/⁢d⁢x is its derivative. Substitution with u=y turns that integral into ∫d⁢y⁢/⁢h⁢(y), the integral the shortcut writes.

One constant is enough. Each indefinite integral already stands for a whole family of functions. Writing C1 on the left and C2 on the right gives ln∣⁢y⁢∣=x2+(C2−C1), and C2−C1 is still a single constant.

∫1h⁢(y)d⁢yd⁢xd⁢x=∫d⁢yh⁢(y)

The method

The method in six steps

The steps are the same for every separable equation. The table follows them on d⁢y⁢/⁢d⁢x=2⁢x⁢y with y⁢(0)=3, the equation from the concrete case.

Step 2 comes before any division. Dividing by h⁢(y) is only allowed where h⁢(y)≠0, so find those values first and keep them as solutions of their own. After step 6, differentiate your answer and put it back into the equation, as the check further down shows.

d⁢yy=2⁢xd⁢x ⟹ ln∣⁢y⁢∣=x2+C ⟹ y=Aex2
d⁢yy=2⁢xd⁢xln∣⁢y⁢∣=x2+Cy=Aex2
Separation of variables on d⁢y⁢/⁢d⁢x =2⁢x⁢y with y⁢(0)=3
StepWhat to doFor d⁢y⁢/⁢d⁢x =2⁢x⁢y
1Factor the right side as g⁡(x)⁢h⁢(y)g⁡(x) =2⁢x and h⁢(y)=y
2Find where h⁢(y)=0. Each such constant is an equilibrium solutiony=0 solves it, since 0 =2⁢x⋅0
3Separate, with every y beside d⁢y and every x beside d⁢xd⁢y⁢/⁢y =2⁢x d⁢x
4Integrate both sides and add one constantln∣⁢y⁢∣ =x2+C
5Solve for yy =Aex2, where A can be any number
6Use the initial condition to find the constanty⁢(0) =A =3, so y =3ex2

When the integral is a logarithm

Many separable equations integrate to ln∣⁢y⁢∣ on the left. Raising e to both sides of ln∣⁢y⁢∣=x2+C gives ∣⁢y⁢∣=eC⋅ex2. The number eC is positive, and removing the absolute value allows either sign. The result is y=Aex2 with A=±eC. The equilibrium y=0 is the case A=0, so one formula with any constant A covers every solution.

The same steps solve the growth equation d⁢y⁢/⁢d⁢t=k⁢y, where k is a constant rate. Separating gives d⁢y⁢/⁢y=k d⁢t, then ln∣⁢y⁢∣=k⁢t+C, then y=Aek⁢t. At t=0 the solution equals A, so A is the starting value y0. This is the exponential model, growth when k>0 and decay when k<0.

d⁢yd⁢t=k⁢y⟹y=y0ek⁢t

Cooling toward the room’s temperature

Newton’s law of cooling says an object’s temperature T changes at a rate proportional to its difference from the surroundings’ temperature Ts. In symbols, d⁢T⁢/⁢d⁢t=−k⁢(T−Ts), with a positive constant k. The minus sign makes a hot object cool and a cold one warm.

The y-part is T−Ts, so divide by it. Integrating gives ln∣⁢T−Ts∣=−k⁢t+C, and raising e to both sides gives T−Ts=Ae−k⁢t. The difference from the surroundings decays exponentially, and the temperature levels off at Ts, the equilibrium. Starting at T0 gives A=T0−Ts.

T=Ts+(T0−Ts)e−k⁢t

Where it breaks

Where it breaks

Separation needs the right side to factor. d⁢y⁢/⁢d⁢x=x+y does not, since no rearrangement leaves y only as a factor beside d⁢y⁢/⁢d⁢x. Moving y to the left gives d⁢y⁢/⁢d⁢x−y=x, a sum rather than a product. Equations like this need other methods, met in a course on differential equations. Writing d⁢y⁢/⁢y=x d⁢x for it is a false step, and Chalk marks that row ✗.

Dividing by h⁢(y) can lose solutions. For d⁢y⁢/⁢d⁢x=y2, the constant y=0 is a solution, because its derivative 0 equals 02. The separated form gives −1⁢/⁢y=x+C, which no value of C turns into y=0. Find the zeros of h⁢(y) before dividing and list them with the answer.

A solution can stop where y runs off to infinity, even when the equation looks harmless. d⁢y⁢/⁢d⁢x=y2 with y⁢(0)=1 has the solution y=1⁢/⁢(1−x), which grows without bound as x approaches 1. The solution of that initial value problem exists only on the interval x<1, the one that contains the starting point. The example “Find an implicit solution of d⁢y⁢/⁢d⁢x=−x⁢/⁢y”, linked below, stops at x=±4 for a different reason. Its solution is a circle, and the slope −x⁢/⁢y divides by y.

Sometimes the integrated equation cannot be solved for y at all. For d⁢y⁢/⁢d⁢x=y⁢/⁢(y+1), separating and integrating gives ln∣⁢y⁢∣+y=x+C. That relation is a correct implicit solution, and no formula y=… built from familiar functions solves it.

d⁢yd⁢x=y2, y⁢(0)=1⟹y=11−x, x<1
d⁢yd⁢x=y2, y⁢(0)=1⟹y=11−x, x<1

Check your answer

Check your answer

A differential equation states its own test: a solution must satisfy it, start where the condition says and behave as the model says.

Differentiate and substitute. A solution must make the equation true. For y=3ex2 the derivative is 6⁢xex2, and 2⁢x⁢y=2⁢x⋅3ex2 is the same, so the equation holds for every x.

Check the starting point. Put the initial x into your answer and make sure it returns the initial value. Here y⁢(0)=3e0=3.

Check the behavior. A growth equation should give a growing solution, a cooling curve should level off at the room’s temperature, and the equilibria from step 2 should appear among your solutions.

To have Chalk check the work, write it in a Math box. Put the equation on the first row and the initial condition on its own row below it. Then give each step a row, from the separated form and the integrated form with C to the solution with its constant and the particular solution. Below the separated row, d⁢y⁢/⁢y=2⁢x d⁢x, or straight under the equation and its initial condition, the Checker reads each solution against the equation. With neither above it, a wrong y=… can read only “• Defines y(x).”, a dot that is not a check, so keep the separated row. A row that solves the equation but misses the starting point reads ✗ and says it “doesn’t fit” the condition. A row that fails the equation reads ✗, with the message “Doesn’t solve the differential equation in row 1: differentiate it to check.”

A ? beside a row of this method is Chalk’s limit, not a mistake in the work. A separation that keeps a letter for the rate, such as d⁢T⁢/⁢d⁢t=−k⁢(T−20), is read too. The row d⁢T⁢/⁢(T−20)=−k d⁢t reads ✓ and d⁢T⁢/⁢(T−20)=k d⁢t reads ✗. The rows that solve for T read ✓, and Aek⁢t in place of Ae−k⁢t reads ✗. A row such as 50e−0.2⁢t=10, which sets the solution equal to a value, reads • “New condition: A(t) = 10.” The rows after it read ✓.

d⁢y⁢/⁢d⁢x=x+y cannot be separated. Can d⁢y⁢/⁢d⁢x=x⁢y+x?

Yes. The right side factors as x⁢(y+1), a function of x times a function of y. Then d⁢y⁢/⁢(y+1)=x d⁢x, so ln∣⁢y+1⁢∣=x2/2+C and y=−1+Aex2/2. The test is whether the right side factors, not how it looks at first. x+y is a sum that no factoring turns into a product.

One solution through each point, and what comes next

Why does one initial condition pick exactly one solution? For d⁢y⁢/⁢d⁢x=f⁡(x,y), suppose f and its rate of change in y are continuous near the starting point. The Picard–Lindelöf theorem then guarantees exactly one solution through that point, at least on a short interval. d⁢y⁢/⁢d⁢x=3y2⁢/3 with y⁢(0)=0 fails the condition at y=0, and both y=0 and y=x3 solve it.

The logistic equation d⁢P⁢/⁢d⁢t=k⁢P⁢(1−P⁢/⁢M) models growth that slows as a population P nears a limit M. It is separable, and partial fractions split M⁢/⁢(P⁢(M−P)) into 1⁢/⁢P+1⁢/⁢(M−P). Its solution is the S-shaped curve P=M⁢/⁢(1+Be−k⁢t).

An equation such as d⁢y⁢/⁢d⁢x+y=x is linear but not separable. Multiplying it by ex turns its left side into the derivative of the product exy, which can then be integrated. That integrating factor, and systems of equations, begin a course on differential equations.

d⁢Pd⁢t=k⁢P(1−PM)⟹P=M1+Be−k⁢t
d⁢Pd⁢t=k⁢P(1−PM)⟹P=M1+Be−k⁢t

Common mistakes

  • Integrating before the variables are separated. Writing d⁢y=x⁢y d⁢x and integrating the right side as if y were a constant gives nonsense, because y depends on x. Divide by y first, so that d⁢y⁢/⁢y=x d⁢x holds one variable on each side.
  • Keeping a constant on each side. ln∣⁢y⁢∣+C1=x2+C2 is the same as ln∣⁢y⁢∣=x2+C with C=C2−C1, because the two constants combine into one.
  • Adding the constant after raising e to both sides, as y=ex2+C. The constant belongs to ln∣⁢y⁢∣=x2+C, and raising e turns it into a factor, y=Aex2. The function ex2+C does not solve d⁢y⁢/⁢d⁢x=2⁢x⁢y.
  • Dropping the absolute value in ln∣⁢y⁢∣ and keeping only positive A. A solution through a negative starting value, such as y⁢(0)=−2, is then missed. Removing the absolute value makes A=±eC, which can take either sign.
  • Losing an equilibrium by dividing by h⁢(y). For d⁢y⁢/⁢d⁢x=y2 the constant y=0 is a solution, and −1⁢/⁢y=x+C never produces it. Find where h⁢(y)=0 before dividing and keep those constants.

Key terms

Differential equation
An equation involving an unknown function and its derivatives, such as d⁢y⁢/⁢d⁢t=k⁢y. An initial value, such as y⁢(0)=5, picks out one particular solution.
Separable differential equation
A first-order differential equation that can be written d⁢y⁢/⁢d⁢x=g⁡(x)⁢h⁢(y), a function of x times a function of y. Moving every y to one side and every x to the other, then integrating both sides, solves it.
Initial-value problem
A differential equation together with a condition that picks out one solution, such as f′(x)=3x2+2 with f⁡(1)=5. For an antiderivative, the condition determines the constant C.
Constant of integration
The +C added to an antiderivative, because the derivative of any constant is 0. On a domain split into separate pieces, each piece can have its own constant.
Natural logarithm
The logarithm with base e, written lnx. It undoes ex: ln(ex)=x for every x, and elnx=x for x>0.
Newton’s law of cooling
A model in which an object’s temperature T changes at a rate proportional to its difference from the surrounding temperature Ts: d⁢T⁢/⁢d⁢t=−k⁢(T−Ts) with k>0. Starting from temperature T0, the solution is T=Ts+(T0−Ts)e−k⁢t, so T approaches Ts exponentially.

Work through an example

Solve d⁢y⁢/⁢d⁢x=2⁢x⁢y with the initial condition y⁢(0)=3.

Solve a separable differential equation →

Solve Newton’s law of cooling →

Find an implicit solution of d⁢y⁢/⁢d⁢x=−x⁢/⁢y →

Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Solve it step by step in Math Check the derivative in Math Graph the solution Follow the solution in Slope Fields and Euler’s Method Study the 6 key terms Open worked example on a board Integral of 1⁢/⁢x in Math Reference

Your existing work stays on this device. Examples open as editable copies.