Using the Euler's method (with h=10^(−n)) to find y(1) y′=sin(x)/x

Nelson Jennings 2022-07-21 Answered
Using the Euler's method (with h = 10 n ) to find y ( 1 )
y = sin ( x ) x
Since
y ( x ) = sin ( x ) x
then
f ( x , y ) = sin ( x ) x
I know
y n + 1 = y n + h f ( x n , y n )
and given y ( 0 ) = 0, so
x 0 = y 0 = 0
Therefore,
x 1 = x 0 + h = 0 + 10 0 = 1 y 1 = y ( x 1 ) = y ( 1 )
Then,
y 1 = 0 + 10 0 f ( x 0 , y 0 )
y 1 = f ( 0 , 0 )
But
f ( 0 , 0 ) = sin ( 0 ) 0 = 0 0
How am I supposed to do it?
You can still ask an expert for help

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

Solve your problem for the price of one coffee

  • Available 24/7
  • Math expert for every subject
  • Pay only if we can solve it
Ask Question

Answers (1)

Alden Holder
Answered 2022-07-22 Author has 15 answers
You have to use boundary condition y ( 0 ) = 1 (i.e. consistent boundary condition) to keep the right hand side continuous. In other words, you have to solve a bit different problem
y ( x ) = {       1                 if   x = 0 sin x x             otherwise
Otherwise it is not solvable. (The right hand side must be defined in the starting point 0, where sin x x is not.)
Did you like this example?
Subscribe for all access

Expert Community at Your Service

  • Live experts 24/7
  • Questions are typically answered in as fast as 30 minutes
  • Personalized clear answers
Learn more

You might be interested in

asked 2022-11-13
I have to write application which solves task presented below. I only know some c# so I will stick to it. It is some kind of homework but I am asking for help with understanding this and advice for implementation.

Take natural   n >= 1 and real   a > 1
differential problem
  y ( x ) = f ( x , y ( x ) ) , y ( 1 ) = 0
where   f ( x , y ) = y + 1 + x
solve for   [ 1 , a ] with step   h = a 1 n with Euler and Heun methods.

Compare results with exact solution   y ( x ) = x 2 1 by finding maximum error of each method.
asked 2022-10-21
Consider the initial value problem
{ y = 1 y 2 , t > 0 y ( 0 ) = e 1 e + 1 .
Is there a way I find a limit on the mesh-size h such that the explicit Euler method is stable? Do I need to solve the IVP to find it?
Thanks in advance.
Edit: After looking through a number of textbooks and online resources I can see that they apply a method to a linear test problem and then solve | 1 + h λ | 1. Is there any way I can do something similar to solve for h in this nonlinear case.
asked 2022-08-22
I am asked to solve the following problem. Use Euler's modified method to solve the initial value problem d x d t = 1 + x 2 t , 1 t 4 , x ( 1 ) = 0
The step size is not given here. Now, I can solve this using Euler's method but I am not able to find the formula for modified one in the mentioned textbook. So, I need the method here. I need to use the following as textbook: Brain Bradie, A friendly Introduction to Numerical Analysis (Pearson)
asked 2022-08-24
"Whats the result of one step of Backward Euler Method with h = 0.1 applied on the IVP:
y ( t ) = 5 y ( t ) + 10
y ( 0 ) = 1"?
So, been trying to understand the Backward Euler Method for a while now and almost get it. However, I don't know exactly what to do and would really appreciate to see how someone who knows what they're doing tackle this problem.
asked 2022-06-16
Euler's Method for series associates with a given series j = 0 ( 1 ) j a j the transformed series n = 0 Δ n a 0 2 n + 1 where Δ 0 a j = a j , Δ n a j = Δ n 1 a j Δ n 1 a j + 1 , j = 1 , 2 , ..
I am given that ln 2 = 1 1 2 + 1 3 1 4 + = 1 1 2 + 1 2 2 2 + 1 3 2 3 + 1 4 2 4 .

I need to prove that n = 0 Δ n a 0 2 n + 1 = 1 2 + 1 2 2 2 + 1 3 2 3 + 1 4 2 4 , but I can not figure out how. I attempt to by induction and the base case is simple enough. However, when trying to use the induction hypothesis I get stuck.

If I assume that n = 0 k Δ n a 0 2 n + 1 = 1 2 + 1 2 2 2 + 1 3 2 3 + 1 4 2 4 1 ( k + 1 ) 2 k + 1 and I add 1 ( k + 2 ) 2 k + 2 to both sides. Then I just need to show that Δ k + 1 a 0 = 1 k + 2 . However I don't see how I can.

So I know that Δ k + 1 a 0 = Δ k a 0 Δ k a 1 . From the induction hypothesis I know that Δ k a 0 = 1 k + 1 . But I would have to work with Δ k a 1 recursively. So I am not sure how to prove this.
asked 2022-11-13
We are interested in solving the advection equation u t = u x where 0 x < 1, t 0
with periodic boundary conditions and u ( x , 0 ) = f ( x ) , f ( x ) = f ( x + 1 ) In the grid x 0 , x 1 , x N , t 0 , t 1 , t N .
using the forward euler method, or v ( x j , t n + 1 ) v ( x j , t n ) Δ t = v ( x j + 1 , t n ) v ( x j 1 , t n ) 2 Δ x where v is the approximation of u at the grid points.

What I don't understand:
We are essentially using v ( x j 1 , t n ) , v ( x j , t n ) , v ( x j + 1 , t n ) to calculate v ( x j , t n + 1 ). Initially this is fine because v ( x j , 0 ) is known for all j, but how would we calculate v ( x 0 , t 1 )? we can't, since that would require us to know v ( x 1 , t 0 ) which doesn't exist. And this issue propagates, each new t n we can calculate one less point than t n 1 .
What am I missing?
asked 2022-11-08
I need to find the following integral:
1 ( 1 + x ) 1 + x x 2 d x .
I tried using Euler's formula and put x t + 1 = 1 + x x 2 and after to do integration in parts but that goes nowhere. Is there anotehr method to solve it?