+0

0
2572
12
+1491

Let y = f(x) be the solution to the differential equation (dy/dx) = x + y with the initial condition f(1) = 2. What is the approximation for f(2) if Euler's method is used, starting at x = 1 with a step size of 0.5?

l'm not too keen on Euler's method, if anyone cares to enlighten me, or better yet... twist a red hot knife into my innards. Be my guest.

Apr 17, 2017

#1
+1512
0

Nah I'd rather not

Apr 17, 2017
#2
+312
+1

I dont think finding f(2) is possible....

f'(x)=x+f(x)--------->

f'''(x)=(x)''+f''(x)=f''(x)----->

f''(x)=c1*ex------->

f(x)=c1*ex+c2*x+c3

f(1)=c1*e+c2+c3=2-------------->

c3=2-c2-c1*e

f(2)=c1*e2+c2*2+c3=

c1*e2+c2+2-c1*e

edit: OH SHOOT I FORGOT SOMETHING

f'(x)=c2+c1*ex=x+c3+c2*x+c1*ex  | subtract c1*ex ----->

c2=x+c3+c2*x. therefore, c2=-1(the only option. that means c3=c2=-1 and that means

f(1)=c1*e-2=2 therefore c1=4/e

that means f(2)=4*e-2-1=4e-3.

Apr 17, 2017
edited by Ehrlich  Apr 17, 2017
#3
+1512
0

Yea @Ehrlich your definately not 4.

MysticalJaycat  Apr 17, 2017
#4
+312
0

what?

Ehrlich  Apr 17, 2017
#5
+1512
0

What do you mean what.

MysticalJaycat  Apr 17, 2017
#6
+312
0

Ehrlich  Apr 17, 2017
#8
+33266
+1

As follows:

So f(2) = y(2) = 6

.

Apr 18, 2017
#10
+312
0

But the function is 4/e*ex-x-1 isnt it? isnt it f(2)=4e-3?

Ehrlich  Apr 18, 2017
#11
+33266
+2

Yes, the exact result gives f(2) = 4e - 3 ≈ 7.8, as illustrated in my graph.

Euler's approximate numerical method lags well behind the exact function.

Alan  Apr 18, 2017
#9
+33266
+1

You are right not to be keen on Euler's method, especially with a step size this large - see the comparison below:

.

Apr 18, 2017
#12
+1491
0

Hm l think l've developed a method of doing a shortened Eulers method, I got the same answer afterwards. It may help!

yn - (dy/dx) * (step size) = yn+1

Apr 18, 2017