Subjects differential equations

Runge Kutta 4 B03E96

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Search Solutions

Runge Kutta 4 B03E96


1. **Stating the problem:** We are given a differential equation $$\frac{dy}{dx} = -5x^3 - 23x^2 + 10x - 20$$ with initial condition $$y(0) = 2$$. We need to compute $$y_1, y_2, y_3$$ using the Runge-Kutta 4th order method with step size $$h=1$$ (assuming step size 1 since not specified). 2. **Formula for Runge-Kutta 4th order method:** For each step from $$x_n$$ to $$x_{n+1} = x_n + h$$, $$ \begin{aligned} k_1 &= h f(x_n, y_n) \\ k_2 &= h f\left(x_n + \frac{h}{2}, y_n + \frac{k_1}{2}\right) \\ k_3 &= h f\left(x_n + \frac{h}{2}, y_n + \frac{k_2}{2}\right) \\ k_4 &= h f(x_n + h, y_n + k_3) \\ y_{n+1} &= y_n + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4) \end{aligned} $$ 3. **Step 1: Compute $$y_1$$ at $$x_1 = 1$$** - $$x_0 = 0, y_0 = 2$$ - Calculate $$k_1 = 1 \times f(0,2) = f(0,2) = -5(0)^3 - 23(0)^2 + 10(0) - 20 = -20$$ - Calculate $$k_2 = 1 \times f(0.5, 2 + (-20)/2) = f(0.5, -8)$$ $$= -5(0.5)^3 - 23(0.5)^2 + 10(0.5) - 20 = -5(0.125) - 23(0.25) + 5 - 20 = -0.625 - 5.75 + 5 - 20 = -21.375$$ - Calculate $$k_3 = 1 \times f(0.5, 2 + (-21.375)/2) = f(0.5, -8.6875)$$ Same $$x$$ as $$k_2$$, so $$f(0.5, y)$$ depends only on $$x$$, so $$k_3 = k_2 = -21.375$$ - Calculate $$k_4 = 1 \times f(1, 2 + (-21.375)) = f(1, -19.375)$$ $$= -5(1)^3 - 23(1)^2 + 10(1) - 20 = -5 - 23 + 10 - 20 = -38$$ - Compute $$y_1 = 2 + \frac{1}{6}(-20 + 2(-21.375) + 2(-21.375) + (-38))$$ $$= 2 + \frac{1}{6}(-20 - 42.75 - 42.75 - 38) = 2 + \frac{1}{6}(-143.5) = 2 - 23.9167 = -21.9167$$ 4. **Step 2: Compute $$y_2$$ at $$x_2 = 2$$** - $$x_1 = 1, y_1 = -21.9167$$ - $$k_1 = f(1, -21.9167) = -38$$ (same as before) - $$k_2 = f(1.5, -21.9167 + (-38)/2) = f(1.5, -40.9167)$$ $$= -5(1.5)^3 - 23(1.5)^2 + 10(1.5) - 20 = -5(3.375) - 23(2.25) + 15 - 20 = -16.875 - 51.75 + 15 - 20 = -73.625$$ - $$k_3 = f(1.5, -21.9167 + (-73.625)/2) = f(1.5, -58.7292) = -73.625$$ (same as $$k_2$$) - $$k_4 = f(2, -21.9167 + (-73.625)) = f(2, -95.5417)$$ $$= -5(8) - 23(4) + 20 - 20 = -40 - 92 + 20 - 20 = -132$$ - Compute $$y_2 = -21.9167 + \frac{1}{6}(-38 + 2(-73.625) + 2(-73.625) + (-132))$$ $$= -21.9167 + \frac{1}{6}(-38 - 147.25 - 147.25 - 132) = -21.9167 + \frac{1}{6}(-464.5) = -21.9167 - 77.4167 = -99.3334$$ 5. **Step 3: Compute $$y_3$$ at $$x_3 = 3$$** - $$x_2 = 2, y_2 = -99.3334$$ - $$k_1 = f(2, -99.3334) = -132$$ (same as before) - $$k_2 = f(2.5, -99.3334 + (-132)/2) = f(2.5, -165.3334)$$ $$= -5(15.625) - 23(6.25) + 25 - 20 = -78.125 - 143.75 + 25 - 20 = -216.875$$ - $$k_3 = f(2.5, -99.3334 + (-216.875)/2) = f(2.5, -207.7711) = -216.875$$ - $$k_4 = f(3, -99.3334 + (-216.875)) = f(3, -316.2084)$$ $$= -5(27) - 23(9) + 30 - 20 = -135 - 207 + 30 - 20 = -332$$ - Compute $$y_3 = -99.3334 + \frac{1}{6}(-132 + 2(-216.875) + 2(-216.875) + (-332))$$ $$= -99.3334 + \frac{1}{6}(-132 - 433.75 - 433.75 - 332) = -99.3334 + \frac{1}{6}(-1331.5) = -99.3334 - 221.9167 = -321.2501$$ **Final answers:** $$y_1 \approx -21.9167, \quad y_2 \approx -99.3334, \quad y_3 \approx -321.2501$$