If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Integral Calculus

### Course: Integral Calculus>Unit 2

Lesson 5: Approximation with Euler’s method

# Worked example: Euler's method

Finding the initial condition based on the result of approximating with Euler's method.

## Want to join the conversation?

• Why doesn't this work backwards?

x y dy/dx = 3x - 2y
2 4.5 3(2) - 2(4.5) = 6 - 9 = -3 => 4.5 - (-3) = 7.5
1 7.5 3(1) - 2(7.5) = 3 - 15 = -12 => 3 - (-12) = 15
0 15
k != 15 != 1.5
:(
• When approacimating from a correct point, the error starts from small. If you do backwards, the starting point is not a correct point, it's with a huge error already, and then when you go step by step, the error grows even bigger.
• I'm just not getting Euler's Method in practise. I get the theory behind it. I just can't seem to execute it properly. I don't find that examples with step size of 1 very useful because you can't track it backwards (we often skip in examples writing out multiplying by 1 because it's obvious what the answer is). An example with step size 0.5 would more clearly show the process.
• Think of it this way,

dy/dx is essentially the slope at a given point of a function. In euler's method, with the steps, you can say for example, if step is 0.5 (or Delta X, i.e change in x is 0.5), you will have:

dy/dx is given thanks to differential equation and initial condition. You just plug it in and get a value. y1 is the y value at which the slope is the dy/dx and y2 is the y you're looking for. Delta X is change in x , i.e the increment or steps. Or you can think of it as delta X= x2 - x1. But you know the change or steps is 0.5.
dy/dx = (y2-y1)/0.5

You know y1, to find y2 you solve by multiplying

The above is a slope formula, change of y over change of x.
• At Sal says to increment y by -2k. Why do we just add -2k instead of going by the slope..?
• That's simply coming from the slope equation: d𝒚/d𝒙= (𝒚₂-𝒚₁)/(𝒙₂-𝒙₁) = (𝒚₂-𝒚₁)/Δ𝒙, and since the step size or Δ𝒙 is set to be equal 1
then: d𝒚/d𝒙= 𝒚₂-𝒚₁
𝒚₂= (d𝒚/d𝒙) - 𝒚₁
plugging in our given data: 𝒚₂= −2𝒌 - 𝒌 = −𝒌 (and that's where approximation process lies in as you use the previous slope to estimate the next point. Also, as you decrease the step size or Δ𝒙 to infinitely small number, the result is gonna be much more accurate).

If you used the first slope every time you calculate 𝒚₂, you've just assumed the function is a straight line (same slope) and you have no evidence for that except the given equation -the differential equation- for calculating the slope or the derivative of our function. So you must calculate the slope every time you've evaluated 𝒚₂ to know where the curve (or the line) is going next.
• here is how to get the next y(the new y) (just an easy solution made by pattern recognition)

𝒚₂(newy) = (dy/dx * stepsize) + 𝒚₁(oldy)
• does dy/dx refer only to the change in y simply because the step size of x is one? what would happen if the step size was .5 or 2?
• To find the change in y (dy), you must multiply dy/dx by dx. Because dx in this problem was 1, dy/dx was the same as dy. However, the step size (dx) was .5, we would have to multiply dy/dx by .5 and then add that value to the previous y-value to get the new y-value.
• At the end of the video ( onward), Sal says 3+k = 4.5 and gets k = 1.5... why is that so? What I do not understand here is why y is equal to the slope? In previous steps the function was used, so the calculation for the slope was 3x - 2y. If we implement that here, shouldn't be dy/dx = 3*(2) - 2y = 4.5. Then, if y = 3-k, we get 6 - 2*(3-k) = 4.5, with the result k = 2.25?

• how would you answer a questin like this?
let y(x) be the particular solution that contains (0,1). Using Euler's method with step size h=0.5, what is the estimate for y(0.5)?

I don't knowhow to do it because there is no initial condition
• Given problem does not present a clue to find the slope of the tangent line at point (0,1). We have to know the differential equation of a function or derivative of function or function itself to figure out the slope.
• What if I start at x=1 but want to find the approximation of f(0) with 2 steps of equal length?
• You'd use the same process.
f(0.5) = f(1) + f'(1, f(1)) * (-0.5)
f(0) = f(0.5) + f'(0.5, f(0.5)) * (-0.5).