In Section 3.1 we saw that the global truncation error of Euler’s method is \(O(h)\), which would seem to imply that we can achieve arbitrarily accurate results with Euler’s method by simply choosing the step size sufficiently small. However, this isn’t a good idea, for two reasons. First, after a certain point decreasing the step size will increase roundoff errors to the point where the accuracy will deteriorate rather than improve. The second and more important reason is that in most applications of numerical methods to an initial value problem
the expensive part of the computation is the evaluation of \(f\). Therefore we want methods that give good results for a given number of such evaluations. This is what motivates us to look for numerical methods better than Euler’s.
To clarify this point, suppose we want to approximate the value of \(e\) by applying Euler’s method to the initial value problem
on \([0,1]\), with \(h=1/12\), \(1/24\), and \(1/48\), respectively. Since each step in Euler’s method requires one evaluation of \(f\), the number of evaluations of \(f\) in each of these attempts is \(n=12\), \(24\), and \(48\), respectively. In each case we accept \(y_n\) as an approximation to \(e\). The second column of Table 3.2.1 shows the results. The first column of the table indicates the number of evaluations of \(f\) required to obtain the approximation, and the last column contains the value of \(e\) rounded to ten significant figures.
In this section we’ll study the improved Euler method, which requires two evaluations of \(f\) at each step. We’ve used this method with \(h=1/6\), \(1/12\), and \(1/24\). The required number of evaluations of \(f\) were 12, 24, and \(48\), as in the three applications of Euler’s method; however, you can see from the third column of Table 3.2.1 that the approximation to \(e\) obtained by the improved Euler method with only 12 evaluations of \(f\) is better than the approximation obtained by Euler’s method with 48 evaluations.
In Section 3.1 we’ll study the Runge- Kutta method, which requires four evaluations of \(f\) at each step. We’ve used this method with \(h=1/3\), \(1/6\), and \(1/12\). The required number of evaluations of \(f\) were again 12, 24, and \(48\), as in the three applications of Euler’s method and the improved Euler method; however, you can see from the fourth column of Table 3.2.1 that the approximation to \(e\) obtained by the Runge-Kutta method with only 12 evaluations of \(f\) is better than the approximation obtained by the improved Euler method with 48 evaluations.
| \(n\) | Euler | Improved Euler | Runge-Kutta | Exact |
| 12 | 2.613035290 | 2.707188994 | 2.718069764 | 2.718281828 |
| 24 | 2.663731258 | 2.715327371 | 2.718266612 | 2.718281828 |
| 48 | 2.690496599 | 2.717519565 | 2.718280809 | 2.718281828 |
The Improved Euler Method
The improved Euler method for solving the initial value problem (3.2.1) is based on approximating the integral curve of (3.2.1) at \((x_i,y(x_i))\) by the line through \((x_i,y(x_i))\) with slope
that is, \(m_i\) is the average of the slopes of the tangents to the integral curve at the endpoints of \([x_i,x_{i+1}]\). The equation of the approximating line is therefore
Setting \(x=x_{i+1}=x_i+h\) in (3.2.2) yields
as an approximation to \(y(x_{i+1})\). As in our derivation of Euler’s method, we replace \(y(x_i)\) (unknown if \(i>0\)) by its approximate value \(y_i\); then (3.2.3) becomes
However, this still won’t work, because we don’t know \(y(x_{i+1})\), which appears on the right. We overcome this by replacing \(y(x_{i+1})\) by \(y_i+hf(x_i,y_i)\), the value that the Euler method would assign to \(y_{i+1}\). Thus, the improved Euler method starts with the known value \(y(x_0)=y_0\) and computes \(y_1\), \(y_2\), …, \(y_n\) successively with the formula
The computation indicated here can be conveniently organized as follows: given \(y_i\), compute
The improved Euler method requires two evaluations of \(f(x,y)\) per step, while Euler’s method requires only one. However, we’ll see at the end of this section that if \(f\) satisfies appropriate assumptions, the local truncation error with the improved Euler method is \(O(h^3)\), rather than \(O(h^2)\) as with Euler’s method. Therefore the global truncation error with the improved Euler method is \(O(h^2)\); however, we won’t prove this.
We note that the magnitude of the local truncation error in the improved Euler method and other methods discussed in this section is determined by the third derivative \(y'''\) of the solution of the initial value problem. Therefore the local truncation error will be larger where \(|y'''|\) is large, or smaller where \(|y'''|\) is small.
The next example, which deals with the initial value problem considered in Example 3.1.1, illustrates the computational procedure indicated in the improved Euler method.
Example 3.2.1
Use the improved Euler method with \(h=0.1\) to find approximate values of the solution of the initial value problem
at \(x=0.1,0.2,0.3\).
Solution As in Example 3.1.1, we rewrite (3.2.5) as
which is of the form (3.2.1), with
The improved Euler method yields
Example 3.2.2
Table 3.2.2 shows results of using the improved Euler method with step sizes \(h=0.1\) and \(h=0.05\) to find approximate values of the solution of the initial value problem
at \(x=0\), \(0.1\), \(0.2\), \(0.3\), …, \(1.0\). For comparison, it also shows the corresponding approximate values obtained with Euler’s method in 3.1.2, and the values of the exact solution
The results obtained by the improved Euler method with \(h=0.1\) are better than those obtained by Euler’s method with \(h=0.05\).
| \(x\) | \(h=0.1\) | \(h=0.05\) | \(h=0.1\) | \(h=0.05\) | Exact |
| 0.0 | 1.000000000 | 1.000000000 | 1.000000000 | 1.000000000 | 1.000000000 |
| 0.1 | 0.800000000 | 0.810005655 | 0.820040937 | 0.819050572 | 0.818751221 |
| 0.2 | 0.640081873 | 0.656266437 | 0.672734445 | 0.671086455 | 0.670588174 |
| 0.3 | 0.512601754 | 0.532290981 | 0.552597643 | 0.550543878 | 0.549922980 |
| 0.4 | 0.411563195 | 0.432887056 | 0.455160637 | 0.452890616 | 0.452204669 |
| 0.5 | 0.332126261 | 0.353785015 | 0.376681251 | 0.374335747 | 0.373627557 |
| 0.6 | 0.270299502 | 0.291404256 | 0.313970920 | 0.311652239 | 0.310952904 |
| 0.7 | 0.222745397 | 0.242707257 | 0.264287611 | 0.262067624 | 0.261398947 |
| 0.8 | 0.186654593 | 0.205105754 | 0.225267702 | 0.223194281 | 0.222570721 |
| 0.9 | 0.159660776 | 0.176396883 | 0.194879501 | 0.192981757 | 0.192412038 |
| 1.0 | 0.139778910 | 0.154715925 | 0.171388070 | 0.169680673 | 0.169169104 |
| Euler | Improved Euler | Exact |
Example 3.2.3
Table 3.2.3 shows analogous results for the nonlinear initial value problem
We applied Euler’s method to this problem in Example 3.1.3.
| \(x\) | \(h=0.1\) | \(h=0.05\) | \(h=0.1\) | \(h=0.05\) | “Exact” |
| 0.0 | 1.000000000 | 1.000000000 | 1.000000000 | 1.000000000 | 1.000000000 |
| 0.1 | 0.800000000 | 0.821375000 | 0.840500000 | 0.838288371 | 0.837584494 |
| 0.2 | 0.681000000 | 0.707795377 | 0.733430846 | 0.730556677 | 0.729641890 |
| 0.3 | 0.605867800 | 0.633776590 | 0.661600806 | 0.658552190 | 0.657580377 |
| 0.4 | 0.559628676 | 0.587454526 | 0.615961841 | 0.612884493 | 0.611901791 |
| 0.5 | 0.535376972 | 0.562906169 | 0.591634742 | 0.588558952 | 0.587575491 |
| 0.6 | 0.529820120 | 0.557143535 | 0.586006935 | 0.582927224 | 0.581942225 |
| 0.7 | 0.541467455 | 0.568716935 | 0.597712120 | 0.594618012 | 0.593629526 |
| 0.8 | 0.569732776 | 0.596951988 | 0.626008824 | 0.622898279 | 0.621907458 |
| 0.9 | 0.614392311 | 0.641457729 | 0.670351225 | 0.667237617 | 0.666250842 |
| 1.0 | 0.675192037 | 0.701764495 | 0.730069610 | 0.726985837 | 0.726015790 |
| Euler | Improved Euler | “Exact” |
Example 3.2.4
Use step sizes \(h=0.2\), \(h=0.1\), and \(h=0.05\) to find approximate values of the solution of
at \(x=0\), \(0.2\), \(0.4\), \(0.6\), …, \(2.0\) by (a) the improved Euler method; (b) the improved Euler semilinear method. (We used Euler’s method and the Euler semilinear method on this problem in 3.1.4.)
Solution (a) Rewriting (3.2.6) as
and applying the improved Euler method with \(f(x,y)=1+2xy\) yields the results shown in Table 3.2.4.
Solution (b) Since \(y_1=e^{x^2}\) is a solution of the complementary equation \(y'-2xy=0\), we can apply the improved Euler semilinear method to (3.2.6), with
The results listed in Table 3.2.5 are clearly better than those obtained by the improved Euler method.
| \(x\) | \(h=0.2\) | \(h=0.1\) | \(h=0.05\) | “Exact” |
| 0.0 | 3.000000000 | 3.000000000 | 3.000000000 | 3.000000000 |
| 0.2 | 3.328000000 | 3.328182400 | 3.327973600 | 3.327851973 |
| 0.4 | 3.964659200 | 3.966340117 | 3.966216690 | 3.966059348 |
| 0.6 | 5.057712497 | 5.065700515 | 5.066848381 | 5.067039535 |
| 0.8 | 6.900088156 | 6.928648973 | 6.934862367 | 6.936700945 |
| 1.0 | 10.065725534 | 10.154872547 | 10.177430736 | 10.184923955 |
| 1.2 | 15.708954420 | 15.970033261 | 16.041904862 | 16.067111677 |
| 1.4 | 26.244894192 | 26.991620960 | 27.210001715 | 27.289392347 |
| 1.6 | 46.958915746 | 49.096125524 | 49.754131060 | 50.000377775 |
| 1.8 | 89.982312641 | 96.200506218 | 98.210577385 | 98.982969504 |
| 2.0 | 184.563776288 | 203.151922739 | 209.464744495 | 211.954462214 |
| \(x\) | \(h=0.2\) | \(h=0.1\) | \(h=0.05\) | “Exact” |
| 0.0 | 3.000000000 | 3.000000000 | 3.000000000 | 3.000000000 |
| 0.2 | 3.326513400 | 3.327518315 | 3.327768620 | 3.327851973 |
| 0.4 | 3.963383070 | 3.965392084 | 3.965892644 | 3.966059348 |
| 0.6 | 5.063027290 | 5.066038774 | 5.066789487 | 5.067039535 |
| 0.8 | 6.931355329 | 6.935366847 | 6.936367564 | 6.936700945 |
| 1.0 | 10.178248417 | 10.183256733 | 10.184507253 | 10.184923955 |
| 1.2 | 16.059110511 | 16.065111599 | 16.066611672 | 16.067111677 |
| 1.4 | 27.280070674 | 27.287059732 | 27.288809058 | 27.289392347 |
| 1.6 | 49.989741531 | 49.997712997 | 49.999711226 | 50.000377775 |
| 1.8 | 98.971025420 | 98.979972988 | 98.982219722 | 98.982969504 |
| 2.0 | 211.941217796 | 211.951134436 | 211.953629228 | 211.954462214 |
A Family of Methods with \(O(h^3)\) Local Truncation Error
We’ll now derive a class of methods with \(O(h^3)\) local truncation error for solving (3.2.1). For simplicity, we assume that \(f\), \(f_x\), \(f_y\), \(f_{xx}\), \(f_{yy}\), and \(f_{xy}\) are continuous and bounded for all \((x,y)\). This implies that if \(y\) is the solution of (3.2.1 then \(y''\) and \(y'''\) are bounded (Exercise 31).
We begin by approximating the integral curve of (3.2.1) at \((x_i,y(x_i))\) by the line through \((x_i,y(x_i))\) with slope
where \(\sigma\), \(\rho\), and \(\theta\) are constants that we’ll soon specify; however, we insist at the outset that \(0<\theta\le 1\), so that
The equation of the approximating line is
Setting \(x=x_{i+1}=x_i+h\) in (3.2.7) yields
as an approximation to \(y(x_{i+1})\).
To determine \(\sigma\), \(\rho\), and \(\theta\) so that the error
in this approximation is \(O(h^3)\), we begin by recalling from Taylor’s theorem that
where \(\hat x_i\) is in \((x_i,x_{i+1})\). Since \(y'''\) is bounded this implies that
Comparing this with (3.2.8) shows that \(E_i=O(h^3)\) if
However, applying Taylor’s theorem to \(y'\) shows that
where \(\overline x_i\) is in \((x_i,x_i+\theta h)\). Since \(y'''\) is bounded, this implies that
Substituting this into (3.2.9) and noting that the sum of two \(O(h^2)\) terms is again \(O(h^2)\) shows that \(E_i=O(h^3)\) if
which is true if
Since \(y'=f(x,y)\), we can now conclude from (3.2.8) that
if \(\sigma\), \(\rho\), and \(\theta\) satisfy (3.2.10). However, this formula would not be useful even if we knew \(y(x_i)\) exactly (as we would for \(i=0\)), since we still wouldn’t know \(y(x_i+\theta h)\) exactly. To overcome this difficulty, we again use Taylor’s theorem to write
where \(\tilde x_i\) is in \((x_i,x_i+\theta h)\). Since \(y'(x_i)=f(x_i,y(x_i))\) and \(y''\) is bounded, this implies that
for some constant \(K\). Since \(f_y\) is bounded, the mean value theorem implies that
for some constant \(M\). Letting
and recalling (3.2.12) shows that
Substituting this into (3.2.11) yields
This implies that the formula
has \(O(h^3)\) local truncation error if \(\sigma\), \(\rho\), and \(\theta\) satisfy (3.2.10). Substituting \(\sigma=1-\rho\) and \(\theta=1/2\rho\) here yields
The computation indicated here can be conveniently organized as follows: given \(y_i\), compute
Consistent with our requirement that \(0<\theta<1\), we require that \(\rho\ge1/2\). Letting \(\rho=1/2\) in (3.2.13) yields the improved Euler method (3.2.4). Letting \(\rho=3/4\) yields Heun’s method,
which can be organized as
Letting \(\rho=1\) yields the midpoint method,
which can be organized as
Examples involving the midpoint method and Heun’s method are given in Exercises 23-30.
3.2 Exercises
Most of the following numerical exercises involve initial value problems considered in the exercises in Section 3.1. You’ll find it instructive to compare the results that you obtain here with the corresponding results that you obtained in Section 3.1.
In Exercises 1–5 use the improved Euler method to find approximate values of the solution of the given initial value problem at the points \(x_i=x_0+ih\), where \(x_0\) is the point where the initial condition is imposed and \(i=1\), \(2\), \(3\).
-
C \(y'=2x^2+3y^2-2,\quad y(2)=1;\quad h=0.05\)
Show answer
\(y_1=1.542812500,\; y_2=2.421622101,\; y_3=4.208020541\)
-
C \(y'=y+\sqrt{x^2+y^2},\quad y(0)=1;\quad h=0.1\)
Show answer
\(y_1=1.220207973,\; y_2=1.489578775\; y_3=1.819337186\)
-
C \(y'+3y=x^2-3xy+y^2,\quad y(0)=2;\quad h=0.05\)
Show answer
\(y_1=1.890687500,\; y_2=1.763784003,\; y_3=1.622698378\)
-
C \(y'=\dst{1+x\over1-y^2},\quad y(2)=3;\quad h=0.1\)
Show answer
\(y_1=2.961317914\) \(y_2=2.920132727\) \(y_3=2.876213748\).
-
C \(y'+x^2y=\sin xy,\quad y(1)=\pi;\quad h=0.2\)
Show answer
\(y_1=2.478055238,\; y_2=1.844042564,\; y_3=1.313882333\)
-
C Use the improved Euler method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of the initial value problem
\[ y'+3y=7e^{4x},\quad y(0)=2 \]at \(x=0\), \(0.1\), \(0.2\), \(0.3\), …, \(1.0\). Compare these approximate values with the values of the exact solution \(y=e^{4x}+e^{-3x}\), which can be obtained by the method of Section 2.1. Present your results in a table like Table 3.2.2.
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) Exact 1.0 56.134480009 55.003390448 54.734674836 54.647937102 -
C Use the improved Euler method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of the initial value problem
\[ y'+{2\over x}y={3\over x^3}+1,\quad y(1)=1 \]at \(x=1.0\), \(1.1\), \(1.2\), \(1.3\), …, \(2.0\). Compare these approximate values with the values of the exact solution
\[ y={1\over3x^2}(9\ln x+x^3+2) \]which can be obtained by the method of Section 2.1. Present your results in a table like Table 3.2.2.
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) Exact 2.0 1.353501839 1.353288493 1.353219485 1.353193719 -
C Use the improved Euler method with step sizes \(h=0.05\), \(h=0.025\), and \(h=0.0125\) to find approximate values of the solution of the initial value problem
\[ y'={y^2+xy-x^2\over x^2},\quad y(1)=2, \]at \(x=1.0\), \(1.05\), \(1.10\), \(1.15\), …, \(1.5\). Compare these approximate values with the values of the exact solution
\[ y={x(1+x^2/3)\over1-x^2/3} \]obtained in Example 2.4.3. Present your results in a table like Table 3.2.2.
Show answer
\(x\) \(h=0.05\) \(h=0.025\) \(h=0.0125\) Exact 1.50 10.141969585 10.396770409 10.472502111 10.500000000 -
C In Example 3.2.2 it was shown that
\[ y^5+y=x^2+x-4 \]is an implicit solution of the initial value problem
\[ y'={2x+1\over5y^4+1},\quad y(2)=1. \tag*{\rm(A)} \]Use the improved Euler method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of (A) at \(x=2.0\), \(2.1\), \(2.2\), \(2.3\), …, \(3.0\). Present your results in tabular form. To check the error in these approximate values, construct another table of values of the residual
\[ R(x,y)=y^5+y-x^2-x+4 \]for each value of \((x,y)\) appearing in the first table.
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) \(h=0.1\) \(h=0.05\) \(h=0.025\) 3.0 1.455674816 1.455935127 1.456001289 -0.00818 -0.00207 -0.000518 Approximate Solutions Residuals -
C You can see from Example 2.5.1 that
\[ x^4y^3+x^2y^5+2xy=4 \]is an implicit solution of the initial value problem
\[ y'=-{4x^3y^3+2xy^5+2y\over3x^4y^2+5x^2y^4+2x},\quad y(1)=1. \tag*{\rm(A)} \]Use the improved Euler method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of (A) at \(x=1.0\), \(1.14\), \(1.2\), \(1.3\), …, \(2.0\). Present your results in tabular form. To check the error in these approximate values, construct another table of values of the residual
\[ R(x,y)=x^4y^3+x^2y^5+2xy-4 \]for each value of \((x,y)\) appearing in the first table.
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) \(h=0.1\) \(h=0.05\) \(h=0.025\) 2.0 0.492862999 0.492709931 0.492674855 0.00335 0.000777 0.000187 Approximate Solutions Residuals -
C Use the improved Euler method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of the initial value problem
\[ (3y^2+4y)y'+2x+\cos x=0, \quad y(0)=1 \mbox{\ (Exercise~2.2.~\hspace*{-3pt}\ref{exer:2.2.13})} \]at \(x=0\), \(0.1\), \(0.2\), \(0.3\), …, \(1.0\).
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 0.660268159 0.660028505 0.659974464 0.659957689 -
C Use the improved Euler method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of the initial value problem
\[ y'+{(y+1)(y-1)(y-2)\over x+1}=0, \quad y(1)=0 \mbox{\ (Exercise~2.2.~\hspace*{-3pt}\ref{exer:2.2.14})} \]at \(x=1.0\), \(1.1\), \(1.2\), \(1.3\), …, \(2.0\).
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 2.0 -0.749751364 -0.750637632 -0.750845571 -0.750912371 -
C Use the improved Euler method and the improved Euler semilinear method with step sizes \(h=0.1\), \(h=0.05\), and \(h=0.025\) to find approximate values of the solution of the initial value problem
\[ y'+3y=e^{-3x}(1-2x),\quad y(0)=2, \]at \(x=0\), \(0.1\), \(0.2\), \(0.3\), …, \(1.0\). Compare these approximate values with the values of the exact solution \(y=e^{-3x}(2+x-x^2)\), which can be obtained by the method of Section 2.1. Do you notice anything special about the results? Explain.
Show answer
Applying variation of parameters to the given initial value problem
\(y=ue^{-3x}\), where (A) \(u'=1-2x,\quad u(0)=2\). Since \(u'''=0\), the improved Euler method yields the exact solution of (A). Therefore the improved Euler semilinear method produces the exact solution of the given problem.
Improved Euler method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) Exact 1.0 0.105660401 0.100924399 0.099893685 0.099574137 Improved Euler semilinear method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) Exact 1.0 0.099574137 0.099574137 0.099574137 0.099574137
The linear initial value problems in Exercises 14–19 can’t be solved exactly in terms of known elementary functions. In each exercise use the improved Euler and improved Euler semilinear methods with the indicated step sizes to find approximate values of the solution of the given initial value problem at 11 equally spaced points (including the endpoints) in the interval.
-
C \(y'-2y=\dst{1\over1+x^2},\quad y(2)=2\); \(h=0.1,0.05,0.025\) on \([2,3]\)
Show answer
Improved Euler method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 3.0 15.107600968 15.234856000 15.269755072 15.282004826 Improved Euler semilinear method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 3.0 15.285231726 15.282812424 15.282206780 15.282004826 -
C \(y'+2xy=x^2,\quad y(0)=3\); \(h=0.2,0.1,0.05\) on \([0,2]\) (Exercise 2.1. 38)
Show answer
Improved Euler method \(x\) \(h=0.2\) \(h=0.1\) \(h=0.05\) “Exact" 2.0 0.924335375 0.907866081 0.905058201 0.904276722 Improved Euler semilinear method \(x\) \(h=0.2\) \(h=0.1\) \(h=0.05\) “Exact" 2.0 0.969670789 0.920861858 0.908438261 0.904276722 -
C \(\dst{y'+{1\over x}y={\sin x\over x^2},\quad y(1)=2}\), \(h=0.2,0.1,0.05\) on \([1,3]\) (Exercise 2.1.39)
Show answer
Improved Euler method \(x\) \(h=0.2\) \(h=0.1\) \(h=0.05\) “Exact" 3.0 0.967473721 0.967510790 0.967520062 0.967523153 Improved Euler semilinear method \(x\) \(h=0.2\) \(h=0.1\) \(h=0.05\) “Exact" 3.0 0.967473721 0.967510790 0.967520062 0.967523153 -
C \(\dst{y'+y={e^{-x}\tan x\over x},\quad y(1)=0}\); \(h=0.05,0.025,0.0125\) on \([1,1.5]\) (Exercise 2.1. 40),
Show answer
Improved Euler method \(x\) \(h=0.0500\) \(h=0.0250\) \(h=0.0125\) “Exact" 1.50 0.349176060 0.345171664 0.344131282 0.343780513 Improved Euler semilinear method \(x\) \(h=0.0500\) \(h=0.0250\) \(h=0.0125\) “Exact" 1.50 0.349350206 0.345216894 0.344142832 0.343780513 -
C \(\dst{y'+{2x\over 1+x^2}y={e^x\over (1+x^2)^2}, \quad y(0)=1}\); \(h=0.2,0.1,0.05\) on \([0,2]\) (Exercise 2.1. 41)
Show answer
Improved Euler method \(x\) \(h=0.2\) \(h=0.1\) \(h=0.05\) “Exact" 2.0 0.732679223 0.732721613 0.732667905 0.732638628 Improved Euler semilinear method \(x\) \(h=0.2\) \(h=0.1\) \(h=0.05\) “Exact" 2.0 0.732166678 0.732521078 0.732609267 0.732638628 -
C \(xy'+(x+1)y=e^{x^2},\quad y(1)=2\); \(h=0.05,0.025,0.0125\) on \([1,1.5]\) (Exercise 2.1. 42)
Show answer
Improved Euler method \(x\) \(h=0.0500\) \(h=0.0250\) \(h=0.0125\) “Exact" 1.50 2.247880315 2.244975181 2.244260143 2.244023982 Improved Euler semilinear method \(x\) \(h=0.0500\) \(h=0.0250\) \(h=0.0125\) “Exact" 1.50 2.248603585 2.245169707 2.244310465 2.244023982
In Exercises 20–22 use the improved Euler method and the improved Euler semilinear method with the indicated step sizes to find approximate values of the solution of the given initial value problem at 11 equally spaced points (including the endpoints) in the interval.
-
C \(y'+3y=xy^2(y+1),\quad y(0)=1\); \(h=0.1,0.05,0.025\) on \([0,1]\)
Show answer
Improved Euler method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 0.059071894 0.056999028 0.056553023 0.056415515 Improved Euler semilinear method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 0.056295914 0.056385765 0.056408124 0.056415515 -
C \(\dst{y'-4y={x\over y^2(y+1)},\quad y(0)=1}\); \(h=0.1,0.05,0.025\) on \([0,1]\)
Show answer
Improved Euler method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 50.534556346 53.483947013 54.391544440 54.729594761 Improved Euler semilinear method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 54.709041434 54.724083572 54.728191366 54.729594761 -
C \(\dst{y'+2y={x^2\over1+y^2},\quad y(2)=1}\); \(h=0.1,0.05,0.025\) on \([2,3]\)
Show answer
Improved Euler method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 3.0 1.361395309 1.361379259 1.361382239 1.361383810 Improved Euler semilinear method \(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 3.0 1.375699933 1.364730937 1.362193997 1.361383810 -
C Do Exercise 7 with “improved Euler method” replaced by “midpoint method.”
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) Exact 2.0 1.349489056 1.352345900 1.352990822 1.353193719 -
C Do Exercise 7 with “improved Euler method” replaced by “Heun’s method.”
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) Exact 2.0 1.350890736 1.352667599 1.353067951 1.353193719 -
C Do Exercise 8 with “improved Euler method” replaced by “midpoint method.”
Show answer
\(x\) \(h=0.05\) \(h=0.025\) \(h=0.0125\) Exact 1.50 10.133021311 10.391655098 10.470731411 10.500000000 -
C Do Exercise 8 with “improved Euler method” replaced by “Heun’s method.”
Show answer
\(x\) \(h=0.05\) \(h=0.025\) \(h=0.0125\) Exact 1.50 10.136329642 10.393419681 10.470731411 10.500000000 -
C Do Exercise 11 with “improved Euler method” replaced by “midpoint method.”
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 0.660846835 0.660189749 0.660016904 0.659957689 -
C Do Exercise 11 with “improved Euler method” replaced by “Heun’s method.”
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 1.0 0.660658411 0.660136630 0.660002840 0.659957689 -
C Do Exercise 12 with “improved Euler method” replaced by “midpoint method.”
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 2.0 -0.750626284 -0.750844513 -0.750895864 -0.751331499 -
C Do Exercise 12 with “improved Euler method” replaced by “Heun’s method.”
Show answer
\(x\) \(h=0.1\) \(h=0.05\) \(h=0.025\) “Exact" 2.0 -0.750335016 -0.750775571 -0.750879100 -0.751331499 -
Show that if \(f\), \(f_x\), \(f_y\), \(f_{xx}\), \(f_{yy}\), and \(f_{xy}\) are continuous and bounded for all \((x,y)\) and \(y\) is the solution of the initial value problem
\[ y'=f(x,y),\quad y(x_0)=y_0, \]then \(y''\) and \(y'''\) are bounded.
-
Numerical Quadrature (see Exercise 3.1. 23).
Derive the quadrature formula
\[ \int_a^bf(x)\,dx\approx .5h(f(a)+f(b))+ h\sum_{i=1}^{n-1}f(a+ih)\mbox{\quad(where $h=(b-a)/n)$} \tag*{\rm(A)} \]by applying the improved Euler method to the initial value problem
\[ y'=f(x),\quad y(a)=0. \]The quadrature formula (A) is called the trapezoid rule. Draw a figure that justifies this terminology.
L For several choices of \(a\), \(b\), \(A\), and \(B\), apply (A) to \(f(x)=A+Bx\), with \(n = 10,20,40,80,160,320\). Compare your results with the exact answers and explain what you find.
L For several choices of \(a\), \(b\), \(A\), \(B\), and \(C\), apply (A) to \(f(x)=A+Bx+Cx^2\), with \(n=10\), \(20\), \(40\), \(80\), \(160\), \(320\). Compare your results with the exact answers and explain what you find.