Separation of Variables Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Separation of Variables.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

A method for solving first-order DEs of the form dydx=f(x)β‹…g(y)\frac{dy}{dx} = f(x) \cdot g(y): rearrange to dyg(y)=f(x) dx\frac{dy}{g(y)} = f(x)\,dx, then integrate both sides.

If the rate of change factors into a piece that depends only on xx and a piece that depends only on yy, you can sort them onto opposite sides of the equationβ€”all the yy-stuff on the left, all the xx-stuff on the rightβ€”then integrate each side in its own variable.

Read the full concept explanation β†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: If dydx\frac{dy}{dx} factors into an xx-part times a yy-part, separate them onto opposite sides and integrate each.

Common stuck point: The procedure for separation of variables is the easy part; the trap is trying to separate a non-product right side. Asking "Can I rewrite the DE so one side has only yy and dydy, the other only xx and dxdx?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Can I rewrite the DE so one side has only yy and dydy, the other only xx and dxdx?

Worked Examples

Example 1

easy
Solve dy/dx=xydy/dx = xy with y(0)=2y(0)=2.

Answer

y=2ex2/2y = 2e^{x^2/2}

First step

1
Separate: dy/y=x dxdy/y = x\,dx. Integrate: ln⁑∣y∣=x2/2+C\ln|y| = x^2/2+C.

Full solution

  1. 2
    y=Aex2/2y = Ae^{x^2/2}. y(0)=2β‡’A=2y(0)=2 \Rightarrow A=2.
  2. 3
    Solution: y=2ex2/2y = 2e^{x^2/2}.
Separate, integrate both sides, exponentiate, apply IC.

Example 2

hard
Solve the logistic DE dy/dt=y(1βˆ’y)dy/dt = y(1-y) with y(0)=1/2y(0) = 1/2.

Example 3

easy
Solve dydx=2x\frac{dy}{dx} = 2x with y(0)=5y(0)=5.

Example 4

medium
A radioactive substance decays with dNdt=βˆ’Ξ»N\frac{dN}{dt}=-\lambda N. Solve for N(t)N(t) given N(0)=N0N(0)=N_0.

Example 5

hard
A tank initially holds 5050 L of pure water. Brine with 0.20.2 kg/L of salt flows in at 22 L/min, and the well-mixed solution flows out at the same rate. Let S(t)S(t) be salt amount; derive and solve the ODE.

Example 6

challenge
A skydiver's velocity satisfies dvdt=gβˆ’kv\frac{dv}{dt}=g - kv with v(0)=0v(0)=0, g=9.8g=9.8 m/s2^2, k=0.2k=0.2 sβˆ’1^{-1}. Solve for v(t)v(t) and find the terminal velocity.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
Solve dy/dx=x/ydy/dx = x/y with y(0)=3y(0)=3.

Example 2

medium
Solve Newton's cooling: dT/dt=βˆ’0.1(Tβˆ’20)dT/dt = -0.1(T-20), T(0)=80T(0)=80.

Example 3

easy
Is dydx=xy\frac{dy}{dx}=xy separable?

Example 4

easy
Separate the variables in dydx=xy\frac{dy}{dx}=xy.

Example 5

easy
Solve dydx=y\frac{dy}{dx}=y by separation.

Example 6

easy
After separating dyy=x dx\frac{dy}{y}=x\,dx, integrate both sides.

Example 7

easy
Is dydx=x+y\frac{dy}{dx}=x+y separable?

Example 8

easy
What equilibrium solution might be lost when solving dydx=y\frac{dy}{dx}=y by dividing by yy?

Example 9

easy
Separate dydx=xy\frac{dy}{dx}=\frac{x}{y}.

Example 10

easy
Solve dydx=1y\frac{dy}{dx}=\frac{1}{y}.

Example 11

medium
Solve the IVP dydx=xy\frac{dy}{dx}=xy, y(0)=2y(0)=2.

Example 12

medium
Solve dydx=xy\frac{dy}{dx}=\frac{x}{y} with y(0)=3y(0)=3.

Example 13

medium
Solve dydx=ky\frac{dy}{dx}=ky generally by separation.

Example 14

medium
Solve dydx=cos⁑xβ‹…y\frac{dy}{dx}=\cos x\cdot y with y(0)=1y(0)=1.

Example 15

medium
Solve Newton's cooling dTdt=βˆ’k(Tβˆ’20)\frac{dT}{dt}=-k(T-20) generally.

Example 16

medium
Solve dydx=y2\frac{dy}{dx}=y^2 with y(0)=1y(0)=1.

Example 17

medium
Find the equilibrium solutions of dydx=y(2βˆ’y)\frac{dy}{dx}=y(2-y) before separating.

Example 18

medium
Solve dydx=exβˆ’y\frac{dy}{dx}=e^{x-y}.

Example 19

medium
Solve dydx=yx\frac{dy}{dx}=\frac{y}{x} for x>0x>0 by separation.

Example 20

challenge
Solve the logistic IVP dydx=y(1βˆ’y)\frac{dy}{dx}=y(1-y), y(0)=12y(0)=\frac12.

Example 21

challenge
Solve dydx=2x1+y2\frac{dy}{dx}=\frac{2x}{1+y^2} with y(0)=0y(0)=0.

Example 22

challenge
A tank's salt obeys dSdt=βˆ’S100\frac{dS}{dt}=-\frac{S}{100} with S(0)=20S(0)=20. Find S(t)S(t) and the half-life.

Example 23

easy
Is dydx=sin⁑xy\frac{dy}{dx}=\frac{\sin x}{y} separable?

Example 24

easy
Solve dydx=3\frac{dy}{dx}=3 by separation, with y(0)=2y(0)=2.

Example 25

easy
Solve dydx=βˆ’3y\frac{dy}{dx}=-3y with y(0)=10y(0)=10.

Example 26

medium
Solve dydx=2xy\frac{dy}{dx}=\frac{2x}{y} with y(0)=1y(0)=1.

Example 27

medium
Solve dydx=y2βˆ’1x\frac{dy}{dx}=\frac{y^2-1}{x} for x>0x>0, y(1)=0y(1)=0, by separation. Identify the constant.

Example 28

medium
Solve dydx=exβ‹…eβˆ’y\frac{dy}{dx}=e^{x}\cdot e^{-y} with y(0)=0y(0)=0.

Example 29

medium
Solve the IVP dydx=x+1y\frac{dy}{dx} = \frac{x+1}{y}, y(0)=2y(0)=2.

Example 30

medium
Solve dydx=y2sec⁑2x\frac{dy}{dx}=y^2 \sec^2 x with y(0)=1y(0)=1.

Example 31

medium
Find the general solution to dydx=3x2y2\frac{dy}{dx} = \frac{3x^2}{y^2}.

Example 32

medium
Solve Newton's heating: dTdt=k(100βˆ’T)\frac{dT}{dt} = k(100-T) with T(0)=20T(0)=20, k=0.05k=0.05.

Example 33

medium
Solve dydx=yx2\frac{dy}{dx} = \frac{y}{x^2} with y(1)=ey(1)=e.

Example 34

hard
Solve dydx=(1+y2) x\frac{dy}{dx} = (1+y^2)\,x with y(0)=1y(0)=1.

Example 35

hard
Solve dydx=xexy\frac{dy}{dx} = \frac{x e^{x}}{y} with y(0)=2y(0)=2.

Example 36

hard
Solve the IVP dydx=cos⁑x2y+1\frac{dy}{dx} = \frac{\cos x}{2y+1} with y(0)=0y(0)=0.

Example 37

hard
Solve dydx=x1+y2\frac{dy}{dx} = \frac{x}{1+y^2} generally.

Example 38

challenge
Solve dydx=y(1βˆ’y)x\frac{dy}{dx}=\frac{y(1-y)}{x} for x>0x>0, with y(1)=1/2y(1)=1/2.

Example 39

challenge
Solve dydx=2xyx2+1\frac{dy}{dx} = \frac{2xy}{x^2+1} generally.

Background Knowledge

These ideas may be useful before you work through the harder examples.

differential equations introintegral