# Solving and checking the answer of a first order differential equation

Problem:
Solve the following differential equations. $$x \frac{dy}{dx} + y = y^{-2}$$
To solve this equation, we reduce it to a linear differential equation with the substitution $$v = y^3$$. \begin{align*} xy^2 \frac{dy}{dx} + y^3 &= 1 \\ \frac{dv}{dx} &= 3y^2 \frac{dy}{dx} \\ 3xy^2 \frac{dy}{dx} + 3y^3 &= 3 \\ \frac{dv}{dx} + 3v &= 3 \\ \end{align*} Now we have a first order linear differential equation. To solve it, we use the integrating factor $$I = e^{\int P(x)}$$. In this case, we have $$P(x) = 3$$. \begin{align*} I(x) &= e^{3x} \\ e^{3x} \frac{dv}{dx} + 3e^{3x}v &= 3e^{3x} \\ D\left( e^{3x}v \right) &= 3e^{3x} \\ e^{3x}v &= e^{3x} + C \\ v &= 1 + e^{-3x} \\ y^3 &= 1 + e^{-3x} \end{align*} Now to check my answer. \begin{align*} 3y^2 \frac{dy}{dx} &= -3Ce^{-3x} \\ y^2 \frac{dy}{dx} &= -Ce^{-3x} \\ \frac{dy}{dx} &= -Ce^{-3x} y^{-2} \\ x \frac{dy}{dx} + y &= x \left( -Ce^{-3x} y^{-2} \right) + \left( 1 + e^{-3x} \right)^{\frac{1}{3} } \end{align*} I cannot seem to get my answer to check. Where did I go wrong?

Here is my second attempt to solve the problem:

To solve this equation, we reduce it to a linear differential equation with the substitution $$v = y^3$$. \begin{align*} xy^2 \frac{dy}{dx} + y^3 &= 1 \\ \frac{dv}{dx} &= 3y^2 \frac{dy}{dx} \\ 3xy^2 \frac{dy}{dx} + 3y^3 &= 3 \\ x \frac{dv}{dx} + 3v &= 3 \\ \frac{dv}{dx} + 3 x^{-1} v &= 3x^{-1} \\ \end{align*} Now we have a first order linear differential equation. To solve it, we use the integrating factor $$I = e^{\int P(x)}$$. In this case, we have $$P(x) = 3x^{-1}$$. \begin{align*} I &= e^{3 \int x^{-1} \, dx} = e ^ { 3 \ln{|x|}} \\ I &= 3x \\ 3x \frac{dv}{dx} + 9 v &= 9 \\ \end{align*} Now, I want to write: $$D( 3xv ) = 9$$ but that is wrong. What did I do wrong?

Here is my third attempt to solve the problem. Last time, I made a mistake in finding the integrating factor.

To solve this equation, we reduce it to a linear differential equation with the substitution $$v = y^3$$. \begin{align*} xy^2 \frac{dy}{dx} + y^3 &= 1 \\ \frac{dv}{dx} &= 3y^2 \frac{dy}{dx} \\ 3xy^2 \frac{dy}{dx} + 3y^3 &= 3 \\ x \frac{dv}{dx} + 3v &= 3 \\ \frac{dv}{dx} + 3 x^{-1} v &= 3x^{-1} \\ \end{align*} Now we have a first order linear differential equation. To solve it, we use the integrating factor $$I = e^{\int P(x)}$$. In this case, we have $$P(x) = 3x^{-1}$$. \begin{align*} I &= e^{3 \int x^{-1} \, dx} = e ^ { 3 \ln{|x|}} \\ I &= x^3 \\ x^3 \frac{dv}{dx} + 3 x^2 v &= 3x^2 \\ D( x^3v ) &= x^3 + C \\ x^3v &= x^3 + C \\ v &= Cx^{-3} + 1 \\ y^3 &= Cx^{-3} + 1 \end{align*}

Do I have it right now?

• $e^{3\log x}\ne 3x$. – Yves Daoust Apr 7 '20 at 12:45

$$xy^2y'+y^3=1$$ or with $$u:=y^3$$, $$xu'+3u=3.$$

We have the particular solution $$u_p=1$$, and the homogeneous equation is separable, giving

$$u_h=cx^{-3}.$$

Finally,

$$y=\sqrt[3]{cx^{-3}+1}.$$

Check:

$$xy'+y=x\frac{-3cx^{-4}}{3(cx^{-3}+1)^{2/3}}+\sqrt[3]{cx^{-3}+1}=\frac{-3cx^{-3}+3x^{-3}+1}{(cx^{-3}+1)^{2/3}}=\frac1{y^2}.$$

$$xy'+y=y^{-2} \implies \frac{dy}{y^{-2}-y}=\frac{dx}{x} \implies \int \frac{-1}{3}\frac{-3y^2dy}{1-y^3}=\int \frac{dx}{x}+\ln C$$ $$\implies \frac{-1}{3} \ln (1-y^3)=\ln cx \implies y=\left( 1-\frac{1}{c^3x^3} \right)^{1/3}$$