---
title: "RK-4: dy/dx = (1+x²)y"
subject: "Numerical Method"
chapter: 6
key: "semester_4/numerical_method:rk4-y-1-x2"
source: https://www.bctengineer.com/q/semester_4/numerical_method/rk4-y-1-x2
site: BCT Engineering
---

# RK-4: dy/dx = (1+x²)y

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2068 Bhadra, 6 marks
- Video: [9. Runge-Kutta Method of Fourth Order | Concept & Problem#1 | Numerical Analysis | Numerical Methods](https://www.youtube.com/watch?v=bSIU9SJK6w4) — Manoj Sir TUTES
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/rk4-y-1-x2
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-6

## Question

Solve the differential equation, dy/dx = (1 + x²)y, within x ≤ 0(0.2)0.4 and y(0) = 1 using RK 4th order method.

## Short answer

Apply the classical fourth-order Runge-Kutta formulas to f(x,y)=(1+x^2)y with h=0.2 and y(0)=1. Two steps give y(0.2) approximately 1.2247 and y(0.4) approximately 1.5240.

## Answer

Given f(x, y) = (1 + x²)y, y(0) = 1, h = 0.2, so x = 0, 0.2, 0.4 (two steps).

The classical fourth-order Runge–Kutta formulas are:

```text
k₁ = h·f(xₙ, yₙ)
k₂ = h·f(xₙ + h/2, yₙ + k₁/2)
k₃ = h·f(xₙ + h/2, yₙ + k₂/2)
k₄ = h·f(xₙ + h, yₙ + k₃)
yₙ₊₁ = yₙ + (k₁ + 2k₂ + 2k₃ + k₄)/6
```

**Step 1:** x = 0, y = 1.0000
```text
k₁ = 0.2·f(0.0000, 1.0000)                       = 0.2000
k₂ = 0.2·f(0.1000, 1.1000)                       = 0.2222
k₃ = 0.2·f(0.1000, 1.1111)                       = 0.2244
k₄ = 0.2·f(0.2000, 1.2244)                       = 0.2547
y(0.2) = 1.0000 + (0.2000 + 2(0.2222) + 2(0.2244) + 0.2547)/6 = 1.2247
```
**Step 2:** x = 0.2, y = 1.2247
```text
k₁ = 0.2·f(0.2000, 1.2247)                       = 0.2547
k₂ = 0.2·f(0.3000, 1.3520)                       = 0.2947
k₃ = 0.2·f(0.3000, 1.3720)                       = 0.2991
k₄ = 0.2·f(0.4000, 1.5238)                       = 0.3535
y(0.4) = 1.2247 + (0.2547 + 2(0.2947) + 2(0.2991) + 0.3535)/6 = 1.5240
```

**Answer: y(0.2) ≈ 1.2247, y(0.4) ≈ 1.5240**

The exact solution y = exp(x + x³/3) gives 1.2247 and 1.5240.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. For dy/dx = (1+x^2)y with h = 0.2, how many steps for x up to 0.4?
   A. 2
   B. 1
   C. 3
   D. 4
   Answer: A. x = 0, 0.2, 0.4 means two steps. (Key point: Setup)

2. What is k1 in step 1?
   A. 0.1
   B. 0.2
   C. 0.2222
   D. 1.0
   Answer: B. k1 = 0.2 f(0,1) = 0.2(1)(1) = 0.2. (Key point: k1)

3. Which weighted combination is used?
   A. (k1+k2+k3+k4)/4
   B. (2k1+k2+k3+2k4)/6
   C. (k1 + 2k2 + 2k3 + k4)/6
   D. (k1+4k2+k4)/6
   Answer: C. Classical RK-4 gives the middle slopes double weight. (Key point: Weights)

4. What are y(0.2) and y(0.4)?
   A. 1.2000 and 1.4400
   B. 1.2247 and 1.5000
   C. 1.2247 and 1.7000
   D. 1.2247 and 1.5240
   Answer: D. These match the exact solution exp(x + x^3/3). (Key point: Result)

## Related in Numerical Method

- [Program for RK-4 second order IVP](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark4-program-second-order) — Numerical Method, chapter 6
- [Program for RK-4 first order IVP](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark4-program-first-order) — Numerical Method, chapter 6
- [RK-2: simultaneous equations](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-simultaneous) — Numerical Method, chapter 6
- [RK-4: (y²-x²)/(y²+x²)](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark4-y-prime-y2-x2) — Numerical Method, chapter 6
- [RK-2: y' = 4e^(0.8x) - 0.5y](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-xy-prime) — Numerical Method, chapter 6
- [RK-2: y' = sin x + cos y](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-sinx-cosy) — Numerical Method, chapter 6

## Related in other subjects

- [Solve (1+y²)+(x−e^(tan⁻¹y))dy/dx=0](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-1-plus-y2-x-minus-e-atan-y) — Mathematics I, chapter 4, asked 6×
- [Solve dy/dx = y/x + tan(y/x)](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-dy-dx-y-over-x-tan) — Mathematics I, chapter 4, asked 6×
- [Solve dy/dx − 2y tan x = y² tan x](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-bernoulli-2y-tan-x) — Mathematics I, chapter 4, asked 6×
- [Solve (1+x²)dy/dx+y=e^(tan⁻¹x)](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-1-plus-x2-dy-dx-etan) — Mathematics I, chapter 4, asked 6×
