Solving ODEs: 2 Problems for Beginners

  • Thread starter Thread starter *Alice*
  • Start date Start date
  • Tags Tags
    Odes
Click For Summary

Homework Help Overview

The discussion revolves around two problems related to ordinary differential equations (ODEs). The first problem involves solving a nonlinear ODE of the form dy/dx + y = y^2 (cosx - sinx), while the second problem is a separable equation expressed as (lny - x) dy/dx - ylny = 0. Participants are exploring various methods and substitutions to approach these problems.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss substitution methods for the first problem, including attempts to use integration by parts and integrating factors. Questions arise about the correctness of transformations and the nature of the equations. For the second problem, participants explore the implications of rewriting the equation and question how to proceed with solving it as an exact equation.

Discussion Status

There is active engagement with multiple interpretations of the problems. Some participants have offered guidance on integration techniques and the nature of exact equations, while others express confusion about the transformations and the steps needed to solve the equations. No consensus has been reached, but productive lines of inquiry are being explored.

Contextual Notes

Participants are navigating through the complexities of nonlinear ODEs and exact equations, with some expressing uncertainty about specific integration techniques and the validity of their approaches. The original poster has requested hints rather than complete solutions, aligning with the forum's guidelines.

*Alice*
Messages
26
Reaction score
0
:-p Hi all,

I'm new here and was wondering whether anyone could give me a hint on the following two problems about ODEs (oh...and also, can anyone tell me where can I find this formula editor?):

Problem 1

find the solution for
dy/dx + y = y^2 (cosx - sinx)

try substitution: f = y^n
so: dy/dx = 1/(n*y^(n-1)) * df/dx

so ODE becomes

df/dx + ny = ny^(n+1)(cosx - sinx)

let n = (-1)

df/dx - y = sinx - cosx

Integrating factor

k(x) = e^(-x)

so
y = Integral (k(x) * P(x)) / k(x) , where P(x) = sinx -cosx

giving:
y = [Integral (e^(-x) (sinx - cos))] / e^(-x)

here I got stuck, as I don't know how to integrate this


Problem 2

(lny - x) dy/dx - ylny =0


try : z = lny

giving: d*dz/dx = dy/dx

substituting in ODE:

(z-x)y*dz/dx - yz = 0

where y = e^z (>=0)

don't know how to go on from here!



THANKS SO MUCH FOR YOUR HELP!
:smile:
 
Physics news on Phys.org
*Alice* said:
y = [Integral (e^(-x) (sinx - cos))] / e^(-x)
here I got stuck, as I don't know how to integrate this
The way to do this is with integration by parts, but there is a trick. I'll take the first part of the integral:
[tex]\int e^{-x}\sin{x}dx=-e^{-x}\sin{x}-\int -e^{-x}\cos{x}dx[/tex]
[tex]=-e^{-x}\sin{x}+(-e^{-x}\cos{x} - \int (-e^x)(-\sin{x})dx)[/tex]
[tex]=-e^{-x}\sin{x} - e^{-x}\cos{x} -\int e^{-x}\sin{x}dx[/tex]
So it looks like we're back where we started, but notice the minus sign in front of the integral. This allows us to add the integral to both sides of the equation:
[tex]\int e^{-x}\sin{x}dx=-e^{-x}\sin{x} - e^{-x}\cos{x} -\int e^x\sin{x}dx[/tex]
[tex]2\int e^{-x}\sin{x}dx=-e^{-x}\sin{x} - e^{-x}\cos{x}[/tex]
Or
[tex]\int e^{-x}\sin{x}dx=\frac{-1}{2}[e^{-x}\sin{x} + e^{-x}\cos{x}][/tex]
*Alice* said:
(oh...and also, can anyone tell me where can I find this formula editor?)
Just type (tex)formula(/tex) to get your formula to appear. Just replace ( and ) with [ and ]. To see how to write the formulas just click on any formula you see and a window will pop up showing what code was used to generate it. I will look at the rest of the problems in a minute.
 
*Alice* said:
Problem 1

find the solution for
dy/dx + y = y^2 (cosx - sinx)

try substitution: f = y^n
so: dy/dx = 1/(n*y^(n-1)) * df/dx

so ODE becomes

df/dx + ny = ny^(n+1)(cosx - sinx)
No, it doesn't! It becomes
dy/dx+ ny^n= ny^(n+1)(cosx- sinx)
Taking n= -1 gives
dy/dx+ n/y= sinx- cosx which is still non-linear.

Problem 2

(lny - x) dy/dx - ylny =0


try : z = lny

giving: d*dz/dx = dy/dx

substituting in ODE:

(z-x)y*dz/dx - yz = 0
Now that's correct! Rewrite that last equation as
(z-x)dz- zdx= 0. that's an exact equation.
 
HallsofIvy said:
No, it doesn't! It becomes
dy/dx+ ny^n= ny^(n+1)(cosx- sinx)
Taking n= -1 gives
dy/dx+ n/y= sinx- cosx which is still non-linear.
Oops, didn't catch that. What about the substitution y=ef
 
Now that's correct! Rewrite that last equation as
(z-x)dz- zdx= 0. that's an exact equation.

hmmm...that's what I've come up with before. My problem here: How can I solve it as it is not separable?
 
*Alice* said:
hmmm...that's what I've come up with before. My problem here: How can I solve it as it is not separable?
It is an exact equation. Suppose you have a function f(z,x). Then by the chain rule [tex]df=\frac{\partial f}{\partial z}dz+\frac{\partial f}{\partial x}dx[/tex]. Then suppose you have a diff eq of the form M(x,z)dz+N(x,z)dx=0. If you can find a function f(z,x) such that [tex]\frac{\partial f}{\partial z}=M(x,z)[/tex] and [tex]\frac{\partial f}{\partial x}=N(x,z)[/tex], then you have that df=0, or f=constant as the solution to your equation.
 
*Alice* said:
hmmm...that's what I've come up with before. My problem here: How can I solve it as it is not separable?

Well it's exact. Same dif:

[tex](z-x)dz-zdx=0[/tex]

is:

[tex]zdz-xdz-zdx=0[/tex]

or by rearranging:

[tex]xdz+zdx=zdz[/tex]

right?

That then is just:

[tex]d(xz)=zdz[/tex]

Now turn the crank (integrate it). Tell you what, after that, solve:

[tex](ln(y)-x)y^{'}-yln(y)=0,\quad y(0)=2[/tex]

obtain an explicit expression for y(x) and then plot it from 0 to 2 (just a suggestion):smile:
 
Thanks for this.

If you integrate [tex](z-x)y' - yz = 0[/tex]

I don't understand how you obtain

[tex](lny - x)y' - ylny =0[/tex]

and from there how to find y
 
*Alice* said:
Thanks for this.
If you integrate [tex](z-x)y' - yz = 0[/tex]
I don't understand how you obtain
[tex](lny - x)y' - ylny =0[/tex]
and from there how to find y
You don't, that was the original equation. He's saying you should integrate
[tex]d(xz)=zdz[/tex]
to find the solution to this. Once you integrate, just sub in lny for z to solve for y. Then use the initial condition to solve for the unknown constant of integration.
 
  • #10
*Alice* said:
Thanks for this.
If you integrate [tex](z-x)y' - yz = 0[/tex]
I don't understand how you obtain
[tex](lny - x)y' - ylny =0[/tex]
and from there how to find y

Know what, maybe you're a bit confussed.

[tex](lny - x)y' - ylny =0[/tex]

is the differential equation. Solving it we obtain a function y(x). Now, if you take the derivative of y(x), substitute y(x), it's derivative, ln(y(x)) into the ODE, then the LHS will equal zero. That means y(x) satisfied the ODE. Integrating:

[tex](z-x)y^{'}-yz=0[/tex]

or rather:

[tex]d(xz))=zdz[/tex]

is just an intermediate step. It's

[tex]\int d(xz)=\int zd(z)[/tex]

which is just:

[tex]xz=\frac{z^2}{2}+c[/tex]

right?

So since I did that one, you integrate this one:

[tex]y^{''}d\left(y^{''}\right)=-2(y^{'})^2d\left(y^{'}\right)[/tex]

Same dif right just a bit more intimidating looking but I bet you can do it.:smile:
 
  • #11
Hey Alice, just in case you're stumped on this:

[tex]y^{''}d\left(y^{''}\right)=-2\left(y^{'}\right)^2d\left(y^{'}\right)[/tex]

is really just:

[tex]wdw=-2u^2du[/tex]

right?

Integrating:

[tex]\int wdw=-2\int u^2du[/tex]

gives:

[tex]\frac{w^2}{2}=-2/3u^3+c[/tex]

See, same dif so the one with all the derivatives is just:

[tex]\frac{\left(y^{''}\right)^2}{2}=-2/3\left(y^{'}\right)^3+c[/tex]

Don't get discouraged if you didn't see this. I see problems in here all the time I can't solve.

Oh yea, for the IVP above I got:

[tex]y(x)=Exp\left[\frac{2x+\sqrt{(2x)^2-4k}}{2}\right],\;k=-1/4(2ln2)^2[/tex]
 
Last edited:
  • #12
Thanks everyone! Part a, btw worked by substituting y= z^(-1)
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
1K
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K