1. ## First-order linear ode

Solve the ordinary differential equation:

$xy^2 + 4\frac{dy}{dx} = 4x$

Attempt:

$\frac{dy}{dx} + \frac{xy^2}{4} = x$

(I tried to get it into the form of $\frac{dy}{dx} + p(x)y = q(x)$ of a first-order linear ode, but in this case the $y$ is $y^2$)

I then found $e^{P(x)}$, where $P(x)$ is an anti-derivative of $p(x)$

In this case $p(x) = \frac{x}{4}$ therefore I got $e^{P(x)} =e^{\frac{x^2}{8}}$

$e^\frac{x^2}{8}\frac{dy}{dx} + \frac{xy^2e^{\frac{x^2}{8}}}{4} = xe^{\frac{x^2}{8}}$
$
\frac{d}{dx}(ye^\frac{x^2}{8}) = xe^{\frac{x^2}{8}}$

but this doesnt seem correct

2. It's separable.

3. Originally Posted by SyNtHeSiS
but this doesnt seem correct
'cause it's not linear.

4. Oh ok. How do you know when a differential equation is separable or linear?

Here is my working out:
$
xy^2 + 4\frac{dy}{dx} = 4x$

$\frac{dy}{dx} + \frac{xy^2}{4} = x$
$\frac{dy}{dx} = x - \frac{xy^2}{4}$
$\frac{dy}{dx} = x(1- \frac{y^2}{4})$
$dy = x(1 - \frac{y^2}{4})dx$
$\int \frac{1}{(1 - \frac{y^2}{4})}dy = \int x dx$
$\int\frac{1}{(1 - \frac{y}{2})(1 + \frac{y}{2})}dy = \frac{1}{2}x^2 + C$

I then used partial fractions to get:

$\int \frac{\frac{1}{2}}{(1 - \frac{y}{2})} + \frac{\frac{1}{2}}{(1 + \frac{y}{2})}dy = \frac{1}{2}x^2 + C$

but this obviously isnt right

5. Originally Posted by SyNtHeSiS
Oh ok. How do you know when a differential equation is separable or linear?

Here is my working out:
$
xy^2 + 4\frac{dy}{dx} = 4x$

$\frac{dy}{dx} + \frac{xy^2}{4} = x$
$\frac{dy}{dx} = x - \frac{xy^2}{4}$
$\frac{dy}{dx} = x(1- \frac{y^2}{4})$
$dy = x(1 - \frac{y^2}{4})dx$
$\int \frac{1}{(1 - \frac{y^2}{4})}dy = \int x dx$
$\int\frac{1}{(1 - \frac{y}{2})(1 + \frac{y}{2})}dy = \frac{1}{2}x^2 + C$

I then used partial fractions to get:

$\int \frac{\frac{1}{2}}{(1 - \frac{y}{2})} + \frac{\frac{1}{2}}{(1 + \frac{y}{2})}dy = \frac{1}{2}x^2 + C$

but this obviously isnt right Mr F asks: Why so you say that?
Why not simplify to

$\displaystyle \int \frac{1}{(2 - y)} + \frac{1}{(2 + y)}dy = \frac{1}{2}x^2 + C$

(assuming there are no careless arithmetic errors - I haven't checked closely but it all looks OK).

6. I am not getting the right answer in my book:

$y = -2$ or $y = 2\frac{1 - ke^{\frac{-x^2}{2}}}{1 +ke^{\frac{-x^2}{2}}}$

From $\displaystyle \int \frac{1}{(2 - y)} + \frac{1}{(2 + y)}dy = \frac{1}{2}x^2 + C$ I got:

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

$ln|4 - y^2| = \frac{1}{2}x^2 + C$
$4 - y^2 = e^{\frac{1}{2}x^2}e^c$
$y = \pm\sqrt{4 - Ke^{\frac{1}{2}x^2}}
$

7. $\ln|2 - y| + \ln|2 + y| = \dfrac{1}{2}x^{2} + C$
You have an error in there that might change things. Correction:

$-\ln|2 - y| + \ln|2 + y| = \dfrac{1}{2}x^{2} + C$

What does that give you?

8. Originally Posted by SyNtHeSiS
$y = \pm\sqrt{4 - Ke^{\frac{1}{2}x^2}}
$
Looks good to me. Have you checked the answer works? i.e. taking its first derivative and substituting it back into the original DE.

9. Originally Posted by Ackbeet
You have an error in there that might change things. Correction:

$-\ln|2 - y| + \ln|2 + y| = \dfrac{1}{2}x^{2} + C$

What does that give you?
Why is it $-\ln|2 - y|$? I cant seem to find a minus sign that I overlooked in my working.

10. Why is it $-\ln|2 - y|$? I cant seem to find a minus sign that I overlooked in my working.
Because

$\displaystyle \int \frac{1}{2 - y}\,dy=-\int\frac{1}{y-2}\,dy=-\ln|y-2|+C.$

The logarithm rule only works if the variable of integration is positive in the denominator.

11. Originally Posted by Ackbeet
Because

$\displaystyle \int \frac{1}{2 - y}\,dy=-\int\frac{1}{y-2}\,dy=-\ln|y-2|+C.$

The logarithm rule only works if the variable of integration is positive in the denominator.
I tried it the long way:

$\int \frac{1}{2 - y}dy$

$u = 2 -y$
$du = -dy$
$dy = -du$

$\int -\frac{1}{u}dy$
$= -ln|2 - y| + C$

I dont understand why I got a different answer to yours, since my steps seem fine

13. Oh ok. Using what you said, this is the working I got:

$-\int \frac{1}{(y - 2)} + \frac{1}{(y + 2)} dy = \frac{1}{2}x^2 + C$

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

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

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

$y + 2 = (y - 2)Ke^{\frac{1}{2}x^2}$

$y(1 - Ke^{\frac{1}{2}x^2}) = -2Ke^{\frac{1}{2}x^2} - 2$

$y = \frac{-2Ke^{\frac{1}{2}x^2} - 2}{1 - Ke^{\frac{1}{2}x^2}}$

$y = -2\frac{(1 + Ke^{\frac{1}{2}x^2} )}{(1 - Ke^{\frac{1}{2}x^2})}$

but I am still not getting:

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

14. Multiply top and bottom by $e^{-x^{2}/2}.$ You're still not going to have the same signs as the answer you're aiming for. But, since $k$ is an arbitrary constant, replace $k$ with $-k,$ and I think you'll get the final answer.

15. $y = -2\frac{(Ke^{\frac{1}{2}x^2} -2)}{(1 - Ke^{\frac{1}{2}x^2})}$

$= -2\frac{(1 + Ke^{\frac{1}{2}x^2})}{(1 - Ke^{\frac{1}{2}x^2})}$

Multiplying the top and bottom by $e^{-\frac{1}{2}x^2}$ I got:

$=-2\frac{(e^{-\frac{1}{2}x^2} + K)}{(e^{-\frac{1}{2}x^2} - K)}$

If you change the K in the denominator to +K, then the answer is y = -2 (which was one of the solutions), but how else would you manipulate it to get:

$y = 2\frac{(1 - ke^{\frac{-x^2}{2}})}{(1 +ke^{\frac{-x^2}{2}})}$

Page 1 of 2 12 Last