To solve the differential equation
\begin{equation*}
y' + 4ty = 0
\end{equation*}
using the method of separation of variables, we separate the variables as follows:
\begin{equation*}
\frac{dy}{y} = -4t \, dt
\end{equation*}
Integrating both sides gives:
\begin{equation*}
\ln |y| = -2t^2 + C
\end{equation*}
Exponentiating both sides results in:
\begin{equation*}
y = Ce^{-2t^2}
\end{equation*}
Since the initial condition, \(y(0) = 1\text{,}\) gives \(C = 1\text{,}\) the analytical solution is:
\begin{equation*}
y(t) = e^{-2t^2}
\end{equation*}
Next, we apply Eulerโs method to approximate the solution at \(t = 0.5\text{.}\) The general formula for Eulerโs method is:
\begin{equation*}
y_{k+1} = y_k + h f(t_k, y_k)
\end{equation*}
where \(f(t, y) = -4ty\) and \(h=0.1\text{.}\) So, we can update the formula as:
\begin{equation*}
y_{k+1} = y_k - 0.4 t_k y_k \quad \text{where}\ y_0 = 1.
\end{equation*}
For
\(k = 0, 1, \ldots, 4\text{,}\) we contruct the following table:
\(k\) |
\(t_k\) |
\(y_k\) |
\(y_{k+1}\) |
\(0\) |
\(0.0\) |
\(y_0 = {\DLBa 1}\) |
\(y_1 = {\DLBa 1} + 0.1(-4 \cdot 0.0 \cdot {\DLBa 1}) = {\DLGa 1}\) |
\(1\) |
\(0.1\) |
\(y_1 = {\DLBa 1}\) |
\(y_2 = {\DLBa 1} + 0.1(-4 \cdot 0.1 \cdot {\DLBa 1}) = {\DLGa 0.96}\) |
\(2\) |
\(0.2\) |
\(y_2 = {\DLBa 0.96}\) |
\(y_3 = {\DLBa 0.96} + 0.1(-4 \cdot 0.2 \cdot {\DLBa 0.96}) = {\DLGa 0.8832}\) |
\(3\) |
\(0.3\) |
\(y_3 = {\DLBa 0.8832}\) |
\(y_4 = {\DLBa 0.8832} + 0.1(-4 \cdot 0.3 \cdot {\DLBa 0.8832}) \approx {\DLGa 0.7772}\) |
\(4\) |
\(0.4\) |
\(y_4 = {\DLBa 0.7772}\) |
\(y_5 = {\DLBa 0.7772} + 0.1(-4 \cdot 0.4 \cdot {\DLBa 0.7772}) \approx {\DLGa 0.6529}\) |
Since
\(t_5=0.5\text{,}\) the approximation we are looking for is
\(y_5 \approx 0.6529\text{.}\)
Comparing this with the analytical solution at \(t = 0.5\text{,}\) we see the true value is:
\begin{equation*}
y(0.5) = e^{-2(0.5)^2} = e^{-0.5} \approx 0.6065.
\end{equation*}
Although there is some error between the two values, it is more due to the step size we chose, rather than the method itself. A smaller step size would yield a more accurate approximation. For example, using \(h = 0.001\) gives the approximation: \(y(0.5) \approx 0.6069\text{.}\)