Skip to main content
Mathematics LibreTexts

2.4: Transformation of Nonlinear Equations into Separable Equations

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    In Section 2.1, we found that the solutions of a linear nonhomogeneous equation

    \[y'+p(x)y=f(x)\nonumber \]

    are of the form \(y=uy_1\), where \(y_1\) is a nontrivial solution of the complementary equation

    \[\label{eq:2.4.1} y'+p(x)y=0 \]

    and \(u\) is a solution of

    \[u'y_1(x)=f(x).\nonumber \]

    Note that this last equation is separable, since it can be rewritten as

    \[u'={f(x)\over y_1(x)}.\nonumber \]

    In this section we’ll consider nonlinear differential equations that are not separable to begin with, but can be solved in a similar fashion by writing their solutions in the form \(y=uy_1\), where \(y_1\) is a suitably chosen known function and \(u\) satisfies a separable equation. We’llsay in this case that we transformed the given equation into a separable equation.

    Bernoulli Equations

    A Bernoulli equation is an equation of the form

    \[\label{eq:2.4.2} y'+p(x)y=f(x)y^r, \]

    where \(r\) can be any real number other than \(0\) or \(1\). (Note that Equation \ref{eq:2.4.2} is linear if and only if \(r=0\) or \(r=1\).) We can transform Equation \ref{eq:2.4.2} into a separable equation by variation of parameters: if \(y_1\) is a nontrivial solution of Equation \ref{eq:2.4.1}, substituting \(y=uy_1\) into Equation \ref{eq:2.4.2} yields

    \[u'y_1+u(y_1'+p(x)y_1)=f(x)(uy_1)^r,\nonumber \]

    which is equivalent to the separable equation

    \[u'y_1(x)=f(x)\left(y_1(x)\right)^ru^r \quad \text{or} \quad {u'\over u^r}=f(x)\left(y_1(x)\right)^{r-1},\nonumber \]

    since \(y_1'+p(x)y_1=0\).

    Example \(\PageIndex{1}\)

    Solve the Bernoulli equation

    \[\label{eq:2.4.3} y'-y=xy^2. \]


    Since \(y_1=e^x\) is a solution of \(y'-y=0\), we look for solutions of Equation \ref{eq:2.4.3} in the form \(y=ue^x\), where

    \[u'e^x=xu^2e^{2x} \quad \text{or equivalently} \quad u'=xu^2e^x. \nonumber \]

    Separating variables yields

    \[{u'\over u^2}=xe^x, \nonumber \]

    and integrating yields

    \[-{1\over u}=(x-1)e^x+c. \nonumber \]


    \[u=-{1\over(x-1)e^x+c} \nonumber \]


    \[y=-{1\over x-1+ce^{-x}}. \nonumber \]

    Figure \(\PageIndex{1}\) shows direction field and some integral curves of Equation \ref{eq:2.4.3}.

    Figure \(\PageIndex{1}\): A direction field and integral curves for \(y'-y=xy^{2}\)

    Other Nonlinear Equations That Can be Transformed Into Separable Equations

    We’ve seen that the nonlinear Bernoulli equation can be transformed into a separable equation by the substitution \(y=uy_1\) if \(y_1\) is suitably chosen. Now let’s discover a sufficient condition for a nonlinear first order differential equation

    \[\label{eq:2.4.4} y'=f(x,y) \]

    to be transformable into a separable equation in the same way. Substituting \(y=uy_1\) into Equation \ref{eq:2.4.4} yields

    \[u'y_1(x)+uy_1'(x)=f(x,uy_1(x)),\nonumber \]

    which is equivalent to

    \[\label{eq:2.4.5} u'y_1(x)=f(x,uy_1(x))-uy_1'(x). \]


    \[f(x,uy_1(x))=q(u)y_1'(x)\nonumber \]

    for some function \(q\), then Equation \ref{eq:2.4.5} becomes

    \[\label{eq:2.4.6} u'y_1(x)=(q(u)-u)y_1'(x), \]

    which is separable. After checking for constant solutions \(u\equiv u_0\) such that \(q(u_0)=u_0\), we can separate variables to obtain

    \[{u'\over q(u)-u}={y_1'(x)\over y_1(x)}. \nonumber \]

    Homogeneous Nonlinear Equations

    In the text we will consider only the most widely studied class of equations for which the method of the preceding paragraph works. Other types of equations appear in Exercises \(\PageIndex{44}\) - \(\PageIndex{51}\).

    The differential equation Equation \ref{eq:2.4.4} is said to be homogeneous if \(x\) and \(y\) occur in \(f\) in such a way that \(f(x,y)\) depends only on the ratio \(y/x\); that is, Equation \ref{eq:2.4.4} can be written as

    \[\label{eq:2.4.7} y'=q(y/x), \]

    where \(q=q(u)\) is a function of a single variable. For example,

    \[y'={y+xe^{-y/x}\over x}={y\over x}+e^{-y/x}\nonumber \]


    \[y'={y^2+xy-x^2\over x^2}=\left(y\over x\right)^2+{y\over x} -1\nonumber \]

    are of the form Equation \ref{eq:2.4.7}, with

    \[q(u)=u+e^{-u} \quad \text{and} \quad q(u)=u^2+u-1,\nonumber \]

    respectively. The general method discussed above can be applied to Equation \ref{eq:2.4.7} with \(y_1=x\) (and therefore \(y_1'=1)\). Thus, substituting \(y=ux\) in Equation \ref{eq:2.4.7} yields

    \[u'x+u=q(u),\nonumber \]

    and separation of variables (after checking for constant solutions \(u\equiv u_0\) such that \(q(u_0)=u_0\)) yields

    \[{u'\over q(u)-u}={1\over x}.\nonumber \]

    Before turning to examples, we point out something that you may’ve have already noticed: the definition of homogeneous equation given here is not the same as the definition given in Section 2.1, where we said that a linear equation of the form

    \[y'+p(x)y=0\nonumber \]

    is homogeneous. We make no apology for this inconsistency, since we didn’t create it historically, homogeneous has been used in these two inconsistent ways. The one having to do with linear equations is the most important. This is the only section of the book where the meaning defined here will apply.

    Since \(y/x\) is in general undefined if \(x=0\), we’ll consider solutions of nonhomogeneous equations only on open intervals that do not contain the point \(x=0\).

    Example \(\PageIndex{2}\)


    \[\label{eq:2.4.8} y'={y+xe^{-y/x}\over x}. \]


    Substituting \(y=ux\) into Equation \ref{eq:2.4.8} yields

    \[u'x+u = {ux+xe^{-ux/x}\over x} = u+e^{-u}. \nonumber \]

    Simplifying and separating variables yields

    \[e^uu'={1\over x}. \nonumber \]

    Integrating yields \(e^u=\ln |x|+c\). Therefore \(u=\ln(\ln|x|+c)\) and \(y=ux=x \ln (\ln |x|+c)\).

    Figure \(\PageIndex{2}\) shows a direction field and integral curves for Equation \ref{eq:2.4.8}.

    Figure \(\PageIndex{2}\): A direction field and some integral curves for \(y'= {\dfrac{y+xe^{-y/x}}{x}}\)
    Example \(\PageIndex{3}\)
    1. Solve \[ x^2y'=y^2+xy-x^2. \label{eq:2.4.9}\]
    2. Solve the initial value problem \[ x^2y'=y^2+xy-x^2, \quad y(1)=2. \label{eq:2.4.10} \]
    Solution a

    We first find solutions of Equation \ref{eq:2.4.9} on open intervals that don’t contain \(x=0\). We can rewrite Equation \ref{eq:2.4.9} as

    \[y'={y^2+xy-x^2\over x^2} \nonumber \]

    for \(x\) in any such interval. Substituting \(y=ux\) yields

    \[u'x+u ={ (ux)^2+x(ux)-x^2 \over x^2} = u^2+u-1,\nonumber \]


    \[\label{eq:2.4.11} u'x=u^2-1. \]

    By inspection this equation has the constant solutions \(u\equiv1\) and \(u\equiv-1\). Therefore \(y=x\) and \(y=-x\) are solutions of Equation \ref{eq:2.4.9}. If \(u\) is a solution of Equation \ref{eq:2.4.11} that does not assume the values \(\pm 1\) on some interval, separating variables yields

    \[{u'\over u^2-1}={1\over x},\nonumber \]

    or, after a partial fraction expansion,

    \[{1\over 2}\left[{1\over u-1}-{1\over u+1}\right]u'= {1\over x}.\nonumber \]

    Multiplying by 2 and integrating yields

    \[\ln\left|u-1\over u+1\right| =2 \ln |x|+k,\nonumber \]


    \[\left|{u-1\over u+1}\right|=e^kx^2,\nonumber \]

    which holds if

    \[\label{eq:2.4.12} {u-1\over u+1}=cx^2 \]

    where \(c\) is an arbitrary constant. Solving for \(u\) yields

    \[u ={1+cx^2\over 1-cx^2}.\nonumber \]

    Figure \(\PageIndex{3}\): A direction field and integral curves for \(x^2y' = y^2 + xy − x^2\)


    \[\label{eq:2.4.13} y=ux={x(1+cx^2)\over 1-cx^2} \]

    is a solution of Equation \ref{eq:2.4.10} for any choice of the constant \(c\). Setting \(c=0\) in Equation \ref{eq:2.4.13} yields the solution \(y=x\). However, the solution \(y=-x\) can’t be obtained from Equation \ref{eq:2.4.13}. Thus, the solutions of Equation \ref{eq:2.4.9} on intervals that don’t contain \(x=0\) are \(y=-x\) and functions of the form Equation \ref{eq:2.4.13}.

    The situation is more complicated if \(x=0\) is the open interval. First, note that \(y=-x\) satisfies Equation \ref{eq:2.4.9} on \((-\infty,\infty)\). If \(c_1\) and \(c_2\) are arbitrary constants, the function

    \[\label{eq:2.4.14}y=\left\{\begin{array}{ll} {\frac{x(1+c_{1}x^{2})}{1-c_{1}x^{2}},}&{a<x<0} \\[4pt] {\frac{x(1+c_{2}x^{2}}{1-c_{2}x^{2}},}&{0\leq x<b}\end{array}\right. \]

    is a solution of Equation \ref{eq:2.4.9} on \((a,b)\), where

    \[a=\left\{\begin{array}{cl}- {1\over\sqrt{c_1}}&\mbox{ if }c_1>0,\\[4pt] -\infty&\mbox{ if }c_1\le 0, \end{array}\right. \quad \text{and} \quad b=\left\{\begin{array}{cl} {1\over\sqrt{c_2}}&\mbox{ if }c_2>0,\\[4pt] \infty&\mbox{ if }c_2\le 0. \end{array}\right.\nonumber \]

    We leave it to you to verify this. To do so, note that if \(y\) is any function of the form Equation \ref{eq:2.4.13} then \(y(0)=0\) and \(y'(0)=1\).

    Figure \(\PageIndex{3}\) shows a direction field and some integral curves for Equation \ref{eq:2.4.9}.

    Solution b

    We could obtain \(c\) by imposing the initial condition \(y(1)=2\) in Equation \ref{eq:2.4.13}, and then solving for \(c\). However, it is easier to use Equation \ref{eq:2.4.12}. Since \(u=y/x\), the initial condition \(y(1)=2\) implies that \(u(1)=2\). Substituting this into Equation \ref{eq:2.4.12} yields \(c=1/3\). Hence, the solution of Equation \ref{eq:2.4.10} is

    \[y={x(1+x^2/3)\over 1-x^2/3}.\nonumber \]

    The interval of validity of this solution is \((-\sqrt3,\sqrt3)\). However, the largest interval on which Equation \ref{eq:2.4.10} has a unique solution is \((0,\sqrt3)\). To see this, note from Equation \ref{eq:2.4.14} that any function of the form

    \[\label{eq:2.4.15} y=\left\{\begin{array}{ll} {\dfrac{x(1+cx^{2})}{1-cx^{2}},}&{a<x\leq 0} \\[4pt] {\dfrac{x(1+x^{2}/3)}{1-x^{2}/3}}&{0\leq x<\sqrt{3}}\end{array}\right. \]

    is a solution of Equation \ref{eq:2.4.10} on \((a,\sqrt3)\), where \(a=-1/\sqrt c\) if \(c>0\) or \(a=-\infty\) if \(c\le0\). Why does this not contradict Theorem 2.3.1?

    Figure \(\PageIndex{4}\) shows several solutions of the initial value problem Equation \ref{eq:2.4.10}. Note that these solutions coincide on \((0,\sqrt{3})\).

    Figure \(\PageIndex{4}\): Solutions of \(x^2y' = y^2 + xy − x^2, \, y(1) = 2\)

    In the last two examples we were able to solve the given equations explicitly. However, this is not always possible, as you’ll see in the exercises.

    This page titled 2.4: Transformation of Nonlinear Equations into Separable Equations is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by William F. Trench via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.