Intuition The big picture
A first-order ODE d y d x = f ( x , y ) \dfrac{dy}{dx} = f(x,y) d x d y = f ( x , y ) does NOT directly tell you what y y y is.
It tells you the slope of the solution curve at every point ( x , y ) (x,y) ( x , y ) in the plane.
WHY this matters: If you know the slope at every point, you can "follow your nose" —
start somewhere and keep walking in the direction the slope points. That is the solution.
A direction field (slope field) is the picture of all those tiny slope arrows.
Euler's method is the numerical recipe for actually walking along them step by step.
Definition Direction field (slope field)
Given d y d x = f ( x , y ) \dfrac{dy}{dx} = f(x,y) d x d y = f ( x , y ) , at each grid point ( x , y ) (x,y) ( x , y ) draw a short line segment whose
slope is f ( x , y ) f(x,y) f ( x , y ) . The collection of all these segments is the direction field .
A solution curve through a point is the curve that is tangent to the segment at every point it passes.
WHY it works: The ODE is a constraint "your slope here must equal f ( x , y ) f(x,y) f ( x , y ) ." The segment
just visualises that constraint. A solution is any curve that obeys the constraint everywhere.
Intuition Isoclines — the lazy way to sketch
An isocline is the curve f ( x , y ) = m f(x,y)=m f ( x , y ) = m where the slope equals a fixed value m m m .
Along it, every dash has the same tilt. Sketch a few isoclines, draw parallel dashes on each,
and the field appears almost for free. (This is the 80/20 trick for sketching by hand.)
We can't always solve the ODE with formulas. But we can follow the arrows numerically.
Start at a known point ( x 0 , y 0 ) (x_0, y_0) ( x 0 , y 0 ) (the initial condition). Find y y y at later x x x values
x 1 , x 2 , … x_1, x_2, \dots x 1 , x 2 , … spaced by a small step h h h , i.e. x n + 1 = x n + h x_{n+1}=x_n+h x n + 1 = x n + h .
Derivation (first principles — local linear approximation):
The derivative is the slope of the tangent line. Near x n x_n x n , the true solution is well-approximated
by its tangent:
y ( x n + h ) ≈ y ( x n ) + h ⋅ y ′ ( x n ) . y(x_n+h) \approx y(x_n) + h\cdot y'(x_n). y ( x n + h ) ≈ y ( x n ) + h ⋅ y ′ ( x n ) .
This is just the first-order Taylor expansion :
y ( x n + h ) = y ( x n ) + h y ′ ( x n ) + h 2 2 y ′ ′ ( ξ ) . y(x_n+h)=y(x_n)+h\,y'(x_n)+\tfrac{h^2}{2}y''(\xi). y ( x n + h ) = y ( x n ) + h y ′ ( x n ) + 2 h 2 y ′′ ( ξ ) .
But the ODE gives us y ′ ( x n ) = f ( x n , y n ) y'(x_n)=f(x_n,y_n) y ′ ( x n ) = f ( x n , y n ) . Substitute and drop the h 2 h^2 h 2 remainder:
Intuition WHY the global error is
O ( h ) O(h) O ( h ) , not O ( h 2 ) O(h^2) O ( h 2 )
Each step makes error ∼ h 2 \sim h^2 ∼ h 2 . To cross an interval of length L L L you take N = L / h N=L/h N = L / h steps.
Total error ∼ N ⋅ h 2 = L h ⋅ h 2 = L h = O ( h ) \sim N\cdot h^2 = \dfrac{L}{h}\cdot h^2 = L\,h = O(h) ∼ N ⋅ h 2 = h L ⋅ h 2 = L h = O ( h ) .
So halving h h h roughly halves the total error. Euler is a first-order method.
d y d x = x + y \dfrac{dy}{dx}=x+y d x d y = x + y , y ( 0 ) = 1 y(0)=1 y ( 0 ) = 1 , with h = 0.5 h=0.5 h = 0.5 , find y ( 1 ) y(1) y ( 1 ) .
Here f ( x , y ) = x + y f(x,y)=x+y f ( x , y ) = x + y , x 0 = 0 , y 0 = 1 x_0=0,\ y_0=1 x 0 = 0 , y 0 = 1 .
Step 1 (n = 0 n=0 n = 0 ): slope = f ( 0 , 1 ) = 0 + 1 = 1 =f(0,1)=0+1=1 = f ( 0 , 1 ) = 0 + 1 = 1 .
y 1 = y 0 + h f = 1 + 0.5 ( 1 ) = 1.5 , x 1 = 0.5 y_1=y_0+h f = 1 + 0.5(1)=1.5,\qquad x_1=0.5 y 1 = y 0 + h f = 1 + 0.5 ( 1 ) = 1.5 , x 1 = 0.5
Why this step? We move right by h = 0.5 h=0.5 h = 0.5 along slope 1 1 1 , so rise = 0.5 ⋅ 1 = 0.5 =0.5\cdot1=0.5 = 0.5 ⋅ 1 = 0.5 .
Step 2 (n = 1 n=1 n = 1 ): slope = f ( 0.5 , 1.5 ) = 0.5 + 1.5 = 2 =f(0.5,1.5)=0.5+1.5=2 = f ( 0.5 , 1.5 ) = 0.5 + 1.5 = 2 .
y 2 = 1.5 + 0.5 ( 2 ) = 2.5 , x 2 = 1.0 y_2 = 1.5 + 0.5(2)=2.5,\qquad x_2=1.0 y 2 = 1.5 + 0.5 ( 2 ) = 2.5 , x 2 = 1.0
Why this step? New slope recomputed at the new point — Euler always uses the slope where it currently stands.
Answer: y ( 1 ) ≈ 2.5 y(1)\approx 2.5 y ( 1 ) ≈ 2.5 .
Check vs exact: the true solution is y = 2 e x − x − 1 y=2e^x-x-1 y = 2 e x − x − 1 , so y ( 1 ) = 2 e − 2 ≈ 3.44 y(1)=2e-2\approx 3.44 y ( 1 ) = 2 e − 2 ≈ 3.44 .
Euler under-shoots because the curve bends upward (y ′ ′ > 0 y''>0 y ′′ > 0 ) and tangents lie below it.
Smaller h h h closes the gap.
Worked example Forecast-then-Verify
Forecast: For the same problem with h = 0.25 h=0.25 h = 0.25 (4 steps), will y ( 1 ) y(1) y ( 1 ) be bigger or smaller, closer or farther from 3.44 3.44 3.44 ?
Verify: Steps give y ≈ 1 , 1.25 , 1.5625 , 1.953 , 2.441 y\approx 1,\,1.25,\,1.5625,\,1.953,\,2.441 y ≈ 1 , 1.25 , 1.5625 , 1.953 , 2.441 → y ( 1 ) ≈ 2.44 y(1)\approx 2.44 y ( 1 ) ≈ 2.44 ? Recompute carefully:
y 1 = 1 + 0.25 ( 1 ) = 1.25 y_1=1+0.25(1)=1.25 y 1 = 1 + 0.25 ( 1 ) = 1.25 ; f = 0.25 + 1.25 = 1.5 ⇒ y 2 = 1.625 f=0.25+1.25=1.5\Rightarrow y_2=1.625 f = 0.25 + 1.25 = 1.5 ⇒ y 2 = 1.625 ; f = 0.5 + 1.625 = 2.125 ⇒ y 3 = 2.156 f=0.5+1.625=2.125\Rightarrow y_3=2.156 f = 0.5 + 1.625 = 2.125 ⇒ y 3 = 2.156 ;
f = 0.75 + 2.156 = 2.906 ⇒ y 4 = 2.883 f=0.75+2.156=2.906\Rightarrow y_4=2.883 f = 0.75 + 2.156 = 2.906 ⇒ y 4 = 2.883 . So y ( 1 ) ≈ 2.88 y(1)\approx 2.88 y ( 1 ) ≈ 2.88 — closer to 3.44 3.44 3.44 than the coarse 2.50 2.50 2.50 . ✔ Smaller h h h , better.
Common mistake "Use the slope at the new point
f ( x n + 1 , y n + 1 ) f(x_{n+1},y_{n+1}) f ( x n + 1 , y n + 1 ) ."
Why it feels right: It seems "more current" to use where you're going.
Fix: Plain Euler is explicit — it uses the slope at the point you're leaving , f ( x n , y n ) f(x_n,y_n) f ( x n , y n ) ,
because y n + 1 y_{n+1} y n + 1 isn't known yet. Using the new point is the implicit (backward) Euler, a different method.
Common mistake "Forgetting to multiply the slope by
h h h ."
Why it feels right: You wrote down f ( x n , y n ) f(x_n,y_n) f ( x n , y n ) and add it — looks complete.
Fix: f f f is a slope , not a rise . Rise = slope × run = h f = h\,f = h f . Units must match: Δ y = ( Δ y / Δ x ) ⋅ Δ x \Delta y = (\Delta y/\Delta x)\cdot \Delta x Δ y = ( Δ y /Δ x ) ⋅ Δ x .
Common mistake "Direction field arrows show the direction of motion in time / they have a fixed length meaning."
Why it feels right: Arrows look like velocity vectors.
Fix: Only the slope (tilt) of each segment carries meaning — length is cosmetic. They mark tangent direction, nothing more.
Common mistake "More steps always means a correct answer."
Why it feels right: Smaller h h h reduced error above.
Fix: Truncation error → 0 \to 0 → 0 as h → 0 h\to0 h → 0 , but rounding error grows with more steps, and very stiff equations can blow up. Euler is convergent but only first-order accurate.
Recall Quick self-test (hide answers)
Q: What does f ( x , y ) f(x,y) f ( x , y ) in y ′ = f ( x , y ) y'=f(x,y) y ′ = f ( x , y ) physically give you? → the slope of the solution at ( x , y ) (x,y) ( x , y ) .
Q: Euler update formula? → y n + 1 = y n + h f ( x n , y n ) y_{n+1}=y_n+h f(x_n,y_n) y n + 1 = y n + h f ( x n , y n ) .
Q: Order of global error? → O ( h ) O(h) O ( h ) (first order).
Q: Where does Euler evaluate the slope? → at the current/left point.
Recall Feynman: explain to a 12-year-old
Imagine you're walking in fog and a magic compass tells you which way is "downhill" right where you stand .
You can't see the whole hill, but you take a small step in that direction, ask the compass again, take
another small step, and so on. The path you trace is your best guess of the trail. The ODE is the magic
compass; Euler's method is taking tiny steps. Tiny steps = closer to the real trail, but you do more work.
"Stand, Slope, Step." Stand at ( x n , y n ) (x_n,y_n) ( x n , y n ) → read the Slope f f f → Step y + h f y+hf y + h f .
And for the formula: "New = Old + run × rise-rate."
What does f ( x , y ) f(x,y) f ( x , y ) in y ′ = f ( x , y ) y'=f(x,y) y ′ = f ( x , y ) tell you geometrically? The slope of the solution curve at the point
( x , y ) (x,y) ( x , y ) .
Define a direction (slope) field. At each point
( x , y ) (x,y) ( x , y ) a short segment of slope
f ( x , y ) f(x,y) f ( x , y ) ; solutions are curves tangent to these segments everywhere.
What is an isocline? The locus
f ( x , y ) = m f(x,y)=m f ( x , y ) = m where all field segments share the same slope
m m m .
State Euler's method update. y n + 1 = y n + h f ( x n , y n ) y_{n+1}=y_n+h\,f(x_n,y_n) y n + 1 = y n + h f ( x n , y n ) with
x n + 1 = x n + h x_{n+1}=x_n+h x n + 1 = x n + h .
Derive Euler from Taylor. y ( x n + h ) = y n + h y n ′ + h 2 2 y ′ ′ ( ξ ) y(x_n+h)=y_n+h y'_n+\tfrac{h^2}{2}y''(\xi) y ( x n + h ) = y n + h y n ′ + 2 h 2 y ′′ ( ξ ) ; replace
y n ′ = f ( x n , y n ) y'_n=f(x_n,y_n) y n ′ = f ( x n , y n ) and drop the
O ( h 2 ) O(h^2) O ( h 2 ) term.
What is the local truncation error of Euler? h 2 2 y ′ ′ ( ξ ) \tfrac{h^2}{2}y''(\xi) 2 h 2 y ′′ ( ξ ) , i.e.
O ( h 2 ) O(h^2) O ( h 2 ) per step.
What is the global error order of Euler? O ( h ) O(h) O ( h ) — first order; halving
h h h roughly halves total error.
Which point's slope does explicit Euler use? The current (left) point
( x n , y n ) (x_n,y_n) ( x n , y n ) , not the new one.
Why does Euler undershoot a convex (y ′ ′ > 0 y''>0 y ′′ > 0 ) solution? Tangent lines lie below a convex curve, so each step lands too low.
Common error: omitting which factor? Multiplying the slope by the step
h h h ;
Δ y = h f \Delta y=h f Δ y = h f , not
f f f .
Local error O of h squared
Intuition Hinglish mein samjho
Dekho, ek first-order ODE d y d x = f ( x , y ) \frac{dy}{dx}=f(x,y) d x d y = f ( x , y ) tumhe seedha y y y nahi batati — wo har point
( x , y ) (x,y) ( x , y ) par solution curve ka slope batati hai. Matlab plane ke har jagah ek chhota sa
arrow (dash) bana sakte ho jiska tilt f ( x , y ) f(x,y) f ( x , y ) ke barabar ho. In saare dashes ka collection hi
direction field (slope field) hai. Solution curve wahi hai jo har point par us dash ke
"tangent" ho — bas arrows ko follow karte jao, manzil mil jayegi.
Jab formula se solve nahi hota, tab Euler's method kaam aata hai. Idea simple hai: agar tum
ek point par khade ho aur slope f f f pata hai, to thoda sa step h h h aage chalo us slope ke
direction me. Taylor expansion se: y ( x + h ) ≈ y + h y ′ y(x+h)\approx y+h\,y' y ( x + h ) ≈ y + h y ′ , aur y ′ = f ( x , y ) y'=f(x,y) y ′ = f ( x , y ) , to formula banta hai
y n + 1 = y n + h f ( x n , y n ) y_{n+1}=y_n+h\,f(x_n,y_n) y n + 1 = y n + h f ( x n , y n ) . Yaad rakhne ka tarika: "Stand, Slope, Step" — khade ho, slope
padho, step lo. Dhyan rahe slope ko h h h se multiply karna zaroori hai, kyunki slope "rise per run"
hai aur rise = = = slope × h \times h × h .
Error ki baat: har ek step me chhoti si galti ∼ h 2 \sim h^2 ∼ h 2 hoti hai, aur L / h L/h L / h steps lagte hain, to
total error ∼ h \sim h ∼ h — isliye Euler ko first-order method kehte hain. h h h aadha karo to error
lagभग aadha. Lekin bahut zyada steps lene par rounding error bhi badhta hai, aur stiff equations
me blow up ho sakta hai — isliye aage RK4 jaise better methods aate hain.
Exam aur intuition dono ke liye golden point: pehle field ka picture socho (kaunsi taraf curve
jhuk raha hai), phir Euler ke number nikaalo, aur exact solution se compare karke dekho ki Euler
overshoot kar raha hai ya undershoot — convex curve (y ′ ′ > 0 y''>0 y ′′ > 0 ) me Euler hamesha neeche reh jaata hai.