# How can I solve this differential equation? : (2x^3-y)dx+xdy=0

Feb 17, 2018

$y = - {x}^{3} + x {C}_{1}$

#### Explanation:

.

$\left(2 {x}^{3} - y\right) \mathrm{dx} + x \mathrm{dy} = 0$

A first order Ordinary Differential Equation has the form of:

$y ' \left(x\right) + p \left(x\right) y = q \left(x\right)$

The general solution for this is:

y(x)=(inte^(intp(x)dx)q(x)dx+C)/e^(int(p(x)dx

Let's let $y$ be the dependent variable and divide the equation by $\mathrm{dx}$:

$2 {x}^{3} - y + x \frac{d}{\mathrm{dx}} \left(y\right) = 0$ $\textcolor{red}{E q u a t i o n 1}$

Now, we rewrite this in the form of the first order ODE given above. To do so, let's divide $\textcolor{red}{E q u a t i o n 1}$ by $x$:

$2 {x}^{2} - \frac{1}{x} y + \frac{d}{\mathrm{dx}} y = 0$

Let's move $2 {x}^{2}$ to the other side and switch the locations of the two remaining terms on the left hand side:

$\frac{d}{\mathrm{dx}} y - \frac{1}{x} y = - 2 {x}^{2}$ $\textcolor{b l u e}{O D E}$

Comparing this equation with the general form given above, shows that:

$p \left(x\right) = - \frac{1}{x}$ and $q \left(x\right) = - 2 {x}^{2}$

Now, we will find the integrating factor $\mu \left(x\right)$ such that:

$\mu \left(x\right) \cdot p \left(x\right) = \mu ' \left(x\right)$

But we indicated above that $p \left(x\right) = - \frac{1}{x}$ and $\mu ' \left(x\right)$ is the same as $\frac{d}{\mathrm{dx}} \left(\mu \left(x\right)\right)$. Let's plug these in:

$\mu \left(x\right) \cdot \left(- \frac{1}{x}\right) = \frac{d}{\mathrm{dx}} \left(\mu \left(x\right)\right)$

Let's divide both sides by $\mu \left(x\right)$:

$\frac{\mu \left(x\right) \cdot \left(- \frac{1}{x}\right)}{\mu \left(x\right)} = \frac{\frac{d}{\mathrm{dx}} \left(\mu \left(x\right)\right)}{\mu \left(x\right)}$

$\frac{\cancel{\textcolor{red}{\mu \left(x\right)}} \cdot \left(- \frac{1}{x}\right)}{\cancel{\textcolor{red}{\mu \left(x\right)}}} = \frac{\frac{d}{\mathrm{dx}} \left(\mu \left(x\right)\right)}{\mu \left(x\right)}$

$- \frac{1}{x} = \frac{\frac{d}{\mathrm{dx}} \left(\mu \left(x\right)\right)}{\mu \left(x\right)}$ $\textcolor{red}{E q u a t i o n 2}$

Since we know that we have the following formula for calculating the derivative of a natural log function:

$\frac{d}{\mathrm{dx}} \left(\ln \left(f \left(x\right)\right)\right) = \frac{\frac{d}{\mathrm{dx}} \left(f \left(x\right)\right)}{f \left(x\right)}$

we can rewrite $\textcolor{red}{E q u a t i o n 2}$ as:

$- \frac{1}{x} = \frac{d}{\mathrm{dx}} \left(\ln \left(\mu \left(x\right)\right)\right)$

We can now take the integral of both sides:

$\int - \frac{1}{x} \mathrm{dx} = \ln \left(\mu \left(x\right)\right)$ $\textcolor{red}{E q u a t i o n 3}$

But $\int - \frac{1}{x} \mathrm{dx} = - \ln \left(x\right) + {C}_{1}$

Let's substitute this for the left hand side of $\textcolor{red}{E q u a t i o n 3}$:

$\ln \left(\mu \left(x\right)\right) = - \ln \left(x\right) + {C}_{1}$ $\textcolor{red}{E q u a t i o n 4}$

We can use the rule of logarithms that says:

$a = {\log}_{b} \left({b}^{a}\right)$

to rewrite the right hand side of $\textcolor{red}{E q u a t i o n 4}$:

$- \ln \left(x\right) + {C}_{1} = \ln \left({e}^{- \ln \left(x\right) + {C}_{1}}\right) = \ln \left(\frac{{e}^{{C}_{1}}}{e} ^ \left(\ln \left(x\right)\right)\right) = \ln \left({e}^{{C}_{1}} / x\right)$

Therefore:

$\ln \left(\mu \left(x\right)\right) = \ln \left({e}^{{C}_{1}} / x\right)$

This means:

$\mu \left(x\right) = {e}^{{C}_{1}} / x$

We can test the validity of this answer by plugging it into $\textcolor{red}{E q u a t i o n 4}$ and see that it works.

Since the whole differential equation will be multiplied by ${e}^{{C}_{1}} / x$, the constant part ${e}^{{C}_{1}}$ can be ignored and:

$\mu \left(x\right) = \frac{1}{x}$ is our integration factor. Let's multiply the above $\textcolor{b l u e}{O D E}$ by $\frac{1}{x}$:

$\frac{1}{x} \cdot \frac{d}{\mathrm{dx}} y - \frac{1}{x} \cdot \frac{1}{x} y = - \frac{1}{x} \cdot 2 {x}^{2}$

$\frac{\frac{d}{\mathrm{dx}} \left(y\right)}{x} - \frac{y}{x} ^ 2 = - 2 x$

But we know that if we differentiate $\frac{1}{x} y$ using the product rule we get:

$\frac{d}{\mathrm{dx}} \left(\frac{1}{x} y\right) = \frac{1}{x} y ' - \frac{1}{x} ^ 2 y = \frac{\frac{d}{\mathrm{dx}} \left(y\right)}{x} - \frac{y}{x} ^ 2$

Therefore:

$\frac{d}{\mathrm{dx}} \left(\frac{1}{x} y\right) = - 2 x$

Now, we integrate both sides:

$\frac{1}{x} y = \int - 2 x \mathrm{dx}$

$\frac{1}{x} y = - {x}^{2} + {C}_{1}$

Let's multiply both sides by $x$:

$x \cdot \frac{1}{x} y = x \left(- {x}^{2}\right) + x {C}_{1}$

$\cancel{\textcolor{red}{x}} \cdot \frac{1}{\cancel{\textcolor{red}{x}}} y = x \left(- {x}^{2}\right) + x {C}_{1}$

$y = - {x}^{3} + x {C}_{1}$

Feb 17, 2018

$y = C x - {x}^{3}$

#### Explanation:

We can use an integrating factor when we have a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

We have:

$\left(2 {x}^{3} - y\right) \mathrm{dx} + x \mathrm{dy} = 0$

Which we can equivalently write in the above standard form as:

$\frac{\mathrm{dy}}{\mathrm{dx}} - \frac{y}{x} = - 2 {x}^{2}$ ..... [A]

So we compute and integrating factor, $I$, using;

$I = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\setminus \setminus = \exp \left(\int \setminus - \frac{1}{x} \setminus \mathrm{dx}\right)$
$\setminus \setminus = \exp \left(- \ln x\right)$
$\setminus \setminus = \frac{1}{x}$

And if we multiply the DE [A] by this Integrating Factor, $I$, we will have a perfect product differential;

$\frac{1}{x} \frac{\mathrm{dy}}{\mathrm{dx}} - \frac{y}{x} ^ 2 = - 2 x$

$\therefore \frac{d}{\mathrm{dx}} \left(\frac{y}{x}\right) = - 2 x$

This has transformed our initial ODE into a Separable ODE, so we can now "separate the variables" to get::

$\frac{y}{x} = \int \setminus - 2 x \setminus \mathrm{dx}$

This is a standradfunction, so we can integrate to get:

$\frac{y}{x} = - {x}^{2} + C$

Leading to the General Solution of the ODE:

$y = C x - {x}^{3}$

Feb 17, 2018

See below.

#### Explanation:

$\left(2 {x}^{3} - y\right) \mathrm{dx} + x \mathrm{dy} = 0$ or

$2 {x}^{3} \mathrm{dx} - y \mathrm{dx} + x \mathrm{dy} = 0$

Now dividing by ${x}^{2}$

$2 x - \frac{y}{x} ^ 2 \mathrm{dx} + \frac{\mathrm{dy}}{x} = 0$ but this is the differential

$d \left({x}^{2} + \frac{y}{x}\right) = 0$ hence

${x}^{2} + \frac{y}{x} = {C}_{0}$ or

$y = {C}_{0} x - {x}^{3}$