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

# RK-2: y'' = y - x y'

Numerical Method · Chapter 6: Solution of ordinary differential equations

- Asked in: 2071 Magh, 8 marks
- Video: [Runge kutta method second order differential equation simple example(PART-1)](https://www.youtube.com/watch?v=Fs1cRieo8XM) — EASY MATHS EASY TRICKS
- 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-double-prime-y-xy
- 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'' = y - xy' with the initial condition y(0) = 1, y'(0) = 0 to find y(0.2) and y'(0.2). (Take h = 0.1)

## Short answer

Reduce to the system y'=z, z'=y-xz and apply second-order Runge-Kutta (Heun) with h=0.1. Two steps give y(0.2) approximately 1.0199 and y'(0.2) approximately 0.1980.

## Answer

Put z = y'. The equation becomes the system

```text
dy/dx = z             = f(x, y, z)
dz/dx = y − x·z       = g(x, y, z)
x₀ = 0, y₀ = 1, z₀ = 0, h = 0.1
```
RK-2 (Heun) for the system:

```text
k₁ = h·f(x, y, z)                 l₁ = h·g(x, y, z)
k₂ = h·f(x+h, y+k₁, z+l₁)         l₂ = h·g(x+h, y+k₁, z+l₁)
yₙ₊₁ = yₙ + (k₁+k₂)/2             zₙ₊₁ = zₙ + (l₁+l₂)/2
```

#### Step 1 (x = 0 → 0.1)
```text
k₁ = 0.1(0)                           = 0.0000
l₁ = 0.1(1 − 0·0)                     = 0.1000
k₂ = 0.1(0 + 0.1)                     = 0.0100
l₂ = 0.1[(y+k₁) − (x+h)(z+l₁)] = 0.1[1 − 0.1(0.1)] = 0.0990
y(0.1) = 1 + (0 + 0.01)/2             = 1.0050
z(0.1) = 0 + (0.1 + 0.099)/2          = 0.0995
```
#### Step 2 (x = 0.1 → 0.2)
```text
k₁ = 0.1(z) = 0.1(0.0995)                    = 0.0100
l₁ = 0.1[1.0050 − 0.1(0.0995)]             = 0.0995
k₂ = 0.1(z + l₁)                      = 0.0199
l₂ = 0.1[(y+k₁) − 0.2(z+l₁)]          = 0.0975
y(0.2) = 1.0050 + (0.0100 + 0.0199)/2 = 1.0199
z(0.2) = 0.0995 + (0.0995 + 0.0975)/2 = 0.1980
```
#### Table
| step | x | y | z=y' | k₁ | l₁ | k₂ | l₂ | yₙ₊₁ | zₙ₊₁ |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0.0000 | 1.0000 | 0.0000 | 0.0000 | 0.1000 | 0.0100 | 0.0990 | 1.0050 | 0.0995 |
| 1 | 0.1000 | 1.0050 | 0.0995 | 0.0100 | 0.0995 | 0.0199 | 0.0975 | 1.0199 | 0.1980 |

**Answer: y(0.2) ≈ 1.0199, y'(0.2) ≈ 0.1980**

## Check yourself

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

1. With z = y', how is y'' = y - x y' written?
   A. dy/dx = y - xz and dz/dx = z
   B. dy/dx = z and dz/dx = y - x z
   C. dy/dx = z and dz/dx = y + xz
   D. dy/dx = y and dz/dx = -xz
   Answer: B. y' = z and z' = y'' = y - x z. (Key point: Reduction)

2. What are the RK-2 (Heun) update formulas for y and z?
   A. y += k2, z += l2 evaluated at the midpoint
   B. y += (k1+2k2+2k3+k4)/6
   C. y += (k1+k2)/2, z += (l1+l2)/2, where k2, l2 are evaluated at (x+h, y+k1, z+l1)
   D. y += (k1+k2)/2 but z += l1 only
   Answer: C. Heun averages the slope at the start and at the Euler-predicted end point, for both variables. (Key point: RK-2 formula)

3. What is l1 in the first step (x=0, y=1, z=0, h=0.1)?
   A. 0
   B. 0.099
   C. 0.01
   D. 0.1
   Answer: D. l1 = 0.1(1 - 0*0) = 0.1. (Key point: Step 1 value of l1)

4. What are y(0.2) and y'(0.2)?
   A. 1.0199 and 0.1980
   B. 1.0050 and 0.0995
   C. 1.0199 and 0.0995
   D. 1.1980 and 0.1199
   Answer: A. After the second step y = 1.0199 and z = 0.1980. (Key point: Result)

## Close variants set in other exams

- [RK-2: y' = xy + y²](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-xy-y2) — 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: simultaneous equations](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ark2-simultaneous) — 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
- [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
