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

# RK-4: (y²-x²)/(y²+x²)

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2071 Bhadra, 6 marks
- Video: [Runge-Kutta 4th Order | Solve dy/dx = (y²−x²)/(y²+x²)](https://www.youtube.com/watch?v=0kLO9C3tBGc) — Mathematics Tutor
- 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-prime-y2-x2
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-6

## Question

Solve dy/dx = (y² - x²)/(y² + x²) using RK-4 method, for y(0.4). (Given, y(0) = 1, h = 0.2)

## Short answer

Using classical RK4 with h=0.2 for dy/dx=(y^2-x^2)/(y^2+x^2), y(0)=1. Step 1: y(0.2)=1.1960; Step 2: y(0.4)=1.3753.

## Answer

Given f(x, y) = (y² − x²)/(y² + x²), y(0) = 1, h = 0.2. To reach y(0.4) two steps are needed.

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.1967
k₃ = 0.2·f(0.1000, 1.0984)                       = 0.1967
k₄ = 0.2·f(0.2000, 1.1967)                       = 0.1891
y(0.2) = 1.0000 + (0.2000 + 2(0.1967) + 2(0.1967) + 0.1891)/6 = 1.1960
```
**Step 2:** x = 0.2, y = 1.1960
```text
k₁ = 0.2·f(0.2000, 1.1960)                       = 0.1891
k₂ = 0.2·f(0.3000, 1.2906)                       = 0.1795
k₃ = 0.2·f(0.3000, 1.2857)                       = 0.1793
k₄ = 0.2·f(0.4000, 1.3753)                       = 0.1688
y(0.4) = 1.1960 + (0.1891 + 2(0.1795) + 2(0.1793) + 0.1688)/6 = 1.3753
```

**Answer: y(0.2) ≈ 1.1960, y(0.4) ≈ 1.3753**

## Check yourself

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

1. With y(0) = 1 and h = 0.2, how many RK-4 steps are needed to get y(0.4)?
   A. 1
   B. 4
   C. 0.4
   D. 2
   Answer: D. (0.4 - 0)/0.2 = 2 steps. (Key point: Number of steps)

2. Which expression gives y(n+1) in classical RK-4?
   A. yn + (k1 + 2k2 + 2k3 + k4)/6
   B. yn + (k1 + k2 + k3 + k4)/4
   C. yn + (k1 + 4k2 + k3)/6
   D. yn + (k1 + 2k2 + 2k3 + k4)/3
   Answer: A. The weights 1, 2, 2, 1 sum to 6, so the sum is divided by 6. (Key point: RK-4 formula)

3. How is k2 computed?
   A. k2 = h f(xn + h, yn + k1)
   B. k2 = h f(xn + h/2, yn + k1/2)
   C. k2 = h f(xn + h/2, yn + k2/2)
   D. k2 = h f(xn, yn + k1/2)
   Answer: B. k2 uses the midpoint in x and y advanced by half of k1. (Key point: Stage k2)

4. What is the final answer obtained for y(0.4)?
   A. About 1.1960
   B. About 1.2000
   C. About 1.3753
   D. About 1.4500
   Answer: C. Step 1 gives y(0.2) = 1.1960 and step 2 gives y(0.4) = 1.3753. (Key point: Result)

## Related in Numerical Method

- [RK-4: dy/dx = (1+x²)y](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark4-y-1-x2) — 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
- [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

## 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×
