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 dy/dx=g(x)h(y), and it is solved by separation of variables. Divide by h(y), put dx 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.
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 3e≈8.155. Its derivative, 6xex2, gives a slope of 6e≈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, dy/dx=2xy. 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.
dxdy=2xy,y(0)=3
The curve y=3ex2 against the rule dy/dx=2xy
x
Height, 3ex2
Slope from the derivative, 6xex2
Slope the rule asks for, 2xy
0
3
0
2(0)(3)=0
0.5
3.852
3.852
2(0.5)(3.852)=3.852
1
8.155
16.310
2(1)(8.155)=16.310
1.5
28.463
85.390
2(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=Aex2for anyAy=3ex2when y(0)=3
y=Aex2for anyAy=3ex2when 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,dy/dx=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 dx 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.
dxdy=g(x)h(y)⟹∫h(y)dy=∫g(x)dx
dxdy=g(x)h(y)⟹∫h(y)dy=∫g(x)dx
Finding g(x) and h(y)
Equation
Separable?
g(x)
h(y)
dy/dx=2xy
Yes
2x
y
dy/dx=y2
Yes
1
y2
dy/dx=x/y2
Yes
x
1/y2
dy/dx=xy+x
Yes, after factoring it as x(y+1)
x
y+1
dy/dx=ex+y
Yes, because ex+y=ex⋅ey
ex
ey
dy/dx=x+y
No, a sum of x and y does not factor
dy/dx=x2−y2
No, it factors only as (x−y)(x+y)
Why it works
Why separating works
Writing dy/y=2xdx looks like splitting the derivative dy/dx as if it were a fraction. It is shorthand for a substitution, and it can be justified without the shortcut.
Suppose y(x) solves dy/dx=g(x)h(y). Divide both sides by h(y) to get (1/h(y))⋅dy/dx=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 dy/dx is its derivative. Substitution with u=y turns that integral into ∫dy/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.
∫h(y)1dxdydx=∫h(y)dy
The method
The method in six steps
The steps are the same for every separable equation. The table follows them on dy/dx=2xy 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.
ydy=2xdx⟹ ln∣y∣=x2+C⟹ y=Aex2
ydy=2xdxln∣y∣=x2+Cy=Aex2
Separation of variables on dy/dx=2xy with y(0)=3
Step
What to do
For dy/dx=2xy
1
Factor the right side as g(x)h(y)
g(x)=2x and h(y)=y
2
Find where h(y)=0. Each such constant is an equilibrium solution
y=0 solves it, since 0=2x⋅0
3
Separate, with every y beside dy and every x beside dx
dy/y=2xdx
4
Integrate both sides and add one constant
ln∣y∣=x2+C
5
Solve for y
y=Aex2, where A can be any number
6
Use the initial condition to find the constant
y(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 dy/dt=ky, where k is a constant rate. Separating gives dy/y=kdt, then ln∣y∣=kt+C, then y=Aekt. 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.
dtdy=ky⟹y=y0ekt
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, dT/dt=−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∣=−kt+C, and raising e to both sides gives T−Ts=Ae−kt. 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−kt
Where it breaks
Where it breaks
Separation needs the right side to factor. dy/dx=x+y does not, since no rearrangement leaves y only as a factor beside dy/dx. Moving y to the left gives dy/dx−y=x, a sum rather than a product. Equations like this need other methods, met in a course on differential equations. Writing dy/y=xdx for it is a false step, and Chalk marks that row ✗.
Dividing by h(y) can lose solutions. For dy/dx=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. dy/dx=y2 with y(0)=1 has the solution y=1/(1−x), which grows without bound as xapproaches 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 dy/dx=−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 dy/dx=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.
dxdy=y2, y(0)=1⟹y=1−x1, x<1
dxdy=y2, y(0)=1⟹y=1−x1, 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 6xex2, and 2xy=2x⋅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, dy/y=2xdx, 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 dT/dt=−k(T−20), is read too. The row dT/(T−20)=−kdt reads ✓ and dT/(T−20)=kdt reads ✗. The rows that solve for T read ✓, and Aekt in place of Ae−kt reads ✗. A row such as 50e−0.2t=10, which sets the solution equal to a value, reads • “New condition: A(t) = 10.” The rows after it read ✓.
dy/dx=x+y cannot be separated. Can dy/dx=xy+x?
Yes. The right side factors as x(y+1), a function of x times a function of y. Then dy/(y+1)=xdx, 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 dy/dx=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. dy/dx=3y2/3 with y(0)=0 fails the condition at y=0, and both y=0 and y=x3 solve it.
The logistic equation dP/dt=kP(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−kt).
An equation such as dy/dx+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.
dtdP=kP(1−MP)⟹P=1+Be−ktM
dtdP=kP(1−MP)⟹P=1+Be−ktM
Common mistakes
Integrating before the variables are separated. Writing dy=xydx and integrating the right side as if y were a constant gives nonsense, because y depends on x. Divide by y first, so that dy/y=xdx 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 dy/dx=2xy.
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 dy/dx=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 dy/dt=ky. 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 dy/dx=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:dT/dt=−k(T−Ts) with k>0. Starting from temperature T0, the solution is T=Ts+(T0−Ts)e−kt, so T approaches Ts exponentially.
Work through an example
Solve dy/dx=2xy with the initial condition y(0)=3.