# Numerical Solutions

Author: John J Weber III, PhD Corresponding Textbook Sections:

• Section 1.2 – Solutions and Initial Value Problems

• Section 1.4 – The Approximation Method of Euler

## Expected Educational Results

• Objective 4–1: I can estimate the solution to an IVP using Euler’s Method.

• Objective 4–2: I can use the Existence and Uniqueness Theorem to determine if a first-order IVP has a unique solution.

## Initial Value Problems

### Solutions to ODEs

There are three general methods for solving ODEs that we will discuss in this course:

1. Graphical solutions [A sketch or graph representing ALL potential solutions to an ODE]

• Phase lines: first-order autonomous ODEs (See CPT_03_Direction_Fields);

• Direction fields: first-order ODEs (See CPT_03_Direction_Fields);

• Phase planes: systems of first-order ODEs (To be discussed in CPT_17_Phase_Planes).

2. Numerical Solutions [A numerical computation to estimate a $y$$y$-value when given an initial point $y\left({x}_{0}\right)={y}_{0}$$y(x_0)=y_0$ on a single unknown solution curve of an ODE:

• Euler's Method (To be discussed in a project)

• Heun's Method (To be discussed in a project);

• Fourth-order Runge Kutta [RK4] Method (To be discussed in a project).

3. Analytical Solutions (the majority of the methods discussed in the course)

### Initial Value Problems (IVPs)

#### Definition: Initial Value Problem (IVP)

An IVP for an $n$$n$th-order DE is finding a solution to the DE on some interval $\left(a,b\right)$$(a,b)$ that satisfies $n$$n$ initial conditions.

IVP Example

An example of a first-order IVP is ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=x\left(y+1\right)$$\displaystyle y^{\,\prime}=x(y+1)$, $y\left({x}_{0}\right)={y}_{0}$$y(x_0)=y_0$. From Calculus I, we know the first derivative describes the slopes of curves. So ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=x\left(y+1\right)$$\displaystyle y^{\,\prime}=x(y+1)$ describes the slope of all curves $y\left(x\right)$$y(x)$ everywhere on the $xy$$xy$-plane where certain conditions are met. The initial condition $y\left({x}_{0}\right)={y}_{0}$$y(x_0)=y_0$ is the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$. When solving an IVP, we want to find the curve $y\left(x\right)$$y(x)$ that passes through the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$.

When solving IVPs, there are three possibilities:

1. There is no solution to the IVP, i.e., there is no solution curve that passes through the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$.

2. There is a unique solution to the IVP, i.e., there is only one solution curve that passes through the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$.

3. The solution to the IVP is not unique, i.e., there is more than one solution curve that passes through the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$.

#### Existence and Uniqueness Theorem

Given an IVP of the form $\frac{dy}{dx}=f\left(x,y\right)$$\displaystyle\frac{dy}{dx}=f(x,y)$, $y\left({x}_{0}\right)={y}_{0}$$y(x_0)=y_0$. If $f$$f$ and $\frac{\partial f}{\partial y}$$\displaystyle\frac{\partial f}{\partial y}$ are continuous on some rectangle $R=\left\{\left(x,y\right)|a$\displaystyle R=\left\{(x,y)|a that contains the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$, then the IVP has a unique solution on some interval about $x$$x$.

##### Using the Existence and Uniqueness Theorem

Procedure

1. Determine if both of the conditions of the theorem are met (make sure that you provide a supporting explanation):

• Determine if $f\left(x,y\right)$$f(x,y)$ is continuous on some open rectangle containing the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$.

• Determine if $\frac{\partial f}{\partial y}$$\displaystyle\frac{\partial f}{\partial y}$ is continuous on the same open rectangle containing the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$.

2. State your conclusion: Use an appropriate sentence similar to one of the following statements

• Since $f\left(x,y\right)$$f(x,y)$ and $\frac{\partial f}{\partial y}$$\displaystyle\frac{\partial f}{\partial y}$ are both continuous on some open rectangle containing the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$, then the IVP has a unique solution on some interval about $x$$x$.

• Since $f\left(x,y\right)$$f(x,y)$ is not continuous on some open rectangle containing the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$, then the IVP does not have a unique solution on some interval about $x$$x$.

• Since $\frac{\partial f}{\partial y}$$\displaystyle\frac{\partial f}{\partial y}$ is not continuous on some open rectangle containing the point $\left({x}_{0},{y}_{0}\right)$$(x_0,y_0)$, then the IVP does not have a unique solution on some interval about $x$$x$.

#### Investigation 01

For each of the following linear IVPs, determine, if there is a unique solution:

1. $x{y}^{\phantom{\rule{0.167em}{0ex}}\prime }=y+3{x}^{2}$$\displaystyle xy^{\,\prime}=y+3x^2$, $y\left(0\right)=0$$y(0)=0$

2. ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=\frac{x}{y+1}$$\displaystyle y^{\,\prime}=\frac{x}{y+1}$, $y\left(0\right)=0$$y(0)=0$

3. $x{y}^{\phantom{\rule{0.167em}{0ex}}\prime }-y={x}^{2}\mathrm{cos}\left(x\right)$$\displaystyle xy^{\,\prime}-y=x^2\cos{(x)}$, $y\left(0\right)=-3$$y(0)=-3$

4. ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=1+{y}^{2}$$\displaystyle y^{\,\prime}=1+y^2$, $y\left(\frac{\pi }{2}\right)=0$$\displaystyle y\left(\frac{\pi}{2}\right)=0$

5. ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=x-y+1$$\displaystyle y^{\,\prime}=x-y+1$, $y\left(1\right)=2$$y(1)=2$

6. ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=x+\sqrt{y}$$\displaystyle y^{\,\prime}=x+\sqrt{y}$, $y\left(1\right)=0$$y(1)=0$

7. ${y}^{\phantom{\rule{0.167em}{0ex}}\prime }=\frac{y}{2x}$$\displaystyle y^{\,\prime}=\frac{y}{2x}$, $y\left(0\right)=1$$y(0)=1$

8. ${x}^{\phantom{\rule{0.167em}{0ex}}\prime }=\frac{x}{t}+3t$$\displaystyle x^{\,\prime}=\frac{x}{t}+3t$, $x\left(1\right)=0$$x(1)=0$

9. $t{y}^{\phantom{\rule{0.167em}{0ex}}\prime }-y={t}^{2}\mathrm{cos}\left(t\right)$$\displaystyle ty^{\,\prime}-y=t^2\cos{(t)}$, $y\left(0\right)=-3$$y(0)=-3$