TOPIC 7.6 · STUDY

Finding General Solutions Using Separation of Variables

Separation of variables rewrites dy/dx = g(x) h(y) so each variable can be integrated. The general solution includes the constant of integration, and any constant function removed by division has to be checked on its own.

FUN-7.D

General Solutions Using Separation of Variables

Separation of variables is for a differential equation that can be written $\frac{dy}{dx}=g(x)\,h(y)$. Divide by $h(y)$ and multiply by $dx$ to get $\frac{1}{h(y)}\,dy=g(x)\,dx$, then integrate both sides. The division is legal only where $h(y)\neq 0$. Any constant function you divided away has to be substituted back into the original equation. Sometimes it is a solution and belongs in the general solution. Sometimes it is not.

Example. Solve $\frac{dy}{dx}=2x$. Write $dy=2x\,dx$. There is nothing to divide, because the right side does not depend on $y$. Integrate both sides: $y=x^2+C$. The constant $C$ is an arbitrary real number, so this is a family of curves, one for each $C$. Differentiate to verify: $\frac{d}{dx}(x^2+C)=2x$, which matches the equation for every real $C$. The figure shows the member $C=0$, the curve $y=x^2$. The other members are vertical shifts of that parabola.

The parabola y = x squared, the member C = 0 of the family y = x squared plus C.

The curve $y=x^2$ is the member $C=0$ of the general solution $y=x^2+C$ of $\frac{dy}{dx}=2x$. Its derivative is $2x$.

Example. Solve $\frac{dy}{dx}=y$. If $y\neq 0$, separate to get $\frac{1}{y}\,dy=dx$. Integrate: $\ln|y|=x+C_1$. Exponentiate: $|y|=e^{x+C_1}=e^{C_1}e^{x}$. So $y=Ae^{x}$ where $A=e^{C_1}$ or $A=-e^{C_1}$. Those choices make $A$ any nonzero constant. The division excluded $y=0$, so test that constant function separately. Its derivative is $0$, and the right side of $\frac{dy}{dx}=y$ is also $0$, so $y=0$ is a solution. It is the missing member $A=0$. The general solution is $y=Ae^{x}$ for any constant $A$, including zero and negative values.

Verify the general solution by differentiation: $\frac{d}{dx}(Ae^{x})=Ae^{x}=y$, for every constant $A$. The absolute value is what allows negative $A$. Writing only $y=e^{x+C_1}$ keeps $y$ positive and drops the negative solutions.

The constant has to stay in the exponent until you absorb it. From $\ln|y|=x+C_1$ it is wrong to conclude $y=e^{x}+C$. Check that wrong formula: the derivative of $e^{x}+C$ is $e^{x}$, while the right side of $\frac{dy}{dx}=y$ would be $e^{x}+C$. Those agree for every $x$ only when $C=0$. So $y=e^{x}+C$ is not the general solution. The legal algebra is $y=e^{x+C_1}=e^{C_1}e^{x}$, which multiplies by a constant instead of adding one.

Two exponential curves, y = e to the x above the x-axis and y = -e to the x below it.

Two members of $y=Ae^{x}$: the upper curve is $y=e^{x}$ and the lower curve is $y=-e^{x}$. Both are drawn with base $2.718281828$. The equilibrium $y=0$ is the member $A=0$ and lies on the $x$-axis.

A different equation shows a constant that should not be added back. For $\frac{dy}{dx}=\frac{2x}{y}$, separate as $y\,dy=2x\,dx$, which already requires $y\neq 0$ because the original equation divides by $y$. Integrate: $\frac{1}{2}y^2=x^2+C$, or $y^2=2x^2+K$ with $K=2C$. Differentiate that result implicitly: $2y\frac{dy}{dx}=4x$, so $\frac{dy}{dx}=\frac{2x}{y}$ wherever $y\neq 0$. The constant function $y=0$ cannot be included. The original equation is undefined at $y=0$, so there is no slope to match. Checking the excluded constant is required either way: here the check rejects $y=0$, while for $\frac{dy}{dx}=y$ the check accepts $y=0$.

Key points

  • If $\frac{dy}{dx}=g(x)\,h(y)$ and $h(y)\neq 0$, write $\frac{1}{h(y)}\,dy=g(x)\,dx$ and integrate both sides.
  • For $\frac{dy}{dx}=2x$, the general solution is $y=x^2+C$. The derivative of $x^2+C$ is $2x$.
  • The curve $y=x^2$ is the member $C=0$. Other values of $C$ shift that parabola up or down.
  • For $\frac{dy}{dx}=y$, separation gives $\ln|y|=x+C_1$ and then $y=Ae^{x}$ with $A\neq 0$.
  • Test $y=0$ separately. It solves $\frac{dy}{dx}=y$, so the general solution allows $A=0$ as well.
  • $\ln|y|=x+C_1$ becomes $y=Ae^{x}$, not $y=e^{x}+C$.
  • For $\frac{dy}{dx}=\frac{2x}{y}$, the family is $y^2=2x^2+K$. The function $y=0$ is undefined in the equation, so it is not a solution.

A common mistake is to drop a constant solution after dividing by an expression that can be zero, or to add that constant back without testing it. Another slip is to turn $\ln|y|=x+C_1$ into $y=e^{x}+C$. The constant from the logarithm multiplies $e^{x}$.

Practice this topic