---
title: "RK-2: y' = xy + y²"
subject: "Numerical Method"
chapter: 6
key: "semester_4/numerical_method:rk2-xy-y2"
source: https://www.bctengineer.com/q/semester_4/numerical_method/rk2-xy-y2
site: BCT Engineering
---

# RK-2: y' = xy + y²

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2068 Magh, 6 marks
- Video: [8. Runge-Kutta Method of Second Order | Concept & Problem#1 | Numerical Analysis | Numerical Methods](https://www.youtube.com/watch?v=Fcen6D17dik) — MKS TUTORIALS by Manoj Sir
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/rk2-xy-y2
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-6

## Question

Using the Runge-Kutta method of second order, obtain a solution of the equation y' = xy + y², with the initial condition y(0) = 1 for the range 0 ≤ x ≤ 0.6, with increments of 0.2.

## Short answer

Use second-order Runge-Kutta (Heun) with f(x,y)=xy+y^2, h=0.2, starting y(0)=1. Three steps give y(0.2) approximately 1.2680, y(0.4) approximately 1.7888, and y(0.6) approximately 2.9961.

## Answer

Given f(x, y) = xy + y², y(0) = 1, h = 0.2, range 0 ≤ x ≤ 0.6 (three 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₁ = 0.2·f(0, 1)         = 0.2(0 + 1)                       = 0.2000
k₂ = 0.2·f(0.2, 1.2000)  = 0.2[0.2(1.2000) + (1.2000)²] = 0.3360
y(0.2) = 1 + (0.2000 + 0.3360)/2          = 1.2680
```
#### All steps
| step | xₙ | yₙ | k₁ | k₂ | yₙ₊₁ |
|---|---|---|---|---|---|
| 0 | 0.0000 | 1.0000 | 0.2000 | 0.3360 | 1.2680 |
| 1 | 0.2000 | 1.2680 | 0.3723 | 0.6693 | 1.7888 |
| 2 | 0.4000 | 1.7888 | 0.7831 | 1.6315 | 2.9961 |

**Answer: y(0.2) ≈ 1.2680, y(0.4) ≈ 1.7888, y(0.6) ≈ 2.9961**

(The solution grows quickly because y' contains y². The exact solution blows up near x ≈ 0.87, and its value at x = 0.6 is about 3.31, so a coarse step such as h = 0.2 gives large errors here.)

## Check yourself

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

1. Which is the second-order RK (Heun) formula?
   A. k1 = h f(x,y), k2 = h f(x+h/2, y+k1/2), y1 = y + k2/4
   B. y1 = y + k1
   C. y1 = y + (k1+2k2+2k3+k4)/6
   D. k1 = h f(x,y), k2 = h f(x+h, y+k1), y1 = y + (k1+k2)/2
   Answer: D. Heun averages the start slope and the Euler-predicted end slope. (Key point: RK-2 formula)

2. How many steps for 0 <= x <= 0.6 with increment 0.2?
   A. 3
   B. 2
   C. 6
   D. 0.6
   Answer: A. 0.6/0.2 = 3. (Key point: Steps)

3. What is k2 in the first step?
   A. 0.2000
   B. 0.3360
   C. 0.2400
   D. 0.4000
   Answer: B. k2 = 0.2[0.2(1.2) + 1.2^2] = 0.2(1.68) = 0.336. (Key point: First step k2)

4. What is y(0.2)?
   A. 1.2000
   B. 1.3360
   C. 1.2680
   D. 1.1680
   Answer: C. 1 + (0.2 + 0.336)/2 = 1.268. (Key point: Result)

## Close variants set in other exams

- [RK-2: y'' = y - x y'](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-y-double-prime-y-xy) — Numerical Method, chapter 6, asked 2×

## 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
- [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
- [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
- [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-4: y'' - 3y' + y = sin x](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark4-second-order-ivp-y12) — Numerical Method, chapter 6

## Related in other subjects

- [Condition for second degree equation to be a cone](https://www.bctengineer.com/question.md?key=semester_2%2Fmathematics%3Acondition-second-degree-equation-be) — Mathematics, chapter 3, asked 2×
- [Power series solution of y''+xy'+y=0](https://www.bctengineer.com/question.md?key=semester_2%2Fmathematics%3Apower-series-solution-y-xy) — Mathematics, chapter 4, asked 12×
- [Second order constant delay filter](https://www.bctengineer.com/question.md?key=semester_5%2Ffilter_design%3Aconstant-delay-second-order) — Filter Design, chapter 2, asked 4×
- [Classify a second order PDE](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Aclassify-a-second-order-pde) — Mathematics III, chapter 4
