---
title: "R-K2: y' = y/(x²+y²)"
subject: "Numerical Method"
chapter: 6
key: "semester_4/numerical_method:rk2-y-over-x2-y2"
source: https://www.bctengineer.com/q/semester_4/numerical_method/rk2-y-over-x2-y2
site: BCT Engineering
---

# R-K2: y' = y/(x²+y²)

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2075 Baisakh, 6 marks
- Video: [Runge kutta method 2nd order |Rk-2 method | Runge kutta method](https://www.youtube.com/watch?v=Y9EqalZP_6U) — Arya Anjum
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/rk2-y-over-x2-y2
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-6

## Question

Solve y' = y/(x² + y²), y(0) = 1 using R-K2 method in the range 0, 0.5, 1.

## Short answer

Using Heun's RK2 method with h=0.5: k1 = h f(x,y), k2 = h f(x+h, y+k1), y_{n+1}=y_n+(k1+k2)/2. Results: y(0.5) ≈ 1.4000, y(1.0) ≈ 1.6671.

## Answer

Given y' = y/(x² + y²), y(0) = 1, range 0 to 1 in steps of 0.5, so h = 0.5 (two steps).

The second-order Runge–Kutta (Heun / modified Euler) formulas are:

```text
k₁ = h·f(xₙ, yₙ)
k₂ = h·f(xₙ + h, yₙ + k₁)
yₙ₊₁ = yₙ + ½(k₁ + k₂)
```


#### First step
```text
k₁ = h·f(x₀, y₀) = 0.5·f(0.0000, 1.0000) = 0.5000
k₂ = h·f(x₀+h, y₀+k₁) = 0.5·f(0.5000, 1.5000) = 0.3000
y₁ = y₀ + (k₁+k₂)/2 = 1.0000 + (0.5000 + 0.3000)/2 = 1.4000
```

#### All steps (h = 0.5)
| step | xₙ | yₙ | k₁ = h·f(xₙ,yₙ) | k₂ = h·f(xₙ+h, yₙ+k₁) | yₙ₊₁ = yₙ + (k₁+k₂)/2 |
|---|---|---|---|---|---|
| 0 | 0.0000 | 1.0000 | 0.5000 | 0.3000 | 1.4000 |
| 1 | 0.5000 | 1.4000 | 0.3167 | 0.2175 | 1.6671 |

**Answer: y(0.5) ≈ 1.4000, y(1) ≈ 1.6671**

## Check yourself

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

1. Range 0, 0.5, 1 gives h?
   A. 1
   B. 0.1
   C. 0.5
   D. 0.25
   Answer: C. Two steps. (Key point: h)

2. k1 at (0,1)?
   A. 1
   B. 0.25
   C. 0.3
   D. 0.5×1/(0+1) = 0.5
   Answer: D. f = 1. (Key point: k1)

3. k2 at (0.5, 1.5)?
   A. 0.5×1.5/(0.25+2.25) = 0.3
   B. 0.5
   C. 0.6
   D. 0.15
   Answer: A. 1.5/2.5 = 0.6. (Key point: k2)

4. y1?
   A. 1.5
   B. 1.4
   C. 1.3
   D. 1.8
   Answer: B. 1 + 0.8/2. (Key point: y1)

## Related in Numerical Method

- [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
