Can Euler's Method Solve y'=y/x with Initial Conditions?

  • Context: Undergrad 
  • Thread starter Thread starter lydia_zhu
  • Start date Start date
  • Tags Tags
    Euler's method Method
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
lydia_zhu
Messages
1
Reaction score
0
Hi everyone.

I was asked to learn Euler's method by myself but I was really confused with this question. How can I work out this equation by using Eulers' method (which is a method solving first order fifferencial equation with initial conditions)
Given:y'=y/x, y(2)=3, use h=0.2, what is y(2.8) ?

thanks very much!
 
Physics news on Phys.org
You write
[tex] \frac{dy}{dx}=\frac{y(x+h)-y(x)}{h}[/tex]
to obtain:
[tex] \frac{y(x+h)-y(x)}{h}=y(x)/x[/tex]
To obtain:
[tex] y(x+h)=y(x)+\frac{y(x)h}{x}[/tex]
start with [tex]y(2)[/tex] and increment.