{"id":812,"date":"2025-06-20T17:15:13","date_gmt":"2025-06-20T17:15:13","guid":{"rendered":"https:\/\/content.one.lumenlearning.com\/calculus2\/?post_type=chapter&#038;p=812"},"modified":"2025-09-10T15:00:19","modified_gmt":"2025-09-10T15:00:19","slug":"direction-fields-and-eulers-method-learn-it-4","status":"publish","type":"chapter","link":"https:\/\/content.one.lumenlearning.com\/calculus2\/chapter\/direction-fields-and-eulers-method-learn-it-4\/","title":{"raw":"Direction Fields and Euler's Method: Learn It 4","rendered":"Direction Fields and Euler&#8217;s Method: Learn It 4"},"content":{"raw":"<h2>Euler\u2019s Method<\/h2>\r\n<p class=\"whitespace-normal break-words\">Sometimes you need to find approximate solutions to differential equations that are difficult or impossible to solve analytically. <strong>Euler's Method<\/strong> provides a systematic approach for finding these numerical approximations using the concept of linear approximation.<\/p>\r\n<p class=\"whitespace-normal break-words\">Let's start with a simple example to see how this works.<\/p>\r\n\r\n<section class=\"textbox example\" aria-label=\"Example\">\r\n<p class=\"whitespace-pre-wrap break-words\">Consider the initial-value problem:<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]y^{\\prime} = 2x - 3, \\quad y(0) = 3[\/latex]<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\">We can solve this exactly by integrating: [latex]y = x^2 - 3x + C[\/latex].<\/p>\r\n<p class=\"whitespace-pre-wrap break-words\">Using the initial condition gives us [latex]y = x^2 - 3x + 3[\/latex].<\/p>\r\n\r\n<\/section>The solution for this initial-value problem appears as the parabola in the figure below.\r\n\r\n[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]The red graph consists of line segments that approximate the solution to the initial-value problem. Notice how the process works:\r\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\r\n \t<li class=\"whitespace-normal break-words\">Start at the initial value [latex](0, 3)[\/latex]<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Use the differential equation to find the slope at each point<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Move forward by a fixed step size (here [latex]0.5[\/latex])<\/li>\r\n \t<li class=\"whitespace-normal break-words\">Draw a line segment with that slope<\/li>\r\n<\/ul>\r\nThis approach is the basis of Euler\u2019s Method.\r\n\r\nBefore we state Euler\u2019s Method as a theorem, let\u2019s consider another initial-value problem.\r\n\r\n<section class=\"textbox example\" aria-label=\"Example\">\r\n<p class=\"whitespace-normal break-words\">Let's work through a more complex example that we can't solve analytically:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]y^{\\prime} = x^2 - y^2, \\quad y(-1) = 2[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">At the point [latex](-1, 2)[\/latex], the slope of the solution is [latex]y^{\\prime} = (-1)^2 - (2)^2 = -3[\/latex]. We define [latex]x_0 = -1[\/latex] and [latex]y_0 = 2[\/latex]. Since the slope at this point equals [latex]-3[\/latex], we can use linear approximation to approximate [latex]y[\/latex] near [latex](-1, 2)[\/latex]:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]L(x) = y_0 + f'(x_0)(x - x_0)[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Here [latex]x_0 = -1[\/latex], [latex]y_0 = 2[\/latex], and [latex]f'(x_0) = -3[\/latex], so the linear approximation becomes:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]L(x) = 2 + (-3)(x - (-1)) = 2 - 3x - 3 = -3x - 1[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Now we choose a step size [latex]h = 0.1[\/latex]. Incrementing [latex]x_0[\/latex] by [latex]h[\/latex] gives our next [latex]x[\/latex] value:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]x_1 = x_0 + h = -1 + 0.1 = -0.9[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">We substitute [latex]x_1 = -0.9[\/latex] into the linear approximation to calculate [latex]y_1[\/latex]:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]y_1 = L(x_1) = -3(-0.9) - 1 = 1.7[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Therefore the approximate [latex]y[\/latex] value for the solution when [latex]x = -0.9[\/latex] is [latex]y = 1.7[\/latex].<\/p>\r\n<p class=\"whitespace-normal break-words\">We 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].<\/p>\r\n<p class=\"whitespace-normal break-words\">The new slope is [latex]y^{\\prime} = (-0.9)^2 - (1.7)^2 = -2.08[\/latex].<\/p>\r\n<p class=\"whitespace-normal break-words\">First, [latex]x_2 = x_1 + h = -0.9 + 0.1 = -0.8[\/latex]. Using linear approximation:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]L(x) = y_1 + f'(x_1)(x - x_1) = 1.7 + (-2.08)(x - (-0.9)) = 1.7 - 2.08x - 1.872 = -2.08x - 0.172[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Finally, we substitute [latex]x_2 = -0.8[\/latex] into the linear approximation:<\/p>\r\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]y_2 = L(x_2) = -2.08(-0.8) - 0.172 = 1.492[\/latex]<\/p>\r\n<p class=\"whitespace-normal break-words\">Therefore the approximate value of the solution is [latex]y = 1.492[\/latex] when [latex]x = -0.8[\/latex].<\/p>\r\n<p class=\"whitespace-normal break-words\">This is the idea behind Euler's Method. Repeating these steps gives us the following approximations:<\/p>\r\n\r\n<table class=\"bg-bg-100 min-w-full border-separate border-spacing-0 text-sm leading-[1.88888] whitespace-normal\">\r\n<thead class=\"border-b-border-100\/50 border-b-[0.5px] text-left\">\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<th class=\"text-text-000 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] font-400 px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]n[\/latex]<\/th>\r\n<th class=\"text-text-000 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] font-400 px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]x_n[\/latex]<\/th>\r\n<th class=\"text-text-000 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] font-400 px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]y_n[\/latex]<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-1[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]2[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.9[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.7[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]2[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.8[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.492[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]3[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.7[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.3334[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]4[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.6[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.2046[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]5[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.5[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.0955[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]6[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.4[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.0004[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]7[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.3[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.9164[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]8[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.2[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.8414[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]9[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.1[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.7746[\/latex]<\/td>\r\n<\/tr>\r\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]10[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0[\/latex]<\/td>\r\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.7156[\/latex]<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/section><section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\r\n<h3>Euler\u2019s method<\/h3>\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<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<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<\/section><section class=\"textbox proTip\" aria-label=\"Pro Tip\"><strong>Choosing Step Size<\/strong>[latex]\\\\[\/latex]Typically use [latex]h = 0.1[\/latex] or [latex]h = 0.05[\/latex]. Smaller step sizes give more accurate results but require more computation. The tradeoff between accuracy and efficiency is illustrated below.[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]<\/section><section class=\"textbox example\" aria-label=\"Example\">\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<\/section><section class=\"textbox tryIt\" aria-label=\"Try It\">[ohm_question hide_question_numbers=1]311303[\/ohm_question]<\/section>","rendered":"<h2>Euler\u2019s Method<\/h2>\n<p class=\"whitespace-normal break-words\">Sometimes you need to find approximate solutions to differential equations that are difficult or impossible to solve analytically. <strong>Euler&#8217;s Method<\/strong> provides a systematic approach for finding these numerical approximations using the concept of linear approximation.<\/p>\n<p class=\"whitespace-normal break-words\">Let&#8217;s start with a simple example to see how this works.<\/p>\n<section class=\"textbox example\" aria-label=\"Example\">\n<p class=\"whitespace-pre-wrap break-words\">Consider the initial-value problem:<\/p>\n<p class=\"whitespace-pre-wrap break-words\" style=\"text-align: center;\">[latex]y^{\\prime} = 2x - 3, \\quad y(0) = 3[\/latex]<\/p>\n<p class=\"whitespace-pre-wrap break-words\">We can solve this exactly by integrating: [latex]y = x^2 - 3x + C[\/latex].<\/p>\n<p class=\"whitespace-pre-wrap break-words\">Using the initial condition gives us [latex]y = x^2 - 3x + 3[\/latex].<\/p>\n<\/section>\n<p>The solution for this initial-value problem appears as the parabola in the figure below.<\/p>\n<figure style=\"width: 417px\" 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\" \/><figcaption 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].<\/figcaption><\/figure>\n<p>The red graph consists of line segments that approximate the solution to the initial-value problem. Notice how the process works:<\/p>\n<ul class=\"[&amp;:not(:last-child)_ul]:pb-1 [&amp;:not(:last-child)_ol]:pb-1 list-disc space-y-1.5 pl-7\">\n<li class=\"whitespace-normal break-words\">Start at the initial value [latex](0, 3)[\/latex]<\/li>\n<li class=\"whitespace-normal break-words\">Use the differential equation to find the slope at each point<\/li>\n<li class=\"whitespace-normal break-words\">Move forward by a fixed step size (here [latex]0.5[\/latex])<\/li>\n<li class=\"whitespace-normal break-words\">Draw a line segment with that slope<\/li>\n<\/ul>\n<p>This approach is the basis of Euler\u2019s Method.<\/p>\n<p>Before we state Euler\u2019s Method as a theorem, let\u2019s consider another initial-value problem.<\/p>\n<section class=\"textbox example\" aria-label=\"Example\">\n<p class=\"whitespace-normal break-words\">Let&#8217;s work through a more complex example that we can&#8217;t solve analytically:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]y^{\\prime} = x^2 - y^2, \\quad y(-1) = 2[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">At the point [latex](-1, 2)[\/latex], the slope of the solution is [latex]y^{\\prime} = (-1)^2 - (2)^2 = -3[\/latex]. We define [latex]x_0 = -1[\/latex] and [latex]y_0 = 2[\/latex]. Since the slope at this point equals [latex]-3[\/latex], we can use linear approximation to approximate [latex]y[\/latex] near [latex](-1, 2)[\/latex]:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]L(x) = y_0 + f'(x_0)(x - x_0)[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Here [latex]x_0 = -1[\/latex], [latex]y_0 = 2[\/latex], and [latex]f'(x_0) = -3[\/latex], so the linear approximation becomes:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]L(x) = 2 + (-3)(x - (-1)) = 2 - 3x - 3 = -3x - 1[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Now we choose a step size [latex]h = 0.1[\/latex]. Incrementing [latex]x_0[\/latex] by [latex]h[\/latex] gives our next [latex]x[\/latex] value:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]x_1 = x_0 + h = -1 + 0.1 = -0.9[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">We substitute [latex]x_1 = -0.9[\/latex] into the linear approximation to calculate [latex]y_1[\/latex]:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]y_1 = L(x_1) = -3(-0.9) - 1 = 1.7[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Therefore the approximate [latex]y[\/latex] value for the solution when [latex]x = -0.9[\/latex] is [latex]y = 1.7[\/latex].<\/p>\n<p class=\"whitespace-normal break-words\">We 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].<\/p>\n<p class=\"whitespace-normal break-words\">The new slope is [latex]y^{\\prime} = (-0.9)^2 - (1.7)^2 = -2.08[\/latex].<\/p>\n<p class=\"whitespace-normal break-words\">First, [latex]x_2 = x_1 + h = -0.9 + 0.1 = -0.8[\/latex]. Using linear approximation:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]L(x) = y_1 + f'(x_1)(x - x_1) = 1.7 + (-2.08)(x - (-0.9)) = 1.7 - 2.08x - 1.872 = -2.08x - 0.172[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Finally, we substitute [latex]x_2 = -0.8[\/latex] into the linear approximation:<\/p>\n<p class=\"whitespace-normal break-words\" style=\"text-align: center;\">[latex]y_2 = L(x_2) = -2.08(-0.8) - 0.172 = 1.492[\/latex]<\/p>\n<p class=\"whitespace-normal break-words\">Therefore the approximate value of the solution is [latex]y = 1.492[\/latex] when [latex]x = -0.8[\/latex].<\/p>\n<p class=\"whitespace-normal break-words\">This is the idea behind Euler&#8217;s Method. Repeating these steps gives us the following approximations:<\/p>\n<table class=\"bg-bg-100 min-w-full border-separate border-spacing-0 text-sm leading-[1.88888] whitespace-normal\">\n<thead class=\"border-b-border-100\/50 border-b-[0.5px] text-left\">\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<th class=\"text-text-000 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] font-400 px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]n[\/latex]<\/th>\n<th class=\"text-text-000 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] font-400 px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]x_n[\/latex]<\/th>\n<th class=\"text-text-000 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] font-400 px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]y_n[\/latex]<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-1[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]2[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.9[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.7[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]2[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.8[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.492[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]3[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.7[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.3334[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]4[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.6[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.2046[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]5[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.5[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.0955[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]6[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.4[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]1.0004[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]7[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.3[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.9164[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]8[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.2[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.8414[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]9[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]-0.1[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.7746[\/latex]<\/td>\n<\/tr>\n<tr class=\"[tbody&gt;&amp;]:odd:bg-bg-500\/10\">\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]10[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0[\/latex]<\/td>\n<td class=\"border-t-border-100\/50 [&amp;:not(:first-child)]:-x-[hsla(var(--border-100) \/ 0.5)] border-t-[0.5px] px-2 [&amp;:not(:first-child)]:border-l-[0.5px]\">[latex]0.7156[\/latex]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<section class=\"textbox keyTakeaway\" aria-label=\"Key Takeaway\">\n<h3>Euler\u2019s method<\/h3>\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 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 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<\/section>\n<section class=\"textbox proTip\" aria-label=\"Pro Tip\"><strong>Choosing Step Size<\/strong>[latex]\\\\[\/latex]Typically use [latex]h = 0.1[\/latex] or [latex]h = 0.05[\/latex]. Smaller step sizes give more accurate results but require more computation. The tradeoff between accuracy and efficiency is illustrated below.<\/p>\n<figure style=\"width: 858px\" 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\" \/><figcaption 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].<\/figcaption><\/figure>\n<\/section>\n<section class=\"textbox example\" aria-label=\"Example\">\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\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q44558892\">Hint<\/button><\/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\"><button class=\"show-answer show-answer-button collapsed\" data-target=\"q44558893\">Show Solution<\/button><\/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<\/section>\n<section class=\"textbox tryIt\" aria-label=\"Try It\"><iframe loading=\"lazy\" id=\"ohm311303\" class=\"resizable\" src=\"https:\/\/ohm.lumenlearning.com\/multiembedq.php?id=311303&theme=lumen&iframe_resize_id=ohm311303&source=tnh\" width=\"100%\" height=\"150\"><\/iframe><\/section>\n","protected":false},"author":15,"menu_order":15,"template":"","meta":{"_candela_citation":"[]","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"part":669,"module-header":"- Select Header -","content_attributions":[],"internal_book_links":[],"video_content":null,"cc_video_embed_content":{"cc_scripts":"","media_targets":[]},"try_it_collection":null,"_links":{"self":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/812"}],"collection":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/users\/15"}],"version-history":[{"count":5,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/812\/revisions"}],"predecessor-version":[{"id":2292,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/812\/revisions\/2292"}],"part":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/parts\/669"}],"metadata":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapters\/812\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/media?parent=812"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/pressbooks\/v2\/chapter-type?post=812"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/contributor?post=812"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/content.one.lumenlearning.com\/calculus2\/wp-json\/wp\/v2\/license?post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}