-
Recall that the derivative, along with a point, can be used to find the linear approximation (or tangent line) to a function. Even though we might not know what $x(t)$ is, we can still use the initial condition and the derivative to find the linear approximation. Remember that the formula for the linear approximation at $t=a$ is $L_a(t) = x(a)+x'(a) (t-a)$. Write down the linear approximation for $x(t)$ at $t=0$.
$L_0(t) =$
$+$
$($
$)$
Suppose we want to know what $x (4)$ is. We could estimate it by plugging $4$ into the linear approximation. What does that give us?
$L_0(4) =$
$+$
$($
$)=$
In general, what do we know about the error of the linear approximation (in other words, the difference between a function and its linear approximation)?
Hint
The formula for the
linear approximation of a function $x(t)$ at $t=0$ is $L_0(t) = x(0) + x'(0)(t-0)$. Now, you just need to figure out the values of $x(0)$ and $x'(0)$. If, for example, you determined that $x(0)=47$ and $x'(0)=21$, then your answer would be $L_0(t) = 47 + 21t$, which is a linear function in $t$ (and everything but $t$ is a number).
How are you going to determine what $x(0)$ is? That's easy, it's given to you directly as the initial condition. How are you going to determine what $x'(0)$ is? Plugging in $t=0$ into the differential equation gives you a formula for $x'(0)$. And, since you know what the function $f(t)$ is, you can plug in the formula for $f(t)$ to get a number for $x'(0)$.
Hide help
-
Is this close to the actual value? Probably not, because $4$ is not very close to $0$. Is there a way we can use the idea of linear approximation to get a closer estimate? Can we use the linear approximation at some point close to $4$? Why or why not?
Maybe we could use the linear approximation at $t=0$ to find an estimate for some $t$ between $0$ and $4$, and then use that estimate to form an approximation to the linear approximation at this intermediate $t$. Even if it isn't quite the actual linear approximation, we can still use it to estimate $x (4)$. Let's try this with $t=2$ and see what happens. Plug $t=2$ into the linear approximation you found in part a:
$L_0(2)=$
$+$
$($
$)=$
Now take this to be $x(2)$ and create a new linear approximation at $t=2$.
$L_2(t)=$
$+$
$($
$)$
Use $L_2(t)$ to estimate $x(4)$.
$L_2(4) =$
$+$
$($
$)=$
This estimate is quite different from the estimate in part a. Does that necessarily mean that it is a better estimate?
Hint
For the general formula for $L_a(t)$, we know that $L_2(t) = x(2) + x'(2)(t-2)$. We know what $x'(2)$ is from the differential equation. And, from $L_0(2)$, we have an estimate of $x(2)$, so we are good to go. We have numbers for everything to form the function $L_2(t)$.
Hide help
-
To determine which answer is better, we will cheat and calculate the answer from the solution to our particular differential equation, which is $x(t)=t^{2} - t - 5$. (In more difficult cases, we won't know the actual solution, which is why we'd use the Forward Euler algorithm.) Given the solution, the actual value is $x (4) = $
. Which of our estimates is closer?
Is either one a good estimate?
.
The problem with the second estimate is that $2$ is still not close to $0$, so the estimate for $x(2)$ is not close to the actual value. How can we fix this problem?
As we decrease the time intervals, the estimate for $x (4)$ will approach the actual value. If we wanted to, we could take the time intervals to be very small (perhaps getting estimates at $t=.001$, $t=.002$, $t=.003$, all the way up to $t=3.999$ and $t=4$), which would result in a very close estimate. What is the problem with this approach?
Typically we'll use a computer program so we don't have to do all these repetitive steps manually. Even so, we often have to struggle with a tradeoff between accuracy and computational time, especially with “difficult problems“ where the time step we want for accuracy might make the computer program take to long to run.
-
Sketch your solution for $\Delta t=2$ using the following applet. The applet breaks the process into multiple steps. For step=1, sketch the initial condition. For step=2, sketch the linear approximation $L_0(t)$; in the applet, all you need to do is get the slope $m=x'(0)$ correct. For step=3, show the result $L_0(2)$. Repeat this process with step=4 and step=5 to sketch $L_2(t)$ and estimate the final result of $L_2(4)$.
If you select the “exact” checkbox, the applet will show the exact solution $x(t)=t^{2} - t - 5$. If you have exact checked while constructing the graph, it will show you the tangent line of the exact solution when you are on the steps to construct the linear approximations $L_a(t)$. (The linear approximations will be parallel to the exact tangent lines, but shifted up or down due to errors from the previous steps.)
Feedback from applet
Initial condition:
Points for curve 1:
Points for curve 2:
Points for curve 3:
Slopes for curve 1:
Slopes for curve 2:
Slopes for curve 3:
(After completing the estimate for $\Delta t=2$, the applet should give you credit for the initial condition and the points and slopes for curve 1. We'll come back to the applet to complete curves 2 and 3.)
-
This approach to estimating solutions with successive linear approximations is known as the Forward Euler algorithm for solving differential equations. Let's derive a formula for this algorithm.
The first step is to choose a step size, which we'll call $\Delta t$. Then, if we start at $t_0=0$, we add $\Delta t$ to get that the first time step will be $t_1 =$
. We add another $\Delta t$ to compute that the second time step is $t_2=$
. In general the $n$-th time step will be $t_n = $
. We'll denote our estimate of $x(t)$ at time $t=t_n$ as $\hat{ x }(t_n)$.
If we have the estimate $\hat{ x }(t_n)$ at time $t=t_n$, then the linear approximate at $t=t_n$ is
$L_{t_n}(t) = \hat{ x }(t_n) + x'(t_n) (t - t_n).$
We calculate a new estimate at the next time step $t=t_{n+1}$ by plugging in $t=t_{n+1}$:
$$\hat{ x }(t_{n+1}) = L_{t_{n}} (t_{n+1}) =
\hat{ x }(t_n) + x'(t_n) (t_{n+1} - t_n).$$
Since $t_{n+1}-t_n = \Delta t$, the formula for the Forward Euler step simplifies to
$$\hat{ x }(t_{n+1}) = \hat{ x }(t_n) + x'(t_n) \Delta t.$$
To use the Forward Euler algorithm to estimate the solution, you just keep using the above equation for $n=0,1,2, \ldots$.
Let's look at how this connects to parts a and b. In part a, $\Delta t =$
and we had to take
step(s) to reach the desired value. In part b, $\Delta t = $
and we had to take
step(s) to reach the desired value.
Hint
Online, to enter $\Delta t$, type
Delta t.
Hide help
-
Use $\Delta t = 1$ to estimate $x(4)$ for the differential equation from the start of this problem. Our time steps are therefore
$t_1=$
,
$t_2=$
,
$t_3=$
, and
$t_4=$
$\hat{ x }(t_1) =\hat{ x }(_) = $
$+$
$\times$
$=$
$\hat{ x }(t_2) = \hat{ x }(_) = $
$+$
$\times$
$=$
$\hat{ x }(t_3) = \hat{ x }(_) = $
$+$
$\times$
$=$
$\hat{ x }(t_4) = \hat{ x }(_) = $
$+$
$\times$
$=$
Plot your solution using the above applet. Change $\Delta t$ to 1 using the lower slider. For step 1, the initial condition should already be set from the previous results. Skip to step 2 to calculate the slope and step 3 to calculate $\hat{ x }(t_1)$, and continue in this pattern up to step 9, where you'll calculate $\hat{ x }(t_4)$. The slopes you calculate in even numbered steps should match the second columns of numbers entered above. The points calculated in odd steps should match the values of the time steps and the estimates entered in the last column above.
Hint
For each line, enter the components of the equation $\hat{ x }(t_{n+1}) = \hat{ x }(t_n) + x'(t_n) \Delta t,$ starting with $n=0$. This means, in the first blank, you should enter the estimate, $\hat{ x }(t_n)$, from the previous step (or the initial condition if $n=0$). In the second blank, enter the slope calculated from the differential equation plugging in $t=t_n$. In third blank, just before the equals sign, enter the value of $\Delta t$, which is always the same. In the last blank, enter the value of your estimate, which you'll reenter in the first blank of the next line.
Hide help
-
Use $\Delta t = \frac{1}{2}$ to estimate $x(4)$ for the differential equation from the start of this problem. The time steps are $t_1=$
,
$t_2=$
, $t_3=$
,
etc. and we can stop when $t_n=4$, which is when $n=$
.
$\hat{ x }(t_1) = $
$+$
$\times$
$=$
$\hat{ x }(t_2) = $
$+$
$\times$
$=$
$\hat{ x }(t_3) = $
$+$
$\times$
$=$
$\hat{ x }(t_4) = $
$+$
$\times$
$=$
$\hat{ x }(t_5) = $
$+$
$\times$
$=$
$\hat{ x }(t_6) = $
$+$
$\times$
$=$
$\hat{ x }(t_7) = $
$+$
$\times$
$=$
$\hat{ x }(t_8) = $
$+$
$\times$
$=$
Plot your solution using the above applet. Change $\Delta t$ to $\frac{1}{2}$ using the lower slider, and continue as in the previous part. Again the slopes should match the second column of numbers and the points should match the times and calculations from the last column of numbers.