# How to solve this 2nd order nonlinear differential equation

Hello all,

This is the first time Ive stumbled across this site, but it appears to be extremely helpful. I am a meteorology grad student, and in my research, I have run across the following 2nd order non linear differential equation. It is of the form:

y'' + a*y*y' + b*y=0

where a and b are constants

Can this equation be solved analytically? If not, what program does one recommend for solving it numerically? There is also a slightly more complex form of this equation:

y'' + a*y*y' + b*y=c

where a, b and c are constants

If anyone could assist me in solving this or direct me to a source for solving it numerically, it would be most appreciated.

Thanks,

slider142
Try the substitution y' = u to reduce it to a first order system of two ODEs. (Source:Tenenbaum/Pollard)
Ie., your first ODE becomes the system y' = u, uu' = -ayu - by, where in the second eq. u is treated as u(y) and u' = du/dy, which we can then plug into the first equation to integrate for y(x). The second equation is separable, so there is a straightforward analytic solution.

Last edited:
Try the substitution y' = u to reduce it to a first order system of two ODEs. (Source:Tenenbaum/Pollard)
Ie., your first ODE becomes the system y' = u, uu' = -ayu - by, where in the second eq. u is treated as u(y) and u' = du/dy, which we can then plug into the first equation to integrate for y(x). The second equation is separable, so there is a straightforward analytic solution.

slider,

Im not following you. Could you go into a let more detail if possible. Thanks,

Homework Helper
Assuming y is function of x, y' = u. u' = d^2y/dx^2 = d/dy (dy/dx) dy/dx by the chain rule. This is equivalent to u du/dy. Hence u' = u du/dy.

After substituting for y' = u, the ODE is u' = -ayu - by. Replacing u' with u du/dy gives:
u du/dy = -y(au+b) This equation is separable and hence solvable. Once you have u(y), you have dy/dx = u(y), which is again separable and solvable.

Assuming y is function of x, y' = u. u' = d^2y/dx^2 = d/dy (dy/dx) dy/dx by the chain rule. This is equivalent to u du/dy. Hence u' = u du/dy.

After substituting for y' = u, the ODE is u' = -ayu - by. Replacing u' with u du/dy gives:
u du/dy = -y(au+b) This equation is separable and hence solvable. Once you have u(y), you have dy/dx = u(y), which is again separable and solvable.

defennder,

I understand how you get: u' = -ayu - by when you set y'=u

I dont understand how u'=u du/dy . I appreciate you trying to work me through this. Any additional explanation would be appreciated.

Specifcally, how is this so:

d^2y/dx^2 = d/dy (dy/dx) dy/dx

Last edited:
Homework Helper
That follows from the chain rule.

$$\frac{d^2y}{dx^2} = \frac{d}{dx} \left ( \frac{dy}{dx} \right ) = \frac{d}{dy} \left ( \frac{dy}{dx} \right ) \ \frac{dy}{dx}$$

Replace $$\frac{dy}{dx}$$ with u.

After substituting for y' = u, the ODE is u' = -ayu - by. Replacing u' with u du/dy gives:
u du/dy = -y(au+b) This equation is separable and hence solvable. Once you have u(y), you have dy/dx = u(y), which is again separable and solvable.

When I solve u' = -ayu - by I get:

$$\frac{u}{a}-\frac{b}{a^2}ln[|{au+b}|]+C_1 =-\frac{1}{2}y^2 + C_2$$

So then we need to make the above equation u=u(y) correct? Since we have a ln (natural log), is this possible? Any more help is most appreciated. Thanks,

anyone care to comment on the solution?

anyone???

Homework Helper
When I solve u' = -ayu - by I get:

$$\frac{u}{a}-\frac{b}{a^2}ln[|{au+b}|]+C_1 =-\frac{1}{2}y^2 + C_2$$

So then we need to make the above equation u=u(y) correct? Since we have a ln (natural log), is this possible? Any more help is most appreciated. Thanks,

I don't get that. From du/dy= -y(au+ b) we can get du/(au+b)= -ydy so, integrating both sides, (1/a)ln(au+ b)= -(1/2)y2+ C. I don't know what you mean by "make u= u(y) correct". Solve for u? Without your additional "u/a" that's easy:
$$au+ b= C'e^{-\frac{y^2}{2}}$$
where C'= aeC.

Homework Helper
I don't get that. From du/dy= -y(au+ b) we can get du/(au+b)= -ydy so, integrating both sides, (1/a)ln(au+ b)= -(1/2)y2+ C. I don't know what you mean by "make u= u(y) correct". Solve for u? Without your additional "u/a" that's easy:
$$au+ b= C'e^{-\frac{y^2}{2}}$$
where C'= aeC.
Actually u' isn't du/dy.

$$u' = \frac{du}{dx} = \frac{du}{dy} (\frac{dy}{dx}) = u \frac{du}{dy}$$

That's where the u/a term comes, once you do long division of u/(au+b).

Actually u' isn't du/dy.

$$u' = \frac{du}{dx} = \frac{du}{dy} (\frac{dy}{dx}) = u \frac{du}{dy}$$

That's where the u/a term comes, once you do long division of u/(au+b).

Defennder,

How do you rewrite u in terms of y only? Can it be done?

Homework Helper
Honestly I have no idea if it's possible. It never occurred to me earlier because I didn't actually attempted the DE itself, I just noted it would be solvable if such could be done.

Homework Helper
Defennder,

How do you rewrite u in terms of y only? Can it be done?

Yes, that is a simple application of the chain rule. In fact, that application to differential equations is a standard method called "quadrature"

Homework Helper
Actually he was referring to this post:
When I solve u' = -ayu - by I get:

$$\frac{u}{a}-\frac{b}{a^2}ln[|{au+b}|]+C_1 =-\frac{1}{2}y^2 + C_2$$

So then we need to make the above equation u=u(y) correct? Since we have a ln (natural log), is this possible? Any more help is most appreciated. Thanks,

I really don't see how to write u in terms of y there. And anyway the post which resurrected this thread and which preceded yours appears to have been deleted.

ceramica
Does anyone can help me to solve this second order non linear ODE:

y'' + (2/x)(y') - (1/2y)(y')(y') = K,

y' = dy/dx

y'' = dy'/dx

y = y(x)

I've already guess y=Ax^2 satisty this equation, but I want to solve it analitically..

Thank before..

Miriam100
Hi,
I'm trying to solve y''(t) + w02 y(t) = k y(t)2 sin(w t). Does anybody know, how to get a particular solution?

Thanks.

Homework Helper
Hi,
I'm trying to solve y''(t) + w02 y(t) = k y(t)2 sin(w t). Does anybody know, how to get a particular solution?

Thanks.

There's probably no general analytic expression. At least, wolfram alpha doesn't give one, even when I give it initial conditions.

How large is k supposed to be compared to $\omega_0^2$? If it's supposed to be small, you could do perturbation theory to get an approximation solution valid when $ky(t) \ll \omega_0^2$.

michaelc187
try (f(x+0) - f(x))/0
divide out the zero
and say tadah, solved numerically. whatever the hell that means.

Last edited:
Miriam100
Thanks for your help. The instructions say 'solve the problem analitically', so I guess I counstructed a wrong equation. It's without y^2, so there's no problem anymore. Tnx.

Dickfore
To recap:

$$u \equiv y'$$

Then, the second derivative became:

$$y'' = \frac{d y'}{d x} = \frac{d u}{d y} \frac{d y}{d x} = u \frac{d u}{d y}$$

$$u u' + a y u + b y = c$$
where $u' \equiv du/dy$. I think some previous posters made a mistake in converting the second derivative.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9449764,"math_prob":0.9884747,"size":1350,"snap":"2022-27-2022-33","text_gpt3_token_len":341,"char_repetition_ratio":0.104011886,"word_repetition_ratio":0.9430894,"special_character_ratio":0.24666667,"punctuation_ratio":0.1024735,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99980766,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-10T23:40:54Z\",\"WARC-Record-ID\":\"<urn:uuid:77290dc5-77cc-443d-9033-ddec606a0c2c>\",\"Content-Length\":\"123491\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dfa09868-9d52-4d8a-bdee-1d0ca9122d1b>\",\"WARC-Concurrent-To\":\"<urn:uuid:85d3cc08-1019-4af5-a090-0110b5f8e62b>\",\"WARC-IP-Address\":\"104.26.14.132\",\"WARC-Target-URI\":\"https://www.physicsforums.com/threads/how-to-solve-this-2nd-order-nonlinear-differential-equation.235402/\",\"WARC-Payload-Digest\":\"sha1:LZ2VLINYZDYLZ3TJXH7WOJ4O5XPXCLDI\",\"WARC-Block-Digest\":\"sha1:7VJLFWXQ5ZRXNT3OUTUKLDVILNLLPSEA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882571222.74_warc_CC-MAIN-20220810222056-20220811012056-00002.warc.gz\"}"}