Timedora

Solving Separable Differential Equations

A practical method for solving first-order separable differential equations, including constant solutions and initial-value checks.

Separate, Integrate, and Check

Recognize the separable form

A first-order differential equation is separable when it can be written as

y′=f(x)g(y).y'=f(x)g(y).

This structure lets us place the factors involving yy and the differential dydy on one side, and the factors involving xx and dxdx on the other. Integrating then relates the variables and usually produces a family of solutions.

Before dividing by anything involving yy, check whether g(y)=0g(y)=0 gives a constant solution. Such a solution could disappear if we divide by g(y)g(y). For the remaining solutions, where g(y)≠0g(y)\ne 0, separate variables:

dyg(y)=f(x) dx.\frac{dy}{g(y)}=f(x)\,dx.

Integrate each side with respect to its own variable, including a constant of integration. Then solve for yy if possible; an implicit relation between xx and yy can also be an acceptable solution. If an is given, use it to determine the arbitrary constant.

Worked example: use the condition and verify

Solve

y′=xy,y(0)=2.y'=xy,\qquad y(0)=2.

Here f(x)=xf(x)=x and g(y)=yg(y)=y. Setting g(y)=0g(y)=0 gives the candidate constant solution y=0y=0. It does not satisfy the y(0)=2y(0)=2, so it is not the solution to this initial-value problem.

For nonzero yy, divide by yy and separate:

dyy=x dx.\frac{dy}{y}=x\,dx.

Integrate with respect to the indicated variables. In particular, ∫(1/y) dy=ln⁡∣y∣\int (1/y)\,dy=\ln|y|:

ln⁡∣y∣=x22+C.\ln|y|=\frac{x^2}{2}+C.

Exponentiating and combining the sign and positive constant into one arbitrary constant gives

y=Aex2/2.y=Ae^{x^2/2}.

Now apply the initial value. At x=0x=0, y=2y=2, so 2=Ae0=A2=Ae^0=A. Thus

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

Check both requirements. Differentiation gives y′=2xex2/2y'=2xe^{x^2/2}, while substituting the solution into the right-hand side gives xy=2xex2/2xy=2xe^{x^2/2}; therefore the differential equation holds. Also, y(0)=2e0=2y(0)=2e^0=2, so the holds. This two-part check is important: a function must satisfy both the equation and the specified condition to solve the initial-value problem. The constant-solution check also remains important even if a later algebraic form of the family happens to include a constant solution.

  • : A first-order differential equation whose right-hand side factors into a function of x multiplied by a function of y.