1. ## Intergral of 2sinx

My question is :
Using Euler's method, solve the following di
erential equations. Determine the solu-
tion using a step size of
h = 0:5, between the interval x = [0; 2].
dy
dx
= 2 sin x, y(0) = 2
For i., what is the absolute error and relative error for y1?

I'm trying to find the intregral of 2sin(x) in order to calculate my constant.
Any help would be great with the whole question or even this part.

2. Originally Posted by kdav
My question is :
Using Euler's method, solve the following di
erential equations. Determine the solu-
tion using a step size of
h = 0:5, between the interval x = [0; 2].
dy
dx
= 2 sin x, y(0) = 2
For i., what is the absolute error and relative error for y1?

I'm trying to find the intregral of 2sin(x) in order to calculate my constant.
Any help would be great with the whole question or even this part.
Well, first, if you are studying differential equations you should have learned long ago that the integral of sin(x) is -cos(x)+ C.

But why would you want to integrate anything? The problem asks you to use "Euler's method" which is a numerical method. You should not have to do any differentiating or integrating. Just evaluate sin(x) at x= 0 and 1/2!

3. I'm confused. I use for euler's method.

y1 = y0 + h f(x,y) When y(0) = 2
y1=2 and 0.5 2sin (x)
therefore
yn+1 equals 2

But in order to calculate the absolute error i need to find ytrue ( the real number for y1 in this case) . I was always told to plug in zero for 2sinx which gives me 0. And for the absolute error it would be |2-| = 2 and the relative error would be |2/0| which is 0. But i was told this is wrong. I'm trying to find the problem i'm having with absolute and relative error.