Variable-separable equations
The simplest first-order differential equations have the form
dxdy=f(x)g(y).
The right side is a product of a function of x alone and a function of y alone. Whenever you can write a DE in this form, the solution method is mechanical.
The method
If g(y)=0, divide:
g(y)1dy=f(x)dx.
Now each side depends on only one variable. Integrate both sides:
∫g(y)dy=∫f(x)dx+C.
This is an implicit relation between x and y. Often you can solve for y explicitly; sometimes you leave the answer implicit.
If g(y0)=0 for some constant y0, then y=y0 is also a solution , a constant solution. Check these separately; they may or may not be part of the general family captured by the integration above.
Why does this work?
The chain rule. If y=y(x) satisfies the equation, then
dxd∫g(y)dy=g(y)1dxdy=f(x)=dxd∫f(x)dx,
so the two sides differ by at most a constant. Hence
∫g(y)dy−∫f(x)dx=C.
The single constant C absorbs both constants of integration.
Recognition
The form dxdy=f(x)g(y) may be disguised. Sometimes you must rearrange, e.g.
- dxdy=(x+3)(y2+1): directly separable.
- dxdy=ex+y: rewrite as ex⋅ey; separable.
- dxdy+xy=0: rewrite as dxdy=−xy; separable.
- (1+y2)dy=(1+x2)dx: already separated.
If you see a sum that can't be factored into f(x)g(y), the equation is not separable. Move on to other techniques.
Initial-value problems
When a condition like y(x0)=y0 is given, you solve the general implicit relation, then substitute to find C. The result is a particular solution.
Worked examples
Example 1. Solve dxdy=xy.
Separate: ydy=xdx. Integrate: ln∣y∣=ln∣x∣+C1. So ∣y∣=eC1⋅∣x∣, hence y=Cx (with C∈R absorbing the sign and the exponential). Family of lines through the origin.
Example 2. Solve dxdy=−yx.
Separate: ydy=−xdx. Integrate: 2y2=−2x2+C1, so x2+y2=C (a family of circles centred at the origin).
Example 3. Solve dxdy=(1+x2)(1+y2).
Separate: 1+y2dy=(1+x2)dx. Integrate: tan−1y=x+3x3+C.
Example 4. Solve dxdy=ex+y, y(0)=0.
Rewrite: dxdy=exey. Separate: e−ydy=exdx. Integrate: −e−y=ex+C. Apply y(0)=0: −1=1+C, so C=−2. Particular solution: −e−y=ex−2, or e−y=2−ex.
Example 5. Solve xdy−ydx=0.
Rewrite: ydy=xdx. Integrate: ln∣y∣=ln∣x∣+C1, so y=Cx.
Example 6. Newton's law of cooling: dtdT=−k(T−T0) with T(0)=T1, T0 ambient.
Separate: T−T0dT=−kdt. Integrate: ln∣T−T0∣=−kt+C1, so T−T0=Ae−kt. Apply T(0)=T1: A=T1−T0. Final: T(t)=T0+(T1−T0)e−kt.
Try it yourself
- dxdy=xy2.
- dxdy=x2y.
- (1+x)dxdy−y=0.
- dxdy=1+x21+y2.
- dxdy=ex−y.
- dxdy=sec2x⋅tany.
- (x2+1)dxdy+1=0.
- dxdy=y(1+x2)x(1+y2).
- sinxcosydx+cosxsinydy=0.
- dxdy=ex⋅y1, y(0)=2.
- Radioactive decay: dtdN=−λN, N(0)=N0.
- dxdy=ycotx.
- (1+y2)dx+(1+x2)dy=0.
- dxdy=xcosyxexlogx+ex, y(1)=0.
Pitfalls and tricks
- Factor first. Many DEs look non-separable until you factor.
- Don't forget constant solutions. If g(y0)=0, then y≡y0 may be missed by dividing.
- Logarithm absorbs constants. ln∣y∣=ln∣x∣+C becomes y=Cx , the new C has absorbed both sign and eC1.
- Apply initial conditions to the implicit form before solving explicitly. Sometimes it's cleaner.
- Watch domains. Where is g(y)=0? The solution exists only there.