Not every first-order equation separates neatly. Two common types that do not can still be cracked with a standard trick each. Homogeneous equations give way to the substitution y=vx, and linear equations give way to an integrating factor. We will practise both and then finish with a mixed set.
dxdy=F(xy), so the right side depends only on xy (put another way, it is a ratio of homogeneous functions of the same degree). The trick is to put y=vx, so that dxdy=v+xdxdv. After that, the variables separate on their own.
Example 1.dxdy=xx+y. Substituting, v+xv′=1+v, so xv′=1, v=log∣x∣+C: y=xlog∣x∣+Cx.
Example 2.dxdy=2xyx2+y2. Here v+xv′=2v1+v2, so xv′=2v1−v2; ∫1−v22vdv=∫xdx gives −log∣1−v2∣=log∣x∣+c, i.e. x2−y2=Cx.
dxdy+P(x)y=Q(x). Multiply through by the integrating factorIF=e∫Pdx. Like magic, the left side becomes dxd(y⋅IF):
y⋅IF=∫Q⋅IFdx+C.
Example 3.dxdy+2y=ex. Here IF =e2x, so ye2x=∫e3xdx=3e3x+C; y=3ex+Ce−2x.
Example 4.xdxdy+y=x3, i.e. y′+xy=x2. Here IF =x, and xy=4x4+C.
Example 5.dxdy+ytanx=secx with y(0)=1. Here IF =secx, so ysecx=∫sec2xdx=tanx+C. The condition gives C=1, and so y=sinx+cosx.
Example 6. A tank holds 100 L of brine with 20 kg of salt. Fresh water flows in at 5 L/min and the mixture flows out at the same rate. If S is the salt present, it leaves at a rate proportional to the concentration, so dtdS=−1005S, which gives S=20e−t/20. After 20 minutes about 7.36 kg remains.
The salt in the tank decays exponentially: about 7.36 kg is left after 20 minutes.