PAGE 1

2.7 Numerical Approx: Euler's Method

\( y' = f(t, y) \) if not linear, separable, exact or homogeneous, what do we do?

numerical methods: \( (t_0, y_0), (t_1, y_1), (t_2, y_2), \dots \) instead of a function \( y = f(t, y) \)

Euler's method is also called the tangent line method.

From calculus, we saw linear approx.

Graph showing a curve y=f(t) and its tangent line at a point t_0, illustrating linear approximation.

near \( t = t_0 \), tangent line \( \approx \) true curve

PAGE 2

We will use the same idea, except now we don't have the solution \( y \) but we have \( y' \).

\( y(t_0) = y_0 \) is always known

Graph of a solution curve y and a dashed tangent line starting from (t_0, y_0) on the y-axis.
  • solution: \( y \) we don't have this
  • we know \( y' \) at any \( (t, y) \)

Tangent Line Equation

Tangent line at \( (t_0, y_0) \) is:

\[ y - y_0 = f(t_0, y_0)(t - t_0) \] \[ y = y_0 + f(t_0, y_0)(t - t_0) \]

Travel on tangent line to a new value of \( t \).

Decide the change in \( t \): \( \Delta t = h \)

PAGE 3

Euler's Method: Geometric Interpretation

Single Step Approximation

Coordinate graph with t and y axes. A green curve represents the true solution. A dashed red tangent line starts at (t0, y0) and reaches an approximate y1 at t1. The step size h is the distance between t0 and t1.

If \( h \) is "small" then:

\( \text{approx. } y_1 \approx \text{true } y_1 \)

Iterative Process

Coordinate graph showing two linear approximation steps. Dashed red lines represent tangent lines at t0 and t1. The approximation moves from y0 to y1, then from y1 to y2 over two steps of size h.

Repeat until we reach the target \( t \).

Error in every step, but we control the accuracy by controlling \( h \).
PAGE 4

Example: Numerical Solution

Example:

\( y' = 2y - 3t \), \( y(0) = 1 \)

Estimate \( y(0.5) \) using a step size of \( h = 0.25 \).

\[ t_0 = 0 \]\[ y_0 = 1 \]
\[ t_1 = t_0 + h = 0 + 0.25 = 0.25 \]\[ y_1 = y_0 + f(t_0, y_0)(t_1 - t_0) \]

Note: Use previous \( (t, y) \) to calculate slope. Here, \( t_1 - t_0 = h \).

\[ y_1 = 1 + [2(1) - 3(0)](0.25) = 1.5 \]\[ \rightarrow y(0.25) \approx 1.5 \]
\[ t_2 = t_1 + h = 0.25 + 0.25 = 0.5 \]

Target \( t \), so this is the final step.

\[ y_2 = y_1 + f(t_1, y_1)h \]\[ y_2 = 1.5 + [2(1.5) - 3(0.25)](0.25) = 2.0625 \]

\( y(0.5) \approx 2.0625 \)

PAGE 5

How good is that estimate?

The equation \( y' = 2y - 3t \) is linear, so we can solve it exactly:

\[ y = \frac{3}{4}(2t + 1) + \frac{1}{4}e^{2t} \]

True value: \( y(0.5) = \frac{3}{4}(2) + \frac{1}{4}e \approx 2.1796 \)

Estimate with \( h = 0.25 \) gave us \( y(0.5) \approx 2.0625 \) (5% error).

Want a better estimate? Use a smaller \( h \) (more steps).

If we used \( h = 0.01 \) (50 steps!):

\[ y(0.5) \approx 2.1729 \quad (0.3\% \text{ error}) \]
PAGE 6

3.1 Homogeneous Diff. Eqs. with Constant Coefficients

Focus on 2nd order:

\[ \frac{d^2y}{dt^2} = f(t, y, \frac{dy}{dt}) \]

(extends to \( n^{th} \) order easily)

Linearity

Linear: \( f(t, y, y') \) is linear in \( y \), \( y' \) and anything to do with \( y \).

Form:

\[ P(t)y'' + Q(t)y' + R(t)y = G(t) \]

no \( y \) of any kind

Standard form:

\[ y'' + p(t)y' + q(t)y = g(t) \]

Homogeneous

"Homogeneous" in this context means \( g(t) = 0 \)

(more common meaning of this word)

Constant Coefficient

\[ ay'' + by' + cy = 0 \quad a, b, c \text{ constants} \]
PAGE 7

Second-Order Linear Homogeneous Equations

\[ay'' + by' + cy = 0\]

\(y\) is related to its own 1st and 2nd derivatives by constant multiples.

→ exponential, sine & cosine

exponential

^ focus for now

so, we want solution(s) that look like \(e^{rt}\), where \(r\) is a constant.

Example

\[y'' + 2y' - 3y = 0\]

Solution:

\[\begin{aligned} y &= e^{rt} \\ y' &= re^{rt} \\ y'' &= r^2e^{rt} \end{aligned}\]

} must satisfy the diff. eq.

\[r^2e^{rt} + 2re^{rt} - 3e^{rt} = 0\]
\[e^{rt}(r^2 + 2r - 3) = 0\]

Since \(e^{rt} \neq 0\), this means:

\[r^2 + 2r - 3 = 0\]

characteristic eq.

PAGE 8

for \(y = e^{rt}\) to be a solution, \(r\) must satisfy \(r^2 + 2r - 3 = 0\)

\[(r + 3)(r - 1) = 0 \quad \implies \quad r = -3, \, r = 1\]

two \(r\) → two solutions

\[\begin{aligned} y_1 &= e^{-3t} \\ y_2 &= e^t \end{aligned}\]

} fundamental solutions

Since the diff. eq. is linear, any linear combination of the fundamental solutions is also a solution.

\[y = C_1 e^{-3t} + C_2 e^t\]

general solution

\(C_1, C_2\) depend on initial conditions

two needed to determine \(C_1\) and \(C_2\) uniquely

typically \(y(t_0) = y_0, \, y'(t_0) = y'_0\)