Solving ODEs: 2 Problems for Beginners

  • Thread starter *Alice*
  • Start date
  • Tags
    Odes
In summary, In Problem 1, you are trying to find the solution for y=f, but you get stuck because you don't know how to integrate. In Problem 2, you are trying to find (lny-x) dy/dx - ylny =0, but you get stuck because you don't know how to integrate. Finally, in Problem 3, you are trying to find z=ln(y)-x, but you get stuck because you don't understand how to integrate.
  • #1
*Alice*
26
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
  • #2
*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.
 
  • #3
*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.
 
  • #4
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
 
  • #5
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?
 
  • #6
*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.
 
  • #7
*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:
 
  • #8
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
 
  • #9
*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)
 

FAQ: Solving ODEs: 2 Problems for Beginners

What are ordinary differential equations (ODEs)?

ODEs are mathematical equations that involve a function and its derivatives. They are used to model a wide variety of phenomena in science and engineering, such as population growth, chemical reactions, and motion of objects.

How do I solve ODEs?

There are various methods for solving ODEs, including analytical and numerical methods. Analytical methods involve finding an exact solution using mathematical techniques, while numerical methods use algorithms to approximate the solution. The method used depends on the complexity of the equation and the desired level of accuracy.

What are initial value problems (IVPs)?

IVPs are a type of ODE that involves finding the solution of an equation with a given initial condition. This initial condition specifies the value of the function at a certain point, and the goal is to find the function that satisfies the equation and this condition.

What are boundary value problems (BVPs)?

BVPs are another type of ODE that involves finding the solution of an equation with given boundary conditions. These conditions specify the value of the function at different points or intervals, and the goal is to find the function that satisfies the equation and these conditions.

Why are ODEs important in science?

ODEs are important because they provide a mathematical framework for understanding and predicting the behavior of dynamic systems. They are used in a wide range of scientific fields, from physics and chemistry to biology and economics, to model and analyze complex systems. Solving ODEs allows scientists to make predictions and gain insights into the behavior of these systems.

Back
Top