{"id":1625,"date":"2021-07-22T17:08:41","date_gmt":"2021-07-22T17:08:41","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/calculus2\/?post_type=chapter&#038;p=1625"},"modified":"2022-03-21T22:56:32","modified_gmt":"2022-03-21T22:56:32","slug":"eulers-method","status":"publish","type":"chapter","link":"https:\/\/courses.lumenlearning.com\/calculus2\/chapter\/eulers-method\/","title":{"raw":"Euler\u2019s Method","rendered":"Euler\u2019s Method"},"content":{"raw":"<div class=\"textbox learning-objectives\" data-type=\"abstract\">\r\n<h3>Learning Outcomes<\/h3>\r\n<ul>\r\n \t<li>Use Euler\u2019s Method to approximate the solution to a first-order differential equation<\/li>\r\n<\/ul>\r\n<\/div>\r\n<p id=\"fs-id1170571095412\">Consider the initial-value problem<\/p>\r\n\r\n<div id=\"fs-id1170571340434\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }=2x - 3,y\\left(0\\right)=3[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571050008\">Integrating both sides of the differential equation gives [latex]y={x}^{2}-3x+C[\/latex], and solving for [latex]C[\/latex] yields the particular solution [latex]y={x}^{2}-3x+3[\/latex]. The solution for this initial-value problem appears as the parabola in Figure 10.<\/p>\r\n\r\n<figure id=\"CNX_Calc_Figure_08_02_010\"><figcaption><\/figcaption>[caption id=\"\" align=\"aligncenter\" width=\"417\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233959\/CNX_Calc_Figure_08_02_010.jpg\" alt=\"A graph over the range [-1,4] for x and y. The given upward opening parabola is drawn with vertex at (1.5, 0.75). Individual points are plotted at (0, 3), (0.5, 1.5), (1, 0.5), (1.5, 0), (2, 0), (2.5, 0.5), and (3, 1.5) with line segments connecting them.\" width=\"417\" height=\"422\" data-media-type=\"image\/jpeg\" \/> Figure 10. Euler\u2019s Method for the initial-value problem [latex]{y}^{\\prime }=2x - 3,y\\left(0\\right)=3[\/latex].[\/caption]<\/figure>\r\n<p id=\"fs-id1170571337276\">The red graph consists of line segments that approximate the solution to the initial-value problem. The graph starts at the same initial value of [latex]\\left(0,3\\right)[\/latex]. Then the slope of the solution at any point is determined by the right-hand side of the differential equation, and the length of the line segment is determined by increasing the [latex]x[\/latex] value by [latex]0.5[\/latex] each time (the <em data-effect=\"italics\">step size<\/em>). This approach is the basis of Euler\u2019s Method.<\/p>\r\n<p id=\"fs-id1170571292460\">Before we state Euler\u2019s Method as a theorem, let\u2019s consider another initial-value problem:<\/p>\r\n\r\n<div id=\"fs-id1170573499033\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }={x}^{2}-{y}^{2},y\\left(-1\\right)=2[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170573418282\">The idea behind direction fields can also be applied to this problem to study the behavior of its solution. For example, at the point [latex]\\left(-1,2\\right)[\/latex], the slope of the solution is given by [latex]y^{\\prime} ={\\left(-1\\right)}^{2}-{2}^{2}=-3[\/latex], so the slope of the tangent line to the solution at that point is also equal to [latex]-3[\/latex]. Now we define [latex]{x}_{0}=-1[\/latex] and [latex]{y}_{0}=2[\/latex]. Since the slope of the solution at this point is equal to [latex]-3[\/latex], we can use the method of linear approximation to approximate [latex]y[\/latex] near [latex]\\left(-1,2\\right)[\/latex].<\/p>\r\n\r\n<div id=\"fs-id1170573351863\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]L\\left(x\\right)={y}_{0}+{f}^{\\prime }\\left({x}_{0}\\right)\\left(x-{x}_{0}\\right)[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170573734324\">Here [latex]{x}_{0}=-1,{y}_{0}=2[\/latex], and [latex]{f}^{\\prime }\\left({x}_{0}\\right)=-3[\/latex], so the linear approximation becomes<\/p>\r\n\r\n<div id=\"fs-id1170570995890\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}L\\left(x\\right)\\hfill &amp; =2 - 3\\left(x-\\left(-1\\right)\\right)\\hfill \\\\ &amp; =2 - 3x - 3\\hfill \\\\ &amp; =-3x - 1.\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170573734268\">Now we choose a <span data-type=\"term\">step size<\/span>. The step size is a small value, typically [latex]0.1[\/latex] or less, that serves as an increment for [latex]x[\/latex]; it is represented by the variable [latex]h[\/latex]. In our example, let [latex]h=0.1[\/latex]. Incrementing [latex]{x}_{0}[\/latex] by [latex]h[\/latex] gives our next [latex]x[\/latex] value:<\/p>\r\n\r\n<div id=\"fs-id1170571060836\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{x}_{1}={x}_{0}+h=-1+0.1=-0.9[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170573415281\">We can substitute [latex]{x}_{1}=-0.9[\/latex] into the linear approximation to calculate [latex]{y}_{1}[\/latex].<\/p>\r\n\r\n<div id=\"fs-id1170571346180\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}{y}_{1}\\hfill &amp; =L\\left({x}_{1}\\right)\\hfill \\\\ &amp; =-3\\left(-0.9\\right)-1\\hfill \\\\ &amp; =1.7.\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571506094\">Therefore the approximate [latex]y[\/latex] value for the solution when [latex]x=-0.9[\/latex] is [latex]y=1.7[\/latex]. We can then repeat the process, using [latex]{x}_{1}=-0.9[\/latex] and [latex]{y}_{1}=1.7[\/latex] to calculate [latex]{x}_{2}[\/latex] and [latex]{y}_{2}[\/latex]. The new slope is given by [latex]y^{\\prime} ={\\left(-0.9\\right)}^{2}-{\\left(1.7\\right)}^{2}=-2.08[\/latex]. First, [latex]{x}_{2}={x}_{1}+h=-0.9+0.1=-0.8[\/latex]. Using linear approximation gives<\/p>\r\n\r\n<div id=\"fs-id1170571142558\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}L\\left(x\\right)\\hfill &amp; ={y}_{1}+{f}^{\\prime }\\left({x}_{1}\\right)\\left(x-{x}_{1}\\right)\\hfill \\\\ &amp; =1.7 - 2.08\\left(x-\\left(-0.9\\right)\\right)\\hfill \\\\ &amp; =1.7 - 2.08x - 1.872\\hfill \\\\ &amp; =-2.08x - 0.172.\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571376302\">Finally, we substitute [latex]{x}_{2}=-0.8[\/latex] into the linear approximation to calculate [latex]{y}_{2}[\/latex].<\/p>\r\n\r\n<div id=\"fs-id1170573438533\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}{y}_{2}\\hfill &amp; =L\\left({x}_{2}\\right)\\hfill \\\\ &amp; =-2.08{x}_{2}-0.172\\hfill \\\\ &amp; =-2.08\\left(-0.8\\right)-0.172\\hfill \\\\ &amp; =1.492.\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571304002\">Therefore the approximate value of the solution to the differential equation is [latex]y=1.492[\/latex] when [latex]x=-0.8[\/latex].<\/p>\r\n<p id=\"fs-id1170573726108\">What we have just shown is the idea behind <span data-type=\"term\">Euler\u2019s Method<\/span>. Repeating these steps gives a list of values for the solution. These values are shown in the table below, rounded off to four decimal places.<\/p>\r\n\r\n<table id=\"fs-id1170573401360\" summary=\"A table with three columns and twelve rows. The first has the label \"><caption><span data-type=\"title\">Using Euler\u2019s Method to Approximate Solutions to a Differential Equation<\/span><\/caption>\r\n<tbody>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]n[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]3[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]4[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]5[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]{x}_{n}[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.9[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.8[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.6[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.5[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]{y}_{n}[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.492[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.3334[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.2046[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.0955[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]n[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]6[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]8[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]9[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]10[\/latex]<\/td>\r\n<td><\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]{x}_{n}[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.4[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.3[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-0.1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\r\n<td><\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]{y}_{n}[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.0004[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.9164[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.8414[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.7746[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.7156[\/latex]<\/td>\r\n<td><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<div id=\"fs-id1170571415778\" class=\"theorem\" data-type=\"note\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox shaded\">\r\n<h3 style=\"text-align: center;\" data-type=\"title\">Euler\u2019s Method<\/h3>\r\n\r\n<hr \/>\r\n<p id=\"fs-id1170570989809\">Consider the initial-value problem<\/p>\r\n<p id=\"fs-id1170570989812\" style=\"text-align: center;\">[latex]y^{\\prime} =f\\left(x,y\\right),y\\left({x}_{0}\\right)={y}_{0}[\/latex].<\/p>\r\n&nbsp;\r\n<p id=\"fs-id1170571332659\">To approximate a solution to this problem using Euler\u2019s method, define<\/p>\r\n\r\n<div id=\"fs-id1170573525577\" style=\"text-align: center;\" data-type=\"equation\">[latex]\\begin{array}{c}{x}_{n}={x}_{0}+nh\\hfill \\\\ {y}_{n}={y}_{n - 1}+hf\\left({x}_{n - 1},{y}_{n - 1}\\right).\\hfill \\end{array}[\/latex]<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571278799\">Here [latex]h&gt;0[\/latex] represents the step size and [latex]n[\/latex] is an integer, starting with [latex]1[\/latex]. The number of steps taken is counted by the variable [latex]n[\/latex].<\/p>\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<p id=\"fs-id1170571512284\">Typically [latex]h[\/latex] is a small value, say [latex]0.1[\/latex] or [latex]0.05[\/latex]. The smaller the value of [latex]h[\/latex], the more calculations are needed. The higher the value of [latex]h[\/latex], the fewer calculations are needed. However, the tradeoff results in a lower degree of accuracy for larger step size, as illustrated in Figure 11.<\/p>\r\n\r\n<figure id=\"CNX_Calc_Figure_08_02_011\"><figcaption><\/figcaption>[caption id=\"\" align=\"aligncenter\" width=\"858\"]<img src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11234004\/CNX_Calc_Figure_08_02_011.jpg\" alt=\"Two graphs of the same parabola, y = x ^ 2 \u2013 3 x + 3. The first shows Euler\u2019s method for the given initial-value problem with a step size of h = 0.05, and the second shows Euler\u2019s method with a step size of h = 0.25. The first then has the points (0, 3), (.5, 1.5), (1, 0.5), (1.5, 0), (2, 0), (2.5, 0.5), and (3, 1.5) plotted with line segments connecting them. The second has the points (0, 3), (0.25, 2.25), (0.5, 1.625), (0.75, 1.125), (1, 0.75), (1.25, 0.5), (1.5, 0.375), (2, 0.5), (2.25, 0.75), (2.5, 1.125), (2.75, 1.625), and (3, 2.25) plotted with line segments connecting them.\" width=\"858\" height=\"461\" data-media-type=\"image\/jpeg\" \/> Figure 11. Euler\u2019s method for the initial-value problem [latex]{y}^{\\prime }=2x - 3,y\\left(0\\right)=3[\/latex] with (a) a step size of [latex]h=0.5[\/latex]; and (b) a step size of [latex]h=0.25[\/latex].[\/caption]<\/figure>\r\n<div id=\"fs-id1170573756803\" data-type=\"example\">\r\n<div id=\"fs-id1170573756805\" data-type=\"exercise\">\r\n<div id=\"fs-id1170573756807\" data-type=\"problem\">\r\n<div data-type=\"title\">\r\n<div class=\"textbox exercises\">\r\n<h3>Example:\u00a0Using Euler\u2019s Method<\/h3>\r\n<div id=\"fs-id1170573756807\" data-type=\"problem\">\r\n<p id=\"fs-id1170571103641\">Consider the initial-value problem<\/p>\r\n\r\n<div id=\"fs-id1170571103644\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }=3{x}^{2}-{y}^{2}+1,y\\left(0\\right)=2[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571103620\">Use Euler\u2019s method with a step size of [latex]0.1[\/latex] to generate a table of values for the solution for values of [latex]x[\/latex] between [latex]0[\/latex] and [latex]1[\/latex].<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558894\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558894\"]\r\n<div id=\"fs-id1170570999104\" data-type=\"solution\">\r\n<p id=\"fs-id1170570999107\">We are given [latex]h=0.1[\/latex] and [latex]f\\left(x,y\\right)=3{x}^{2}-{y}^{2}+1[\/latex]. Furthermore, the initial condition [latex]y\\left(0\\right)=2[\/latex] gives [latex]{x}_{0}=0[\/latex] and [latex]{y}_{0}=2[\/latex]. Using Euler's method with [latex]n=0[\/latex], we can generate the following table.<\/p>\r\n\r\n<table id=\"fs-id1170571140163\" summary=\"A table with three columns and twelve rows. The first column has the header \"><caption><span data-type=\"title\">Using Euler\u2019s Method to Approximate Solutions to a Differential Equation<\/span><\/caption>\r\n<tbody>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]n[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{x}_{n}[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{n}={y}_{n - 1}+hf\\left({x}_{n - 1},{y}_{n - 1}\\right)[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{1}={y}_{0}+hf\\left({x}_{0},{y}_{0}\\right)=1.7[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{2}={y}_{1}+hf\\left({x}_{1},{y}_{1}\\right)=1.514[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]3[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.3[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{3}={y}_{2}+hf\\left({x}_{2},{y}_{2}\\right)=1.3968[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]4[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.4[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{4}={y}_{3}+hf\\left({x}_{3},{y}_{3}\\right)=1.3287[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]5[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.5[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{5}={y}_{4}+hf\\left({x}_{4},{y}_{4}\\right)=1.3001[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]6[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.6[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{6}={y}_{5}+hf\\left({x}_{5},{y}_{5}\\right)=1.3061[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{7}={y}_{6}+hf\\left({x}_{6},{y}_{6}\\right)=1.3435[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]8[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.8[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{8}={y}_{7}+hf\\left({x}_{7},{y}_{7}\\right)=1.4100[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]9[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]0.9[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{9}={y}_{8}+hf\\left({x}_{8},{y}_{8}\\right)=1.5032[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]10[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.0[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{10}={y}_{9}+hf\\left({x}_{9},{y}_{9}\\right)=1.6202[\/latex]<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<p id=\"fs-id1170571086078\">With ten calculations, we are able to approximate the values of the solution to the initial-value problem for values of [latex]x[\/latex] between [latex]0[\/latex] and [latex]1[\/latex].<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n[caption]Watch the following videos to see the worked solution to Example:\u00a0Using Euler\u2019s Method[\/caption]\r\n\r\n<center><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/D9YQRFYG_XU?controls=0&amp;start=59&amp;end=425&amp;autoplay=0\" width=\"750\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/center>\r\n<p class=\"p1\">For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.<\/p>\r\nYou can view the <a href=\"https:\/\/oerfiles.s3.us-west-2.amazonaws.com\/Calculus+II\/Transcripts\/4.2.3_59to425_transcript.html\" target=\"_blank\" rel=\"noopener\">transcript for this segmented clip of \"4.2.3\" here (opens in new window)<\/a>.\r\n<div id=\"fs-id1170572366188\" class=\"textbox tryit\">\r\n<h3>Interactive<\/h3>\r\n<p id=\"fs-id1170572366192\">Visit <a href=\"https:\/\/www.geogebra.org\/m\/KNxfhNmq\" target=\"_blank\" rel=\"noopener\">this applet for more practice using Euler\u2019s method<\/a>.<\/p>\r\n\r\n<\/div>\r\n<div id=\"fs-id1170571260260\" class=\"checkpoint\" data-type=\"note\">\r\n<div id=\"fs-id1170571260263\" data-type=\"exercise\">\r\n<div id=\"fs-id1170571260265\" data-type=\"problem\">\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Key Takeaways<\/h3>\r\n<div id=\"fs-id1170571260265\" data-type=\"problem\">\r\n<p id=\"fs-id1170571260267\">Consider the initial-value problem<\/p>\r\n\r\n<div id=\"fs-id1170571169480\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }={x}^{3}+{y}^{2},y\\left(1\\right)=-2[\/latex].<\/div>\r\n&nbsp;\r\n<p id=\"fs-id1170571298232\">Using a step size of [latex]0.1[\/latex], generate a table with approximate values for the solution to the initial-value problem for values of [latex]x[\/latex] between [latex]1[\/latex] and [latex]2[\/latex].<\/p>\r\n\r\n<\/div>\r\n[reveal-answer q=\"44558892\"]Hint[\/reveal-answer]\r\n[hidden-answer a=\"44558892\"]\r\n<div id=\"fs-id1170571209312\" data-type=\"commentary\" data-element-type=\"hint\">\r\n<p id=\"fs-id1170571209318\">Start by identifying the value of [latex]h[\/latex], then figure out what [latex]f\\left(x,y\\right)[\/latex] is. Then use the formula for Euler\u2019s Method to calculate [latex]{y}_{1},{y}_{2}[\/latex], and so on.<\/p>\r\n\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n[reveal-answer q=\"44558893\"]Show Solution[\/reveal-answer]\r\n[hidden-answer a=\"44558893\"]\r\n<div id=\"fs-id1170573720268\" data-type=\"solution\">\r\n<table id=\"fs-id1170573720273\" class=\"unnumbered\" summary=\"A table with three columns and eleven rows. The first column has the header n and the values 0 through 10. The second column has the header x_n and the values 1 through 2, increasing by 0.1. The third column has the header y_n = y_(n - 1) + hf(x_(n - 1), y_(n - 1)) and the values -2, -1.5, -1.1419, -0.8387, -0.5487, -0.2442, 0.0993, 0.5099, 1.0272, 1.7159, and 2.6962.\" data-label=\"\">\r\n<thead>\r\n<tr valign=\"top\">\r\n<th data-align=\"left\">[latex]n[\/latex]<\/th>\r\n<th data-align=\"left\">[latex]{x}_{n}[\/latex]<\/th>\r\n<th data-align=\"left\">[latex]{y}_{n}={y}_{n - 1}+hf\\left({x}_{n - 1},{y}_{n - 1}\\right)[\/latex]<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]-2[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.1[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{1}={y}_{0}+hf\\left({x}_{0},{y}_{0}\\right)=-1.5[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{2}={y}_{1}+hf\\left({x}_{1},{y}_{1}\\right)=-1.1419[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]3[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.3[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{3}={y}_{2}+hf\\left({x}_{2},{y}_{2}\\right)=-0.8387[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]4[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.4[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{4}={y}_{3}+hf\\left({x}_{3},{y}_{3}\\right)=-0.5487[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]5[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.5[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{5}={y}_{4}+hf\\left({x}_{4},{y}_{4}\\right)=-0.2442[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]6[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.6[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{6}={y}_{5}+hf\\left({x}_{5},{y}_{5}\\right)=0.0993[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.7[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{7}={y}_{6}+hf\\left({x}_{6},{y}_{6}\\right)=0.5099[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]8[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.8[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{8}={y}_{7}+hf\\left({x}_{7},{y}_{7}\\right)=1.0272[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]9[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]1.9[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{9}={y}_{8}+hf\\left({x}_{8},{y}_{8}\\right)=1.7159[\/latex]<\/td>\r\n<\/tr>\r\n<tr valign=\"top\">\r\n<td data-align=\"left\">[latex]10[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\r\n<td data-align=\"left\">[latex]{y}_{10}={y}_{9}+hf\\left({x}_{9},{y}_{9}\\right)=2.6962[\/latex]<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\n[\/hidden-answer]\r\n\r\n<\/div>\r\n<div class=\"textbox tryit\">\r\n<div id=\"fs-id1170571260260\" class=\"checkpoint\" data-type=\"note\">\r\n<div id=\"fs-id1170571260263\" data-type=\"exercise\">\r\n<div id=\"fs-id1170571260265\" data-type=\"problem\">\r\n<h3>Interactive<\/h3>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<div id=\"fs-id1170571243506\" class=\"media-2\" data-type=\"note\">\r\n<p id=\"fs-id1170571243509\">Visit <a href=\"https:\/\/www.maa.org\/press\/periodicals\/loci\/joma\/the-sir-model-for-spread-of-disease\" target=\"_blank\" rel=\"noopener\">this website for a practical application of differential equations<\/a>.<\/p>\r\n\r\n<\/div>\r\n<\/div>\r\n<div class=\"textbox key-takeaways\">\r\n<h3>Try It<\/h3>\r\n[ohm_question]5741[\/ohm_question]\r\n\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<section id=\"fs-id1170571042944\" class=\"key-concepts\" data-depth=\"1\"><\/section>\r\n<div data-type=\"glossary\"><\/div>","rendered":"<div class=\"textbox learning-objectives\" data-type=\"abstract\">\n<h3>Learning Outcomes<\/h3>\n<ul>\n<li>Use Euler\u2019s Method to approximate the solution to a first-order differential equation<\/li>\n<\/ul>\n<\/div>\n<p id=\"fs-id1170571095412\">Consider the initial-value problem<\/p>\n<div id=\"fs-id1170571340434\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }=2x - 3,y\\left(0\\right)=3[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571050008\">Integrating both sides of the differential equation gives [latex]y={x}^{2}-3x+C[\/latex], and solving for [latex]C[\/latex] yields the particular solution [latex]y={x}^{2}-3x+3[\/latex]. The solution for this initial-value problem appears as the parabola in Figure 10.<\/p>\n<figure id=\"CNX_Calc_Figure_08_02_010\"><figcaption><\/figcaption><div style=\"width: 427px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11233959\/CNX_Calc_Figure_08_02_010.jpg\" alt=\"A graph over the range [-1,4] for x and y. The given upward opening parabola is drawn with vertex at (1.5, 0.75). Individual points are plotted at (0, 3), (0.5, 1.5), (1, 0.5), (1.5, 0), (2, 0), (2.5, 0.5), and (3, 1.5) with line segments connecting them.\" width=\"417\" height=\"422\" data-media-type=\"image\/jpeg\" \/><\/p>\n<p class=\"wp-caption-text\">Figure 10. Euler\u2019s Method for the initial-value problem [latex]{y}^{\\prime }=2x - 3,y\\left(0\\right)=3[\/latex].<\/p>\n<\/div>\n<\/figure>\n<p id=\"fs-id1170571337276\">The red graph consists of line segments that approximate the solution to the initial-value problem. The graph starts at the same initial value of [latex]\\left(0,3\\right)[\/latex]. Then the slope of the solution at any point is determined by the right-hand side of the differential equation, and the length of the line segment is determined by increasing the [latex]x[\/latex] value by [latex]0.5[\/latex] each time (the <em data-effect=\"italics\">step size<\/em>). This approach is the basis of Euler\u2019s Method.<\/p>\n<p id=\"fs-id1170571292460\">Before we state Euler\u2019s Method as a theorem, let\u2019s consider another initial-value problem:<\/p>\n<div id=\"fs-id1170573499033\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }={x}^{2}-{y}^{2},y\\left(-1\\right)=2[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170573418282\">The idea behind direction fields can also be applied to this problem to study the behavior of its solution. For example, at the point [latex]\\left(-1,2\\right)[\/latex], the slope of the solution is given by [latex]y^{\\prime} ={\\left(-1\\right)}^{2}-{2}^{2}=-3[\/latex], so the slope of the tangent line to the solution at that point is also equal to [latex]-3[\/latex]. Now we define [latex]{x}_{0}=-1[\/latex] and [latex]{y}_{0}=2[\/latex]. Since the slope of the solution at this point is equal to [latex]-3[\/latex], we can use the method of linear approximation to approximate [latex]y[\/latex] near [latex]\\left(-1,2\\right)[\/latex].<\/p>\n<div id=\"fs-id1170573351863\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]L\\left(x\\right)={y}_{0}+{f}^{\\prime }\\left({x}_{0}\\right)\\left(x-{x}_{0}\\right)[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170573734324\">Here [latex]{x}_{0}=-1,{y}_{0}=2[\/latex], and [latex]{f}^{\\prime }\\left({x}_{0}\\right)=-3[\/latex], so the linear approximation becomes<\/p>\n<div id=\"fs-id1170570995890\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}L\\left(x\\right)\\hfill & =2 - 3\\left(x-\\left(-1\\right)\\right)\\hfill \\\\ & =2 - 3x - 3\\hfill \\\\ & =-3x - 1.\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170573734268\">Now we choose a <span data-type=\"term\">step size<\/span>. The step size is a small value, typically [latex]0.1[\/latex] or less, that serves as an increment for [latex]x[\/latex]; it is represented by the variable [latex]h[\/latex]. In our example, let [latex]h=0.1[\/latex]. Incrementing [latex]{x}_{0}[\/latex] by [latex]h[\/latex] gives our next [latex]x[\/latex] value:<\/p>\n<div id=\"fs-id1170571060836\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{x}_{1}={x}_{0}+h=-1+0.1=-0.9[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170573415281\">We can substitute [latex]{x}_{1}=-0.9[\/latex] into the linear approximation to calculate [latex]{y}_{1}[\/latex].<\/p>\n<div id=\"fs-id1170571346180\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}{y}_{1}\\hfill & =L\\left({x}_{1}\\right)\\hfill \\\\ & =-3\\left(-0.9\\right)-1\\hfill \\\\ & =1.7.\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571506094\">Therefore the approximate [latex]y[\/latex] value for the solution when [latex]x=-0.9[\/latex] is [latex]y=1.7[\/latex]. We can then repeat the process, using [latex]{x}_{1}=-0.9[\/latex] and [latex]{y}_{1}=1.7[\/latex] to calculate [latex]{x}_{2}[\/latex] and [latex]{y}_{2}[\/latex]. The new slope is given by [latex]y^{\\prime} ={\\left(-0.9\\right)}^{2}-{\\left(1.7\\right)}^{2}=-2.08[\/latex]. First, [latex]{x}_{2}={x}_{1}+h=-0.9+0.1=-0.8[\/latex]. Using linear approximation gives<\/p>\n<div id=\"fs-id1170571142558\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}L\\left(x\\right)\\hfill & ={y}_{1}+{f}^{\\prime }\\left({x}_{1}\\right)\\left(x-{x}_{1}\\right)\\hfill \\\\ & =1.7 - 2.08\\left(x-\\left(-0.9\\right)\\right)\\hfill \\\\ & =1.7 - 2.08x - 1.872\\hfill \\\\ & =-2.08x - 0.172.\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571376302\">Finally, we substitute [latex]{x}_{2}=-0.8[\/latex] into the linear approximation to calculate [latex]{y}_{2}[\/latex].<\/p>\n<div id=\"fs-id1170573438533\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]\\begin{array}{cc}{y}_{2}\\hfill & =L\\left({x}_{2}\\right)\\hfill \\\\ & =-2.08{x}_{2}-0.172\\hfill \\\\ & =-2.08\\left(-0.8\\right)-0.172\\hfill \\\\ & =1.492.\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571304002\">Therefore the approximate value of the solution to the differential equation is [latex]y=1.492[\/latex] when [latex]x=-0.8[\/latex].<\/p>\n<p id=\"fs-id1170573726108\">What we have just shown is the idea behind <span data-type=\"term\">Euler\u2019s Method<\/span>. Repeating these steps gives a list of values for the solution. These values are shown in the table below, rounded off to four decimal places.<\/p>\n<table id=\"fs-id1170573401360\" summary=\"A table with three columns and twelve rows. The first has the label\">\n<caption><span data-type=\"title\">Using Euler\u2019s Method to Approximate Solutions to a Differential Equation<\/span><\/caption>\n<tbody>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]n[\/latex]<\/td>\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\n<td data-align=\"left\">[latex]3[\/latex]<\/td>\n<td data-align=\"left\">[latex]4[\/latex]<\/td>\n<td data-align=\"left\">[latex]5[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]{x}_{n}[\/latex]<\/td>\n<td data-align=\"left\">[latex]-1[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.9[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.8[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.7[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.6[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.5[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]{y}_{n}[\/latex]<\/td>\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.7[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.492[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.3334[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.2046[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.0955[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]n[\/latex]<\/td>\n<td data-align=\"left\">[latex]6[\/latex]<\/td>\n<td data-align=\"left\">[latex]7[\/latex]<\/td>\n<td data-align=\"left\">[latex]8[\/latex]<\/td>\n<td data-align=\"left\">[latex]9[\/latex]<\/td>\n<td data-align=\"left\">[latex]10[\/latex]<\/td>\n<td><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]{x}_{n}[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.4[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.3[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.2[\/latex]<\/td>\n<td data-align=\"left\">[latex]-0.1[\/latex]<\/td>\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\n<td><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]{y}_{n}[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.0004[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.9164[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.8414[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.7746[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.7156[\/latex]<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div id=\"fs-id1170571415778\" class=\"theorem\" data-type=\"note\">\n<div data-type=\"title\">\n<div class=\"textbox shaded\">\n<h3 style=\"text-align: center;\" data-type=\"title\">Euler\u2019s Method<\/h3>\n<hr \/>\n<p id=\"fs-id1170570989809\">Consider the initial-value problem<\/p>\n<p id=\"fs-id1170570989812\" style=\"text-align: center;\">[latex]y^{\\prime} =f\\left(x,y\\right),y\\left({x}_{0}\\right)={y}_{0}[\/latex].<\/p>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571332659\">To approximate a solution to this problem using Euler\u2019s method, define<\/p>\n<div id=\"fs-id1170573525577\" style=\"text-align: center;\" data-type=\"equation\">[latex]\\begin{array}{c}{x}_{n}={x}_{0}+nh\\hfill \\\\ {y}_{n}={y}_{n - 1}+hf\\left({x}_{n - 1},{y}_{n - 1}\\right).\\hfill \\end{array}[\/latex]<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571278799\">Here [latex]h>0[\/latex] represents the step size and [latex]n[\/latex] is an integer, starting with [latex]1[\/latex]. The number of steps taken is counted by the variable [latex]n[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p id=\"fs-id1170571512284\">Typically [latex]h[\/latex] is a small value, say [latex]0.1[\/latex] or [latex]0.05[\/latex]. The smaller the value of [latex]h[\/latex], the more calculations are needed. The higher the value of [latex]h[\/latex], the fewer calculations are needed. However, the tradeoff results in a lower degree of accuracy for larger step size, as illustrated in Figure 11.<\/p>\n<figure id=\"CNX_Calc_Figure_08_02_011\"><figcaption><\/figcaption><div style=\"width: 868px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/s3-us-west-2.amazonaws.com\/courses-images\/wp-content\/uploads\/sites\/4175\/2019\/04\/11234004\/CNX_Calc_Figure_08_02_011.jpg\" alt=\"Two graphs of the same parabola, y = x ^ 2 \u2013 3 x + 3. The first shows Euler\u2019s method for the given initial-value problem with a step size of h = 0.05, and the second shows Euler\u2019s method with a step size of h = 0.25. The first then has the points (0, 3), (.5, 1.5), (1, 0.5), (1.5, 0), (2, 0), (2.5, 0.5), and (3, 1.5) plotted with line segments connecting them. The second has the points (0, 3), (0.25, 2.25), (0.5, 1.625), (0.75, 1.125), (1, 0.75), (1.25, 0.5), (1.5, 0.375), (2, 0.5), (2.25, 0.75), (2.5, 1.125), (2.75, 1.625), and (3, 2.25) plotted with line segments connecting them.\" width=\"858\" height=\"461\" data-media-type=\"image\/jpeg\" \/><\/p>\n<p class=\"wp-caption-text\">Figure 11. Euler\u2019s method for the initial-value problem [latex]{y}^{\\prime }=2x - 3,y\\left(0\\right)=3[\/latex] with (a) a step size of [latex]h=0.5[\/latex]; and (b) a step size of [latex]h=0.25[\/latex].<\/p>\n<\/div>\n<\/figure>\n<div id=\"fs-id1170573756803\" data-type=\"example\">\n<div id=\"fs-id1170573756805\" data-type=\"exercise\">\n<div id=\"fs-id1170573756807\" data-type=\"problem\">\n<div data-type=\"title\">\n<div class=\"textbox exercises\">\n<h3>Example:\u00a0Using Euler\u2019s Method<\/h3>\n<div id=\"fs-id1170573756807\" data-type=\"problem\">\n<p id=\"fs-id1170571103641\">Consider the initial-value problem<\/p>\n<div id=\"fs-id1170571103644\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }=3{x}^{2}-{y}^{2}+1,y\\left(0\\right)=2[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571103620\">Use Euler\u2019s method with a step size of [latex]0.1[\/latex] to generate a table of values for the solution for values of [latex]x[\/latex] between [latex]0[\/latex] and [latex]1[\/latex].<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558894\">Show Solution<\/span><\/p>\n<div id=\"q44558894\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1170570999104\" data-type=\"solution\">\n<p id=\"fs-id1170570999107\">We are given [latex]h=0.1[\/latex] and [latex]f\\left(x,y\\right)=3{x}^{2}-{y}^{2}+1[\/latex]. Furthermore, the initial condition [latex]y\\left(0\\right)=2[\/latex] gives [latex]{x}_{0}=0[\/latex] and [latex]{y}_{0}=2[\/latex]. Using Euler&#8217;s method with [latex]n=0[\/latex], we can generate the following table.<\/p>\n<table id=\"fs-id1170571140163\" summary=\"A table with three columns and twelve rows. The first column has the header\">\n<caption><span data-type=\"title\">Using Euler\u2019s Method to Approximate Solutions to a Differential Equation<\/span><\/caption>\n<tbody>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]n[\/latex]<\/td>\n<td data-align=\"left\">[latex]{x}_{n}[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{n}={y}_{n - 1}+hf\\left({x}_{n - 1},{y}_{n - 1}\\right)[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.1[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{1}={y}_{0}+hf\\left({x}_{0},{y}_{0}\\right)=1.7[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.2[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{2}={y}_{1}+hf\\left({x}_{1},{y}_{1}\\right)=1.514[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]3[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.3[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{3}={y}_{2}+hf\\left({x}_{2},{y}_{2}\\right)=1.3968[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]4[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.4[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{4}={y}_{3}+hf\\left({x}_{3},{y}_{3}\\right)=1.3287[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]5[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.5[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{5}={y}_{4}+hf\\left({x}_{4},{y}_{4}\\right)=1.3001[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]6[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.6[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{6}={y}_{5}+hf\\left({x}_{5},{y}_{5}\\right)=1.3061[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]7[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.7[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{7}={y}_{6}+hf\\left({x}_{6},{y}_{6}\\right)=1.3435[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]8[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.8[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{8}={y}_{7}+hf\\left({x}_{7},{y}_{7}\\right)=1.4100[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]9[\/latex]<\/td>\n<td data-align=\"left\">[latex]0.9[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{9}={y}_{8}+hf\\left({x}_{8},{y}_{8}\\right)=1.5032[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]10[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.0[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{10}={y}_{9}+hf\\left({x}_{9},{y}_{9}\\right)=1.6202[\/latex]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"fs-id1170571086078\">With ten calculations, we are able to approximate the values of the solution to the initial-value problem for values of [latex]x[\/latex] between [latex]0[\/latex] and [latex]1[\/latex].<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Watch the following videos to see the worked solution to Example:\u00a0Using Euler\u2019s Method<\/p>\n<div style=\"text-align: center;\"><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/D9YQRFYG_XU?controls=0&amp;start=59&amp;end=425&amp;autoplay=0\" width=\"750\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p class=\"p1\">For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.<\/p>\n<p>You can view the <a href=\"https:\/\/oerfiles.s3.us-west-2.amazonaws.com\/Calculus+II\/Transcripts\/4.2.3_59to425_transcript.html\" target=\"_blank\" rel=\"noopener\">transcript for this segmented clip of &#8220;4.2.3&#8221; here (opens in new window)<\/a>.<\/p>\n<div id=\"fs-id1170572366188\" class=\"textbox tryit\">\n<h3>Interactive<\/h3>\n<p id=\"fs-id1170572366192\">Visit <a href=\"https:\/\/www.geogebra.org\/m\/KNxfhNmq\" target=\"_blank\" rel=\"noopener\">this applet for more practice using Euler\u2019s method<\/a>.<\/p>\n<\/div>\n<div id=\"fs-id1170571260260\" class=\"checkpoint\" data-type=\"note\">\n<div id=\"fs-id1170571260263\" data-type=\"exercise\">\n<div id=\"fs-id1170571260265\" data-type=\"problem\">\n<div class=\"textbox key-takeaways\">\n<h3>Key Takeaways<\/h3>\n<div id=\"fs-id1170571260265\" data-type=\"problem\">\n<p id=\"fs-id1170571260267\">Consider the initial-value problem<\/p>\n<div id=\"fs-id1170571169480\" class=\"unnumbered\" style=\"text-align: center;\" data-type=\"equation\" data-label=\"\">[latex]{y}^{\\prime }={x}^{3}+{y}^{2},y\\left(1\\right)=-2[\/latex].<\/div>\n<p>&nbsp;<\/p>\n<p id=\"fs-id1170571298232\">Using a step size of [latex]0.1[\/latex], generate a table with approximate values for the solution to the initial-value problem for values of [latex]x[\/latex] between [latex]1[\/latex] and [latex]2[\/latex].<\/p>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558892\">Hint<\/span><\/p>\n<div id=\"q44558892\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1170571209312\" data-type=\"commentary\" data-element-type=\"hint\">\n<p id=\"fs-id1170571209318\">Start by identifying the value of [latex]h[\/latex], then figure out what [latex]f\\left(x,y\\right)[\/latex] is. Then use the formula for Euler\u2019s Method to calculate [latex]{y}_{1},{y}_{2}[\/latex], and so on.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"qa-wrapper\" style=\"display: block\"><span class=\"show-answer collapsed\" style=\"cursor: pointer\" data-target=\"q44558893\">Show Solution<\/span><\/p>\n<div id=\"q44558893\" class=\"hidden-answer\" style=\"display: none\">\n<div id=\"fs-id1170573720268\" data-type=\"solution\">\n<table id=\"fs-id1170573720273\" class=\"unnumbered\" summary=\"A table with three columns and eleven rows. The first column has the header n and the values 0 through 10. The second column has the header x_n and the values 1 through 2, increasing by 0.1. The third column has the header y_n = y_(n - 1) + hf(x_(n - 1), y_(n - 1)) and the values -2, -1.5, -1.1419, -0.8387, -0.5487, -0.2442, 0.0993, 0.5099, 1.0272, 1.7159, and 2.6962.\" data-label=\"\">\n<thead>\n<tr valign=\"top\">\n<th data-align=\"left\">[latex]n[\/latex]<\/th>\n<th data-align=\"left\">[latex]{x}_{n}[\/latex]<\/th>\n<th data-align=\"left\">[latex]{y}_{n}={y}_{n - 1}+hf\\left({x}_{n - 1},{y}_{n - 1}\\right)[\/latex]<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]0[\/latex]<\/td>\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\n<td data-align=\"left\">[latex]-2[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]1[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.1[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{1}={y}_{0}+hf\\left({x}_{0},{y}_{0}\\right)=-1.5[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.2[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{2}={y}_{1}+hf\\left({x}_{1},{y}_{1}\\right)=-1.1419[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]3[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.3[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{3}={y}_{2}+hf\\left({x}_{2},{y}_{2}\\right)=-0.8387[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]4[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.4[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{4}={y}_{3}+hf\\left({x}_{3},{y}_{3}\\right)=-0.5487[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]5[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.5[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{5}={y}_{4}+hf\\left({x}_{4},{y}_{4}\\right)=-0.2442[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]6[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.6[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{6}={y}_{5}+hf\\left({x}_{5},{y}_{5}\\right)=0.0993[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]7[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.7[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{7}={y}_{6}+hf\\left({x}_{6},{y}_{6}\\right)=0.5099[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]8[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.8[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{8}={y}_{7}+hf\\left({x}_{7},{y}_{7}\\right)=1.0272[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]9[\/latex]<\/td>\n<td data-align=\"left\">[latex]1.9[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{9}={y}_{8}+hf\\left({x}_{8},{y}_{8}\\right)=1.7159[\/latex]<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td data-align=\"left\">[latex]10[\/latex]<\/td>\n<td data-align=\"left\">[latex]2[\/latex]<\/td>\n<td data-align=\"left\">[latex]{y}_{10}={y}_{9}+hf\\left({x}_{9},{y}_{9}\\right)=2.6962[\/latex]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"textbox tryit\">\n<div id=\"fs-id1170571260260\" class=\"checkpoint\" data-type=\"note\">\n<div id=\"fs-id1170571260263\" data-type=\"exercise\">\n<div id=\"fs-id1170571260265\" data-type=\"problem\">\n<h3>Interactive<\/h3>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"fs-id1170571243506\" class=\"media-2\" data-type=\"note\">\n<p id=\"fs-id1170571243509\">Visit <a href=\"https:\/\/www.maa.org\/press\/periodicals\/loci\/joma\/the-sir-model-for-spread-of-disease\" target=\"_blank\" rel=\"noopener\">this website for a practical application of differential equations<\/a>.<\/p>\n<\/div>\n<\/div>\n<div class=\"textbox key-takeaways\">\n<h3>Try It<\/h3>\n<p><iframe loading=\"lazy\" id=\"ohm5741\" class=\"resizable\" src=\"https:\/\/ohm.lumenlearning.com\/multiembedq.php?id=5741&theme=oea&iframe_resize_id=ohm5741&show_question_numbers\" width=\"100%\" height=\"150\"><\/iframe><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<section id=\"fs-id1170571042944\" class=\"key-concepts\" data-depth=\"1\"><\/section>\n<div data-type=\"glossary\"><\/div>\n\n\t\t\t <section class=\"citations-section\" role=\"contentinfo\">\n\t\t\t <h3>Candela Citations<\/h3>\n\t\t\t\t\t <div>\n\t\t\t\t\t\t <div id=\"citation-list-1625\">\n\t\t\t\t\t\t\t <div class=\"licensing\"><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Original<\/div><ul class=\"citation-list\"><li>4.2.3. <strong>Authored by<\/strong>: Ryan Melton. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by\/4.0\/\">CC BY: Attribution<\/a><\/em><\/li><\/ul><div class=\"license-attribution-dropdown-subheading\">CC licensed content, Shared previously<\/div><ul class=\"citation-list\"><li>Calculus Volume 2. <strong>Authored by<\/strong>: Gilbert Strang, Edwin (Jed) Herman. <strong>Provided by<\/strong>: OpenStax. <strong>Located at<\/strong>: <a target=\"_blank\" href=\"https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction\">https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction<\/a>. <strong>License<\/strong>: <em><a target=\"_blank\" rel=\"license\" href=\"https:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/\">CC BY-NC-SA: Attribution-NonCommercial-ShareAlike<\/a><\/em>. <strong>License Terms<\/strong>: Access for free at https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction<\/li><\/ul><\/div>\n\t\t\t\t\t\t <\/div>\n\t\t\t\t\t <\/div>\n\t\t\t <\/section>","protected":false},"author":17533,"menu_order":8,"template":"","meta":{"_candela_citation":"[{\"type\":\"cc\",\"description\":\"Calculus Volume 2\",\"author\":\"Gilbert Strang, Edwin (Jed) Herman\",\"organization\":\"OpenStax\",\"url\":\"https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction\",\"project\":\"\",\"license\":\"cc-by-nc-sa\",\"license_terms\":\"Access for free at https:\/\/openstax.org\/books\/calculus-volume-2\/pages\/1-introduction\"},{\"type\":\"original\",\"description\":\"4.2.3\",\"author\":\"Ryan Melton\",\"organization\":\"\",\"url\":\"\",\"project\":\"\",\"license\":\"cc-by\",\"license_terms\":\"\"}]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-1625","chapter","type-chapter","status-publish","hentry"],"part":159,"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/users\/17533"}],"version-history":[{"count":6,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1625\/revisions"}],"predecessor-version":[{"id":2204,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1625\/revisions\/2204"}],"part":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/parts\/159"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/1625\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/media?parent=1625"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapter-type?post=1625"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/contributor?post=1625"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/license?post=1625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}