100%
PAGE 1

Euler's Method

One of the numerical methods (the methods we have been learning are analytical methods).

Context: Analytical methods produce exact formulas or equations, while numerical methods construct step-by-step discrete approximations when exact solutions are difficult or impossible to obtain.

  • Analytical: outcome is a function (explicit or implicit)
  • Numerical: outcome is a table of values
Table of values resulting from a numerical method, listing paired values of t and y
\(t\) \(y\)
\(t_0\) \(y_0\)
\(t_1\) \(y_1\)
\(t_2\) \(y_2\)
\(\vdots\) \(\vdots\)

Euler's method is the simplest numerical method but is the foundation of more sophisticated ones.

PAGE 2

Linear Approximation and Euler's Method

It is the same as linear approximation from calculus.

Coordinate graph showing linear approximation of curve  y(t)  at  (t_0, y_0)  with tangent line estimating  y  at  t_1
Figure: Coordinate graph showing linear approximation of curve \( y(t) \) at \( (t_0, y_0) \) with tangent line estimating \( y \) at \( t_1 \) Show Details
Coordinate graph with horizontal time axis \( t \) and vertical state axis \( y \). A true solution curve \( y(t) \) passes through \( (t_0, y_0) \). A dashed tangent line at \( (t_0, y_0) \), drawn using the function's slope, extends to \( t_1 \). At \( t = t_1 \), the exact solution reaches \( y_{\text{true}} \), whereas the tangent line reaches the linear estimate \( y_{\text{approx}} \). When \( t_1 \) is close to \( t_0 \), \( y_{\text{approx}} \approx y_{\text{true}} \).

We can use the tangent line to estimate \( y \) at \( t_1 \),

if \( t_0 \) is not too different from \( t_1 \), then \( y_{\text{approx}} \approx y_{\text{true}} \).

Conceptual Note: In single-variable calculus, the linear approximation of a function near \( t_0 \) is given by \( L(t) = y(t_0) + y'(t_0)(t - t_0) \). When the step size \( \Delta t = t_1 - t_0 \) is sufficiently small, the tangent line stays close to the true curve, yielding \( y(t_1) \approx y_0 + f(t_0, y_0)(t_1 - t_0) \).

Euler's Method for Differential Equations

Euler's method for diff. eqs. turns the picture around:

  • we don't know \( y(t) \)
  • but we have \( \frac{dy}{dt} = f(t, y) \) (slope)

Basic idea:

  1. Start at \( (t_0, y_0) \) (initial condition)
  2. Move to \( t_1 \) along tangent line
  3. Then repeat to go to \( t_2 \), etc.
PAGE 3

Euler's Method: Tangent Line Approximations

Graph showing Euler's method linear approximations tracking a true solution curve.
Figure: Graph showing Euler's method linear approximations tracking a true solution curve. Show Details
A coordinate plot showing time \( t \) on the horizontal axis with points \( t_0 \), \( t_1 \), and \( t_2 \), and \( y \) on the vertical axis starting at \( y_0 \). A red curve indicates the true solution \( y(t) \). Two successive linear segments are shown: the first starts at \( (t_0, y_0) \) with slope \( f(t_0, y_0) \), and the second starts at \( (t_1, y_1) \) with slope \( f(t_1, y_1) \), visually showing how tangent steps track the true function.
repeat for as long as needed
Conceptual Overview: Euler's method approximates the solution to an initial value problem \( \frac{dy}{dt} = f(t, y) \) by following local tangent lines over discrete steps in time \( t \).

At \( (t_0, y_0) \) the slope is \( f(t_0, y_0) \) from \( \frac{dy}{dt} = f(t_0, y_0) \).

tangent line:

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

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

estimate \( y_1 \):

\[ y_1 \approx y_0 + f(t_0, y_0)(t_1 - t_0) \]

we decide \( t_1 \)

Step Size: The distance \( t_1 - t_0 \) is typically denoted as the step size \( h \). A smaller \( h \) generally yields a closer approximation to the true solution curve \( y(t) \).

then build a new tangent line and go to \( t_2 \)

\[ y_2 \approx y_1 + f(t_1, y_1)(t_2 - t_1) \]

generalize:

General Form

\[ y_{n+1} = y_n + f(t_n, y_n)(t_{n+1} - t_n) \]

PAGE 4

Euler's Method: Step Size and Update Formula

Usually we fix the difference between the \(t\)'s. We call it step size \(h\).

Euler's update formula:

\[ y_{n+1} = y_n + f(t_n, y_n) h \]

Example

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

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

To estimate \(y(0.5)\) starting at \(t_0 = 0\) with step size \(h = 0.25\), we will take \(n = \frac{0.5 - 0}{0.25} = 2\) steps: first computing \(y_1 \approx y(0.25)\), then using that to compute \(y_2 \approx y(0.5)\).
\[ \left. \begin{aligned} t_0 &= 0 \\ y_0 &= 1 \end{aligned} \right\} \quad \text{initial condition} \] \[ t_1 = t_0 + h = 0 + 0.25 = 0.25 \] \[ y_1 = y_0 + \underbrace{f(t_0, y_0)}_{\substack{\text{slope at} \\ \text{previous } (t, y)}} h \]
From the differential equation \(y' = f(t, y)\), our slope formula is \(f(t, y) = 2y - 3t\). At \((t_0, y_0) = (0, 1)\), the slope is \(2(1) - 3(0) = 2\).
\[ = 1 + \bigl[2(\underbrace{1}_{\substack{\uparrow \\ y_0}}) - 3(\underbrace{0}_{\substack{\uparrow \\ t_0}})\bigr](0.25) = 1.5 \quad \text{estimate of } y(0.25) \] \[ y_2 = y_1 + f(t_1, y_1) h \]
PAGE 5

Euler's Method: Step Calculation and Estimation

\[ = 1.5 + \bigl[2(1.5) - 3(0.25)\bigr](0.25) = 2.0625 \]

Step context: This calculation evaluates Euler's step \(y_{n+1} = y_n + f(t_n, y_n)h\) where \(f(t, y) = 2y - 3t\) at the intermediate point \((t_1, y_1) = (0.25, 1.5)\) with step size \(h = 0.25\).

We estimate \(y(0.5)\) to be \(2.0625\)

How good is the estimate?

The diff. eq. is linear, so we can solve it analytically

\[ y(t) = \frac{3}{4}(2t + 1) + \frac{1}{4}e^{2t} \]
(not generally easy to find for arbitrary diff. eq.)

True \(y(0.5)\): \(y(0.5) = 2.1796\)

Estimate: \(2.0625\) (\(5\%\) error)

To improve, shrink \(h \rightarrow\) more steps

If we had used \(h = 0.01\) (\(25\) steps):

Estimate of \(y(0.5) = 2.1729\) (\(0.3\%\) error)

Error comparison: Reducing the step size from \(h = 0.25\) to \(h = 0.01\) reduced relative error dramatically from \(\approx 5.37\%\) to \(\approx 0.31\%\), illustrating convergence to the exact solution.

For Euler's method, error is proportional to step size

(half the step size \(\rightarrow\) roughly half the error)

PAGE 6

2nd-Order Linear Diff. Eqs.

\( \underbrace{P(t)}_{\text{no } y} y'' + \underbrace{Q(t)}_{\text{no } y} y' + \underbrace{R(t)}_{\text{no } y} y = \underbrace{G(t)}_{\text{no } y} \)

Note: The coefficient functions \( P(t) \), \( Q(t) \), and \( R(t) \), along with \( G(t) \), depend only on the independent variable \( t \) and contain no \( y \) terms.

if \( P(t) \neq 0 \), we often put it into the standard form by dividing it

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

Dividing through by \( P(t) \) yields \( p(t) = \frac{Q(t)}{P(t)} \), \( q(t) = \frac{R(t)}{P(t)} \), and \( g(t) = \frac{G(t)}{P(t)} \).

if \( g(t) \) or \( G(t) \) is zero, the eq. is said to be homogeneous

When \( g(t) = 0 \), the homogeneous form is \( y'' + p(t) y' + q(t) y = 0 \).

we will start with constant-coefficient homogeneous linear eq.

PAGE 7

Second-Order Linear Homogeneous ODEs

Homogeneous equations with constant coefficients and the characteristic equation

General Form

\[ a y'' + b y' + c y = 0 \]
\( a, b, c \) constants

Solution Intuition

We can guess the likely solutions:

  • → \( y \) is related to its 1st and 2nd derivs.
  • Candidate families: exponential, sine, cosine
Why these functions? The derivative of \( e^{rt} \) is \( r e^{rt} \), and the derivatives of \( \sin(kt) \) and \( \cos(kt) \) cycle back to sines and cosines. Linear combinations of a function and its derivatives can only sum to zero if the derivatives reproduce the same functional form.

Let's look at exponential first: \( y = e^{rt} \) for some \( r \).

Example

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

Want solution that looks like \( y = e^{rt} \).

Sub \( y = e^{rt} \), \( y' = r e^{rt} \), \( y'' = r^2 e^{rt} \) into diff. eq.:

\[ \begin{aligned} r^2 e^{rt} + 2 r e^{rt} - 3 e^{rt} &= 0 \\[6pt] e^{rt} (r^2 + 2r - 3) &= 0 \end{aligned} \]

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

So,

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

this is called the Characteristic Equation

Next Steps: Factoring the characteristic equation gives \( (r + 3)(r - 1) = 0 \), yielding roots \( r_1 = 1 \) and \( r_2 = -3 \). The two linearly independent solutions are \( y_1 = e^{t} \) and \( y_2 = e^{-3t} \), giving the general solution \( y(t) = c_1 e^{t} + c_2 e^{-3t} \).
PAGE 8

Fundamental and General Solutions

two solutions for \( r \):

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

two solutions to the diff. eq. (1st order has one)

\[ y_1 = e^{-3t} \qquad y_2 = e^t \]

these are called the fundamental solutions

Concept Note: For a second-order linear homogeneous differential equation, any two linearly independent solutions \( y_1(t) \) and \( y_2(t) \) form a fundamental set of solutions.

ANY linear combination of them is also a solution

\[ y = c_1 e^{-3t} + c_2 e^t \]
General solution

Principle of Superposition: Any linear combination of fundamental solutions forms the general solution. The constants \( c_1 \) and \( c_2 \) are arbitrary coefficients determined by initial conditions.

two unknown constants

two initial conditions needed

Initial Value Problem (IVP): A second-order differential equation requires two initial conditions (typically \( y(t_0) = y_0 \) and \( y'(t_0) = y'_0 \)) to uniquely determine the constants \( c_1 \) and \( c_2 \).