13. First Order ODEs

Definition

In general a first order ordinary differential equation (ODE) is of the form:

(13.2)\[y^{\prime}(x)=f(x,\,y)\]

where \(f(x,\,y)\) is some function, which can in general have \(x\) and \(y\) dependance.

13.1. Separation of variables form

Of all the techniques for solving first order ODEs, separation of variables is the simplest to understand, being essentially a direct application of Fundamental Theorem of Calculus. The technique requires us to take a look at whether the variable dependence can be totally separated on different sides of the equation.

Definition

A separable first order ODE is of the form:

(13.2)\[\frac{\mathrm{d}y}{\mathrm{d}x} = f(x)\,g(y)\]

where we have separated out the \(x\) dependance into the function \(f(x)\) and \(y\) dependance into the function \(g(y)\). Using the FTC we find:

\[\frac{\mathrm{d}y}{g(y)} = f(x)\,\mathrm{d}x \]

which we can then be integrated:

\[\int\frac{\mathrm{d}y}{g(y)} = \int f(x)\,\mathrm{d}x \]

and then we would rearrange to (if possible) find \(y(x)\).

13.2. Integrating factor form

Integrating facor method

Problems which are the following form can be solved by the integrating factor method:

\[\frac{\mathrm{d}y}{\mathrm{d}x} + f(x)\,y = g(x)\]

If we multiply through by a function \(\mu(x) = e^{\int f(x) \,\mathrm{d}x}\), which we call an integrating factor (IF):

\[\mu \,\frac{\mathrm{d}y}{\mathrm{d}x} + y\,\mu\,f(x) = \mu\,g(x)\]

and compare this with:

\[\frac{\mathrm{d}}{\mathrm{d}x}\left(\mu y \right)=\mu \frac{\mathrm{d}y}{\mathrm{d}x}+y\frac{\mathrm{d}\mu}{\mathrm{d}x}\]

By equating these two equations, it can be seen that we can make the integrating factor work if we choose \(\mu\) to satisfy:

\[\frac{\mathrm{d}\mu}{\mathrm{d}x}=\mu \,f(x)\]

We can solve this equation by separation, the solution is:

\[\mu = e^{\int f(x)\,\mathrm{d}x}\]

This terms role is to cast the left hand side as an exact derivative - in order to make the problem integrable.

The integrating factor technique can be written down in the form of an algorithm:

1. Compute the integrating factor \(\displaystyle \mu(x) = e^{\int f(x) \,\mathrm{d}x}\).

2. Multiply the whole ODE by \(\mu(x)\):

\[e^{\int{f(x) \mathrm{d}x}}\,\frac{\mathrm{d}y}{\mathrm{d}x} + e^{\int{f(x) \mathrm{d}x}}\,f(x)\,y = e^{\int{f(x) \mathrm{d}x}}\,g(x)\]

3. We find that the left-hand-side can be rewritten as a derivative \(\displaystyle \frac{\mathrm{d}}{\mathrm{d}x}(\mu\, y)\):

\[\frac{\mathrm{d}}{\mathrm{d}x}\Big(y\,e^{\int f(x) \,\mathrm{d}x}\Big) = e^{\int f(x)\, \mathrm{d}x }\,g(x)\]

4. Integrate both sides with respect to \(x\):

\[y\,e^{\int f(x)\, \mathrm{d}x} = \int \Big(e^{\int f(x)\, \mathrm{d}x}\,g(x)\Big)\,\mathrm{d}x\]

5. Rearrange to find \(y(x)\):

(13.3)\[y(x) = \Big[\int \Big( e^{\int f(x)\, \mathrm{d}x}\,g(x)\Big)\,\mathrm{d}x + C\Big]\,e^{-\int f(x)\, \mathrm{d}x}\]

where \(C\) is a constant.

Worked example

Consider the following differential equation:

(13.4)\[\frac{\mathrm{d}y}{\mathrm{d}x}+\frac{y}{x}=\frac{\cos(x)}{x}, \quad (x\neq 0)\]

A quick check will show that this equation is not separable. If we try to integrate directly, then we obtain:

\[\int \,\mathrm{d}y + \int \frac{1}{x}y \,\mathrm{d}x = \int \frac{\cos(x)}{x}\,\mathrm{d}x\]

We can deal with the integral on the right (in principle) but the term \(\displaystyle \int \frac{y}{x}\mathrm{d}x\) appearing on the left cannot be evaluated without knowing \(y\), so this is a dead end.

But observe that we can multiply equation (13.4) throughout by \(x\), to obtain:

(13.5)\[x\frac{\mathrm{d}y}{\mathrm{d}x}+y=\cos(x), \quad (x\neq 0)\]

The expression on the left-hand side is an exact derivative:

\[\frac{\mathrm{d}}{\mathrm{d}x}(yx)=x\frac{\mathrm{d}y}{\mathrm{d}x}+y\]

Neat - this means that we can integrate equation (13.5) to obtain:

\[xy=\int\cos(x)\mathrm{d}x\]

The final solution therefore is:

\[y=\frac{1}{x}(\sin(x)+k)\]

where \(k\) is an arbitrary constant.

If we want to verify that the solution satisfies equation (13.4):

\[\begin{split}\frac{\mathrm{d}y}{\mathrm{d}x}+\frac{y}{x} &= \left[-\frac{1}{x^2}(\sin(x)+k)+\frac{1}{x}\cos(x)\right]+\frac{1}{x^2}(\sin(x)+k)\\ &=\frac{\cos(x)}{x}\end{split}\]

13.3. Perfect differential form

If we are struggling to find a first order ODE method that works and has clearly integrable terms, we can try the perfect differential test.

Recall from the multivariable change rule, the total differential of a function \(f(x,\,y)\) is:

\[\mathrm{d}f = \frac{\partial f}{\partial x}\,\mathrm{d}x + \frac{\partial f}{\partial y}\,\mathrm{d}y \]

now if we examine the most general form of a first order ODE:

\[Q(x,\,y)\,\frac{\mathrm{d}y}{\mathrm{d}x} + P(x,\, y) = 0\]

which we can rewrite as:

\[ P(x,\, y)\,\mathrm{d}x + Q(x,\,y)\,\mathrm{d}y = 0\]

we can see that these bear a striking resembalance and remember that if:

\[\frac{\partial P}{\partial y} = \frac{\partial Q}{\partial x} \]

then this is a perfect differential, where here \(\mathrm{d}f = 0\) and so:

\[f(x,\,y) = C \]

where \(C\) is a constant.

Worked example

Lets try to solve the non-linear, first order ODE:

\[2x^2\,y\,\frac{\mathrm{d}y}{\mathrm{d}x} + 2x\,y^2 = 1\]

we find that we can identify:

\[\begin{split}P(x,\,y) &= 2x\,y^2-1\\ Q(x,\,y) &= 2x^2\,y\end{split}\]

so we check that the partial derivatives agree:

\[\begin{split}\frac{\partial P}{\partial y} = 4xy \\ \frac{\partial Q}{\partial x} = 4xy\end{split}\]

which they do and therefore we want to obtain the function \(f(x,\, y)\):

\[\begin{split}P(x,\,y) &= \frac{\partial f}{\partial x} = 2x\,y^2-1 \Rightarrow f(x,\,y) = \int (2x\,y^2-1)\,\mathrm{d}x = x^2\,y^2 - x + g(y)\\ Q(x,\,y) &= \frac{\partial f}{\partial y} = 2x^2\,y \Rightarrow f(x,\,y) = \int (2x^2\,y)\,\mathrm{d}y = x^2\,y^2 + h(x)\\\end{split}\]

which we can see will agree if \(g(y) = 0,\, h(x) = -x\):

\[f(x,\,y) = x^2\,y^2 - x\]

and given that here \(f(x,\,y) = C\), where \(C\) is a constant, this means that we have:

\[\begin{split}x^2\,y^2 - x &= C \\ y &= \pm\sqrt{\frac{1}{x} + \frac{C}{x^2}}\end{split}\]

13.3.1. Fixing the perfect form

This method relies on the differential given being perfect, if it is not, then we cannot find the function \(f(x,\, y)\). However there is an analagous method for finding a multivariable integrating factor, allowing us to potentially convert imperfect differentials into a perfect form .

Multivariable integrating factor

Consider an imperfect differential:

\[P(x,\,y)\,\mathrm{d}x + Q(x,\,y)\,\mathrm{d}y = 0\qquad \frac{\partial P}{\partial y} \neq \frac{\partial Q}{\partial x}\]

Lets introduce an integrating factor \(M(x,\,y)\), which means now that:

\[M(x,\,y)\,P(x,\,y)\,\mathrm{d}x + M(x,\,y)\,Q(x,\,y)\,\mathrm{d}y = 0 \qquad \frac{\partial (M P)}{\partial y} = \frac{\partial (M Q)}{\partial x}\]

and we can write the form of \(M(x,\,y)\) as:

\[M(x,\,y) = e^{\int G(x)\,\mathrm{d}x}\,e^{\int H(y)\,\mathrm{d}y}\]

The form of the multivariable integrating factor means that:

\[\begin{split}M_x &= G(x)\,M \\ M_y &= H(y)\,M\end{split}\]

Solving the key requirement for a perfect differential:

\[\begin{split}\frac{\partial (M P)}{\partial y} &= M_y\,P + M\,P_y = M(H\,P + P_y)\\ \frac{\partial (M Q)}{\partial x} &= M_x\,Q + M\,Q_x = M(G\,Q + Q_x)\\ &\Rightarrow H(y)\,P + P_y = G(x)\,Q + Q_x\end{split}\]

our aim here is separate out variables. If each of \(P(x,\,y),\, Q(x,\,y)\) are in a separable form:

\[\begin{split}P(x,\,y) &= p_1(x)\,p_2(y) \\ Q(x,\,y) &= q_1(x)\,q_2(y)\end{split}\]

which means therefore:

\[\begin{split}H(y)\,p_1(x)\,p_2(y) + p_1(x)\,{p_2}'(y) &= G(x)\,q_1(x)\,q_2(y) + {q_1}'(x)\,q_2(y) \\ \Rightarrow p_1(x)\Big(H(y)\,p_2(y) + {p_2}'(y)\Big) &= q_2(y)\Big(G(x)\,q_1(x) + {q_1}'(x)\Big) \\ \frac{H(y)\,p_2(y) + {p_2}'(y)}{q_2(y)} &= \frac{G(x)\,q_1(x) + {q_1}'(x)}{p_1(x)} = C\end{split}\]

where \(C\) is a constant. We find that this expression is a constant, because although the LHS depends only on \(y\), the RHS does not, hence the LHS is overall a constant in \(y\). A similar argument holds for \(x\) and the RHS, meaning that overall the two expressions are constant. This mean therefore:

\[\begin{split}H(y)\,p_2(y) + {p_2}'(y) &= C\,q_2(y) \Rightarrow H(y) = \frac{C\,q_2(y) - {p_2}'(y)}{p_2(y)} \\ G(x)\,q_1(x) + {q_1}'(x) &= C\,p_1(x) \Rightarrow G(x) = \frac{C\,p_1(x) - {q_1}'(x)}{q_1(x)}\end{split}\]

Worked example

Consider the differential:

\[2x\sin(y)\,\mathrm{d}x + x^3\,\cos(y)\,\mathrm{d}y = 0\]

Looking at the derivatives:

\[\begin{split}P_y &= 2x\,\cos(y) \\ Q_x &= 3x^2\,\cos(y)\end{split}\]

hence this is not an exact differential.

However since here the functions \(P(x,\,y),\, Q(x,\,y)\) are separable, we can find:

\[\begin{split}p_1(x) &= 2x \qquad p_2(y) = \sin(y) \\ q_1(x) &= x^3 \qquad q_2(y) = \cos(y)\\ H(y) &= \frac{C\,q_2(y) - {p_2}'(y)}{p_2(y)} = \frac{C\,\cos(y) - \cos(y)}{\sin(y)} = (C-1)\,\cot(y) \\ G(x) &= \frac{C\,p_1(x) - {q_1}'(x)}{q_1(x)} = \frac{2Cx - 3x^2}{x^3} = \frac{2C - 3x}{x^2}\\ \ln(M) &= \int G(x)\,\mathrm{d}x + \int H(y)\,\mathrm{d}y = (C-1)\ln|\sin(x)| - \frac{2C}{x} - 3 \ln|x|\\ \Rightarrow M(x,\,y) &= \frac{\sin^{C-1}(y)\,e^{-2C/x}}{x^3}\end{split}\]

This means that our differential function is satisfied by:

\[\begin{split}f_x &= \frac{2\,\sin^{C}(y)\,e^{-2C/x}}{x^2} \\ \Rightarrow f &= \int \frac{2\,\sin^{C}(y)\,e^{-2C/x}}{x^2}\,\mathrm{d}x = \frac{\sin^{C}(y)\,e^{-2C/x}}{C} + K_1(y)\\ f_y &= \sin^{C-1}(y)\,\cos(y)\,e^{-2C/x} \\ \Rightarrow f &= \int \sin^{C-1}(y)\,\cos(y)\,e^{-2C/x}\,\mathrm{d}y = \frac{\sin^{C}(y)\,e^{-2C/x}}{C} + K_2(x)\end{split}\]

and so \(K_1 = K_2\) are constants here, which we can absorb into the constant for \(f(x,\,y)\):

\[\sin^{C}(y)= K\,e^{2C/x}\]

where \(K\) will be fixed by initial conditions, however \(C\) is a system parameter - it shows that this systems integrating factor is not unique! We could simplify this down to:

\[\sin(y)= K\,e^{2/x}\]

13.4. Substitution methods

We sometimes find that we can reduce more complicated (even non-linear) first order differential equations down to a solvable form using a substitution.

13.4.1. \(y' = f(y/x)\) form

Definition

A homogeneous first order differential equation is one of the form:

\[\frac{\mathrm{d}y}{\mathrm{d}x} = f\left(\frac{y}{x}\right)\]

and this is typically one that, through a substitution, can be solved using separation of variables. Let our substitution here be \(u = \displaystyle\frac{y}{x}\):

\[\begin{split}y &= ux\\ \frac{\mathrm{d}y}{\mathrm{d}x} &= \frac{\mathrm{d}u}{\mathrm{d}x}x + u \\ \frac{\mathrm{d}u}{\mathrm{d}x}x + u &= f(u) \\ \Rightarrow \int\frac{\mathrm{d}u}{f(u) - u} &= \int\frac{\mathrm{d}x}{x}\end{split}\]

and depending on the complexity of this LHS integral, this problem is solvable!

Worked example

Solve the ODE \(\displaystyle \frac{\mathrm{d}y}{\mathrm{d}x} = \frac{x^2 + y^2}{xy}\).

Rewriting this to be in the form \(y' = f(y/x) = f(u)\), means:

\[\begin{split}\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{\mathrm{d}u}{\mathrm{d}x}x + u &= \frac{x}{y} + \frac{y}{x} = u + \frac{1}{u}\\ \Rightarrow \frac{\mathrm{d}u}{\mathrm{d}x}x &= \frac{1}{u}\end{split}\]

This is now in a form for separation of variables and integrating:

\[\begin{split}\int u\,\mathrm{d}u &= \int \frac{\mathrm{d}x}{x} \\ \frac{1}{2}u^2 &= \ln|x| + C \\ u &= \sqrt{2 \ln|x| + C}\end{split}\]

Remember that before finishing the question, we must convert this back into \(y(x)\):

\[y = x\sqrt{2 \ln|x| + C}\]

13.4.2. \(y' = f(ax+by)\) form

Definition

A first order differential equation of the form:

\[\frac{\mathrm{d}y}{\mathrm{d}x} = f(ax+by)\]

can also be solved through a substitution which leads to separation of variables. Let our substitution here be \(u = ax+by\):

\[\begin{split}\frac{\mathrm{d}u}{\mathrm{d}x} = a + b\frac{\mathrm{d}y}{\mathrm{d}x} &= a + b\,f(u)\\ \Rightarrow \int\frac{\mathrm{d}u}{a + b f(u) } &= \int\,\mathrm{d}x\end{split}\]

and depending on the complexity of this LHS integral, this problem is solvable!

13.4.3. Benoulli form

Defintion

A Benoulli differential equation takes the form:

(13.6)\[\frac{\mathrm{d}y}{\mathrm{d}x} +P(x)\,y = Q(x)\,y^n,\, n \in \mathbb{R}\]

We see that for \(n = 0,\, 1\) this reduces to cases already discussed, but for any other \(n\) this equation is clearly non-linear in \(y\).

We can make progress in solving these sorts of ODEs by using the substitution:

\[u = y^{1-n}\]

which transforms (13.6) into a linear differential equation, since:

\[\begin{split}u = y^{1-n} &\Rightarrow \frac{\mathrm{d}u}{\mathrm{d}x} = (1-n)y^{-n}\frac{\mathrm{d}y}{\mathrm{d}x}\\ \frac{\mathrm{d}y}{\mathrm{d}x} + P(x)\,y = Q(x)\,y^n &\Rightarrow (1-n)y^{-n}\frac{\mathrm{d}y}{\mathrm{d}x} + (1-n)\,P(x)\,y^{1-n} = (1-n)\,Q(x)\\ &\Rightarrow \frac{\mathrm{d}u}{\mathrm{d}x} - (n-1)\,P(x)\,u = -(n-1)\,Q(x)\end{split}\]

and as this ODE is linear in \(u\), it can be solved using the integrating factor method.

Worked example

If we want to solve the ODE:

\[\frac{\mathrm{d}y}{\mathrm{d}x} + \frac{y}{x} = xy^2\]

we need to put it in the form \(y' = f(u,\,x)\):

\[\frac{\mathrm{d}y}{\mathrm{d}x} = xy^2 - \frac{y}{x}\]

as the highest power on the RHS is \(n=2\), using the substitution \(u = y^{1-n} = y^{-1}\):

\[\frac{\mathrm{d}u}{\mathrm{d}x} = -\frac{1}{y^2}\frac{\mathrm{d}y}{\mathrm{d}x}\]

and therefore:

\[\begin{split}\frac{\mathrm{d}u}{\mathrm{d}x} &= -\frac{1}{y^2}\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{1}{xy} - x \\ \frac{\mathrm{d}u}{\mathrm{d}x} &= \frac{u}{x} - x \\ \Rightarrow \frac{\mathrm{d}u}{\mathrm{d}x} - \frac{u}{x} &= - x\end{split}\]

which we can then solve using the IF method, with \(\mu = e^{\int -1/x\,\mathrm{d}x} = e^{-\ln|x|} = \frac{1}{x}\):

\[\begin{split}\frac{\mathrm{d}}{\mathrm{d}x}\Big(\frac{u}{x}\Big) &= -1 \\ \frac{u}{x} &= -\int \,\mathrm{d}x \\ \frac{u}{x} &= -x + C \\ u &= x(C - x) \\ y &= \frac{1}{x(C-x)}\end{split}\]

where we must not forget to return the answer back to the form of \(y(x)\) at the end (if possible).

13.4.4. Riccati form

Defintion

A Riccati differential equation takes the form:

(13.7)\[\frac{\mathrm{d}y}{\mathrm{d}x} = p(x)\,y^2(x) + q(x)\,y(x) + r(x)\]

which we can recast in terms of a variable \(u(x)\), which satisfies an ODE:

\[\frac{\mathrm{d}^2 u}{\mathrm{d}x^2} - R\,\frac{\mathrm{d}u}{\mathrm{d}x} + S\,u =0, \quad R = q + \frac{1}{p}\frac{\mathrm{d}p}{\mathrm{d}x}, \quad S = r\,p\]

and we can solve to find \(y(x)\):

\[y = -\frac{1}{p\,u}\frac{\mathrm{d}u}{\mathrm{d}x}\]

Using the transformation \(v = p\,y\) we find:

\[\begin{split}\frac{\mathrm{d}v}{\mathrm{d}x} &= \frac{\mathrm{d}p}{\mathrm{d}x}\,y + p\,\frac{\mathrm{d}y}{\mathrm{d}x} \\ p\,\frac{\mathrm{d}y}{\mathrm{d}x} &= p^2\,y^2 + q\,p\,y + p\,r \\ \Rightarrow \frac{\mathrm{d}v}{\mathrm{d}x} &= v^2 + q\,v + p\,r + y\,\frac{\mathrm{d}p}{\mathrm{d}x} = v^2 + v\left(q + \frac{1}{p}\frac{\mathrm{d}p}{\mathrm{d}x} \right) + p\,r \end{split}\]

and then switching to the variable \(u(x)\), where \(v = -\displaystyle \frac{1}{u}\frac{\mathrm{d}u}{\mathrm{d}x}\) means:

\[\begin{split}\frac{\mathrm{d}v}{\mathrm{d}x} &= \frac{1}{u^2}\left(\frac{\mathrm{d}u}{\mathrm{d}x}\right)^2 - \frac{1}{u}\frac{\mathrm{d}^2 u}{\mathrm{d}x^2} = v^2 - \frac{1}{u}\frac{\mathrm{d}^2 u}{\mathrm{d}x^2} \\ v^2 - \frac{1}{u}\frac{\mathrm{d}^2 u}{\mathrm{d}x^2} &= v^2 - \frac{1}{u}\frac{\mathrm{d}u}{\mathrm{d}x}\left(q + \frac{1}{p}\frac{\mathrm{d}p}{\mathrm{d}x} \right) + p\,r \\ \Rightarrow \frac{\mathrm{d}^2 u}{\mathrm{d}x^2} &= \left(q + \frac{1}{p}\frac{\mathrm{d}p}{\mathrm{d}x} \right)\frac{\mathrm{d}u}{\mathrm{d}x} - p\,r\,u\\ \frac{\mathrm{d}^2 u}{\mathrm{d}x^2} &- R\,\frac{\mathrm{d}u}{\mathrm{d}x} + S\,u = 0\\ R(x) &= q + \frac{1}{p}\frac{\mathrm{d}p}{\mathrm{d}x}, \quad S(x) = r\,p\end{split}\]

We see that if \(r=0\), then this just reduces to a Benoulli equation with \(n=2\) and if \(p=0\), then this is just in integrating form factor, so this equation can be thought of as a hybrid between the two.

Worked example

Consider the ODE:

\[\begin{split}\frac{\mathrm{d}y}{\mathrm{d}x} - \frac{2y}{x} = - x^2\,y^2 \\\end{split}\]

this equation can be rewritten as:

\[\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{2y}{x}-x^2\,y^2\]

and then transformed into the 2nd order ODE:

\[\begin{split}\frac{\mathrm{d}^2 u}{\mathrm{d} x^2} - R\,\frac{\mathrm{d}u}{\mathrm{d}x} + S\,u &= 0 \\ R = \frac{4}{x}\,\quad & S = 0 \\ \Rightarrow \frac{\mathrm{d}^2 u}{\mathrm{d} x^2} -\frac{4}{x} \,\frac{\mathrm{d}u}{\mathrm{d}x} &= 0\end{split}\]

which we can solve using an IF method, with \(\mu = e^{-\int 4/x\,\mathrm{d}x} = x^{-4}\):

\[\begin{split}x^{-4}\,\frac{\mathrm{d}^2 u}{\mathrm{d} x^2} - 4\,x^{-5} \,\frac{\mathrm{d}u}{\mathrm{d}x} &= 0 \\ \Big(x^{-4}\,\frac{\mathrm{d}u}{\mathrm{d}x}\Big)^\prime &= 0\end{split}\]

Since the derivative of a constant is zero, this means:

\[\begin{split}\frac{\mathrm{d}u}{\mathrm{d}x} &= C_1\,x^4 \\ u &= \frac{C_1\,x^5}{5} + C_2 \\ \Rightarrow y &= \frac{C_1\,x^2}{\frac{C_1x^5}{5} + C_2}\\\end{split}\]

where \(C_1,\, C_2\) are constants. We can tidy this expression up:

\[y = \frac{5x^2}{x^5 + C_3}\]

and \(C_3\) is a constant.

We note that this problem has \(r(x) = 0\), therefore is also a Bernoulli type expression, with highest power \(y^2\), so \(u = y^{1-2} = y^{-1}\):

\[\begin{split}\frac{\mathrm{d}u}{\mathrm{d}x} = -\frac{1}{y^2} \frac{\mathrm{d}y}{\mathrm{d}x}\\ -\frac{1}{y^2}\frac{\mathrm{d}y}{\mathrm{d}x} + \frac{2}{xy} &= x^2 \\ \frac{\mathrm{d}u}{\mathrm{d}x} + \left(\frac{2u}{x}\right) &= x^2\end{split}\]

which is also solveable using an IF, \(\mu = \displaystyle e^{\int \frac{2}{x}\,\mathrm{d}x} = x^2\):

\[\begin{split}x^2\frac{\mathrm{d}u}{\mathrm{d}x} + 2x\,u &= x^4 \\ \frac{\mathrm{d}}{\mathrm{d}x}\left(x^2\,u\right) &= x^4 \\ x^2\,u &= \frac{1}{5}x^5 + C \\ \Rightarrow u = \frac{1}{5}x^3 + Cx^{-2} &= \frac{x^5 + C}{5x^2}\\ y &= \frac{5x^2}{x^5 + C}\end{split}\]

which agrees with the earlier result.

Whilst this method is good at converting a non-linear 1st order ODE into a linear 2nd order ODE, most of the time the resulting equation will need some quite powerful techinques to solve, especially if \(R(x)\) and \(S(x)\) are both functions of \(x\).