Cannot isolate y (first order quadratic DE?)

GreenGoblin

Member
I am required to solve two versions of the similar equation for y(x). I think this would be called a quadratic first order differential equation, but I don't even know if that is the correct name:

1)[TEX]\frac{dy}{dx}=y - \frac{y^{2}}{10} - 0.9[/TEX]
2)[TEX]\frac{dy}{dx}=y - \frac{y^{2}}{10} - 5[/TEX]

Confidence exists that if I can do one I can do the other since its just changing one value. Let's try the first.

What I tried:

Dividing through the RHS and multiplying by dx, integrating, I get obviously log of the function times 1/ the derivative of the log = x. BUT, then I don't know how to get the y on its own. Basically, I am used to linear problems only. I don't know how to isolate y here because if I take exponents it gets stuck in there and the whole thing gets messy. I would think this is a pretty common problem that once learned is learned. But I haven't learned it and don't know where to. Can anyone help?

MarkFL

Staff member
If given an ODE of the form:

$\displaystyle \frac{dy}{dx}=ay^2+by+c$

I would rewrite it as (separating variables):

$\displaystyle \frac{dy}{ay^2+by+c}=dx$

Next, I would complete the square on the denominator on the left, to get either a sum of squares (resulting in an inverse tangent anti-derivative) or a difference of squares (resulting in a logarithmic anti-derivative through partial fractions).

Many times you will get an implicit solution, although in this case you may choose to express $x$ as a function of $y$.

Another option would be to compute an integrating factor, resulting in an exact ODE.

GreenGoblin

Member
If given an ODE of the form:

$\displaystyle \frac{dy}{dx}=ay^2+by+c$

I would rewrite it as (separating variables):

$\displaystyle \frac{dy}{ay^2+by+c}=dx$

Next, I would complete the square on the denominator on the left, to get either a sum of squares (resulting in an inverse tangent anti-derivative) or a difference of squares (resulting in a logarithmic anti-derivative through partial fractions).

Many times you will get an implicit solution, although in this case you may choose to express $x$ as a function of $y$.

Another option would be to compute an integrating factor, resulting in an exact ODE.
Thanks for your reply, using the method you said I lead to: [TEX]\frac{-1}{10}\frac{dy}{(y-5)^{2}-16}= dx[/TEX]. IS this useful? How can I make it into partial fractions as you say?

MarkFL

Staff member
Thanks for your reply, using the method you said I lead to: [TEX]\frac{-1}{10}\frac{dy}{(y-5)^{2}-16}= dx[/TEX]. IS this useful? How can I make it into partial fractions as you say?
Yes, this is correct for the first equation you gave. To simplify a bit, I would use the substitution:

$u=y-5\,\therefore\,du=dy$

and multiply through by 10 to get:

$\displaystyle \frac{du}{4^2-u^2}=10\,dx$

Use the difference of squares formula:

$\displaystyle \frac{du}{(4+u)(4-u)}=10\,dx$

Now, for the integrand on the left, assume the partial fraction decomposition has the form:

$\displaystyle \frac{1}{(4+u)(4-u)}=\frac{A}{4+u}+\frac{B}{4-u}$

Using the Heaviside cover-up method, we find:

$\displaystyle A=B=\frac{1}{8}$ hence:

$\displaystyle \frac{1}{(4+u)(4-u)}=\frac{1}{8}\left(\frac{1}{4+u}+\frac{1}{4-u} \right)=\frac{1}{8}\left(\frac{1}{u+4}-\frac{1}{u-4} \right)$

and now we have:

$\displaystyle \left(\frac{1}{u+4}-\frac{1}{u-4} \right)\,du=80\,dx$

Now integrate, then back-substitute for $u$. In this case you can actually solve for $y$ in the end. Let us know how you progress.

GreenGoblin

Member
Yes, this is correct for the first equation you gave. To simplify a bit, I would use the substitution:

$u=y-5\,\therefore\,du=dy$

and multiply through by 10 to get:

$\displaystyle \frac{du}{4^2-u^2}=10\,dx$

Use the difference of squares formula:

$\displaystyle \frac{du}{(4+u)(4-u)}=10\,dx$

Now, for the integrand on the left, assume the partial fraction decomposition has the form:

$\displaystyle \frac{1}{(4+u)(4-u)}=\frac{A}{4+u}+\frac{B}{4-u}$

Using the Heaviside cover-up method, we find:

$\displaystyle A=B=\frac{1}{8}$ hence:

$\displaystyle \frac{1}{(4+u)(4-u)}=\frac{1}{8}\left(\frac{1}{4+u}+\frac{1}{4-u} \right)=\frac{1}{8}\left(\frac{1}{u+4}-\frac{1}{u-4} \right)$

and now we have:

$\displaystyle \left(\frac{1}{u+4}-\frac{1}{u-4} \right)\,du=80\,dx$

Now integrate, then back-substitute for $u$. In this case you can actually solve for $y$ in the end. Let us know how you progress.
What you just did is absolutely world class, I am going to work through and get an understanding, see if I get stuck again. Just want to say thanks a lot for now that gives me a lot to go with!

GreenGoblin

Member
What you just did is absolutely world class, I am going to work through and get an understanding, see if I get stuck again. Just want to say thanks a lot for now that gives me a lot to go with!
One point: have I not made a mistake with the coefficient -1/10 on the LHS, should it not be -10? Since it is in the denominator.

ZaidAlyafey

Well-known member
MHB Math Helper
Assume that we want to solve the differential equation of the form :

$$y'=ay^2+by+c$$

Let us try to solve the right hand side by the quadratic formula :

$$y=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

$$y'=(y-\frac{-b+\sqrt{b^2-4ac}}{2a})(y-\frac{-b-\sqrt{b^2-4ac}}{2a})$$

so assume that the roots are

$$k_1=\frac{-b+\sqrt{b^2-4ac}}{2a}\,\,\, k_2=\frac{-b-\sqrt{b^2-4ac}}{2a}$$

$$y'=(y-k_1)(y-k_2)$$

$$\frac{dy}{(y-k_1)(y-k_2)}=dx$$

$$\left(\frac{1}{y-k_1}-\frac{1}{y-k_2}\right)dy=dx(k_1-k_2)$$

Now integrate both sides to get :

$$\ln\left|\frac{y-k_1}{y-k_2}\right|=(k_1-k_2)x+C$$

MarkFL

Staff member
One point: have I not made a mistake with the coefficient -1/10 on the LHS, should it not be -10? Since it is in the denominator.
Yes, you are right, sorry for missing that.

MarkFL

Staff member
Assume that we want to solve the differential equation of the form :

$$y'=ay^2+by+c$$

Let us try to solve the right hand side by the quadratic formula :

$$y=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

$$y'=(y-\frac{-b+\sqrt{b^2-4ac}}{2a})(y-\frac{-b-\sqrt{b^2-4ac}}{2a})$$

so assume that the roots are

$$k_1=\frac{-b+\sqrt{b^2-4ac}}{2a}\,\,\, k_2=\frac{-b-\sqrt{b^2-4ac}}{2a}$$

$$y'=(y-k_1)(y-k_2)$$

$$\frac{dy}{(y-k_1)(y-k_2)}=dx$$

$$\left(\frac{1}{y-k_1}-\frac{1}{y-k_2}\right)dy=dx(k_1-k_2)$$

Now integrate both sides to get :

$$\ln\left|\frac{y-k_1}{y-k_2}\right|=(k_1-k_2)x+C$$
What happens when the roots are complex?

Fernando Revilla

Well-known member
MHB Math Helper
I am required to solve two versions of the similar equation for y(x). I think this would be called a quadratic first order differential equation, but I don't even know if that is the correct name:

1)[TEX]\frac{dy}{dx}=y - \frac{y^{2}}{10} - 0.9[/TEX]
2)[TEX]\frac{dy}{dx}=y - \frac{y^{2}}{10} - 5[/TEX]
Out of curiosity: $y'=ay^2+by+c$ is a separated variables equation and also a Riccati equation. If $k\in\mathbb{R}$ is a solution of the equation $at^2+bt+c=0$ then, $y_1=k$ is a particular solution, and with the substitution $y=y_1+\dfrac{1}{v}$ we get a linear equation on $v$.

At any case (as has been said) is better to solve it by separation of variables.

ZaidAlyafey

Well-known member
MHB Math Helper
What happens when the roots are complex?
I haven't considered that. Let me think about it ..

ZaidAlyafey

Well-known member
MHB Math Helper
When the roots of the polynomial are complex, this will require some knowledge of the principle logarithm in complex analysis

$$\text{Log}z = \ln|z|+i\text{Arg}(z)$$

Let us assume that we want to find the solution of the differential equation :

$$y'=y^2+1$$

Clearly this is separable and can be solved directly ...

$$y=\tan(x+C)$$

Now let us prove our method :

$$\text{Log}\left( \frac{y-k_1}{y-k_2}\right)=(k_1-k_2)x+C$$

we have that $k_1=i$ and $k_2=-i$

$$\text{Log}\left(\frac{y-i}{y+i}\right)=2ix+C_1$$

Now we multiply by the conjugate :

$$\text{Log}\left(\frac{(y-i)^2}{y^2+1}\right)=2ix+C_1$$

$$2\text{Log}(y-i)-\ln{(y^2+1)}=2ix+C_1$$

$$\text{Log}{(y-i)}=\ln \sqrt{(y^2+1)}+i\arctan\left(\frac{-1}{y}\right)=\frac{1}{2}\ln(y^2+1)+i\arctan(y)+C_2$$

$$2\left(\frac{1}{2} \ln (y^2+1)+i\arctan(y)+C_2\right)-\ln{(y^2+1)}=2ix+C_1$$

$$\ln(y^2+1)+2i\arctan(y)-\ln{(y^2+1)}=2ix+C_3$$

$$\arctan(y)=x+C$$

$$y=\tan(x+C)$$