Skip to main content

Exercises 8.6 Exercises

๐Ÿ“: Note on Variables.

โœ๐Ÿป Problems.

Work through the following problems.

1.

Approximate the solution to the differential equation
\begin{equation*} y' = y^2 - x, \quad y(0) = -1 \end{equation*}
over the interval \([0, 1]\) with a step size of \(h = 0.5\text{.}\)
Hint.
Start with the given initial condition \(y_0 = -1\) at \(x_0 = 0\text{.}\) Use Eulerโ€™s update formula: \(y_{k+1} = y_k + h \cdot f(x_k, y_k)\text{,}\) where \(f(x, y) = y^2 - x\text{.}\) Youโ€™ll need to compute two steps to reach \(x = 1\text{.}\)
Answer.
Using Eulerโ€™s method with \(h=0.5\text{:}\) \(y(0)=-1\text{,}\) \(y(0.5) \approx -0.5\text{,}\) \(y(1) \approx -0.625\text{.}\)

2.

Use Eulerโ€™s Method to approximate the solution to the initial-value problem,
\begin{align} y'(x) - 2x y(x) = 0 \amp \tag{8.5}\\ y(0) = 2, \amp \tag{8.6} \end{align}
at the \(x\)-values \(0,\ 0.5,\ 1,\ 1.5,\ 2\) (spaced 0.5 apart).
Answer.
Approximate values: \(y(0)=2\text{,}\) \(y(0.5)=2\text{,}\) \(y(1)=3\text{,}\) \(y(1.5)=6\text{,}\) \(y(2)=15\text{.}\)

3. Basic Eulerโ€™s Method.

Consider the initial-value problem
\begin{equation*} y' = 2x - 3y + 1,\quad y(1) = 5 \end{equation*}
and answer the following:

(a)

Compute 2 iterations of Eulerโ€™s method using step size \(h = 0.1\text{.}\)
Answer.
\(\ds x_1 = 1.1 \hspace{0.5cm} \ds x_2 = 1.2, \hspace{0.5cm} \ds y_1 = 3.8, \hspace{0.5cm} \ds y_2 = 2.98 \)

(c)

Compute 2 iterations of Eulerโ€™s method using step size \(\ds h = 0.05\text{.}\)
Answer.
\(x_1 = 1.05 \hspace{0.5cm} x_2 = 1.1, \hspace{0.5cm} y_1 = 4.4, \hspace{0.5cm} y_2 = 3.895 \)

(e)

Find the analytic solution to the IVP. Use your solution to compare the exact value of \(y(1.1)\) with your answers from parts (a) and (c).
Answer.
\(\ds y = \frac{2}{3}x + \frac{1}{9} + \frac{38e^3}{9}e^{-3x},\quad y(1.1) \approx 3.9723 \)

4. Basic Eulerโ€™s Method.

Consider the initial-value problem
\begin{equation*} y' = y,\quad y(0) = 1 \end{equation*}
and answer the following:

(d)

Find the analytic solution to the IVP. Use it to compute the exact value of \(y(0.5)\) and compare with your answers from parts (a) and (b).
Answer.
\(y = e^x,\quad y(0.5) \approx e^{0.5} \approx 1.6487\)

5. Comparing Step Sizes.

Consider the initial-value problem
\begin{equation*} y' = -y, \quad y(0) = 1 \end{equation*}
on the interval \([0, 1]\text{.}\)

(c)

The exact solution is \(y(t) = e^{-t}\text{.}\) Calculate \(y(1)\) exactly and compare with your approximations from parts (a) and (b). Which approximation is closer to the true value?
Answer.
\(y(1) = e^{-1} \approx 0.368\text{;}\) the smaller step size \(h = 0.25\) gives a more accurate approximation.

6. Conceptual Understanding.

Answer the following questions about Eulerโ€™s method:
  1. Why does decreasing the step size \(h\) generally improve the accuracy of Eulerโ€™s method? Explain in terms of the geometry of the solution curve.
  2. Suppose youโ€™re using Eulerโ€™s method and notice that your approximation seems to drift further from the true solution as you take more steps. What might be happening, and what could you do to improve the approximation?
  3. Can Eulerโ€™s method produce the exact solution for any differential equation? If so, give an example. If not, explain why not.
Answer.
(a) Smaller steps keep the straight-line segments closer to the curved solution, so less error accumulates. (b) Errors compound step by step; use a smaller \(h\) or a more accurate method. (c) Only when the true solution is a straight line (e.g., \(y' = c\)) โ€” otherwise every step introduces some error.
You have attempted of activities on this page.