9. Runge-Kutta 2 method (second order differential equation) example ( Enter your problem )
  1. Formula-1 & Example-1 : `y'=(x-y)/2`
  2. Example-2 : `y'=-2x-y`
  3. Example-3 : `y'=-y`
  4. Formula-2 & Example-1 : `y'=(x-y)/2`
  5. Example-2 : `y'=-2x-y`
  6. Example-3 : `y'=-y`
Other related methods
  1. Euler method (first order differential equation)
  2. Runge-Kutta 2 method (first order differential equation)
  3. Runge-Kutta 3 method (first order differential equation)
  4. Runge-Kutta 4 method (first order differential equation)
  5. Improved Euler method / Modified Euler method (first order differential equation)
  6. Midpoint Euler method (first order differential equation)
  7. Taylor Series method (first order differential equation)
  8. Euler method (second order differential equation)
  9. Runge-Kutta 2 method (second order differential equation)
  10. Runge-Kutta 3 method (second order differential equation)
  11. Runge-Kutta 4 method (second order differential equation)
  12. Improved Euler method / Modified Euler method (second order differential equation)
  13. Midpoint Euler method (second order differential equation)
  14. Taylor Series method (second order differential equation)

4. Formula-2 & Example-1 : `y'=(x-y)/2`
(Previous example)
6. Example-3 : `y'=-y`
(Next example)

5. Example-2 : `y'=-2x-y`





Find y(0.4) for `y''=xz^2-y^2`, `x_0=0, y_0=1, z_0=0`, with step length 0.2 using Runge-Kutta 2 method (second order differential equation)

Solution:
Given `y^('')=xz^2-y^2, y(0)=1, y'(0)=0, h=0.2, y(0.4)=?`

put `(dy)/(dx)=z` and differentiate w.r.t. x, we obtain `(d^2y)/(dx^2)=(dz)/(dx)`

We have system of equations
`(dy)/(dx)=z=f(x,y,z)`

`(dz)/(dx)=xz^2-y^2=g(x,y,z)`

Method-1 : Using formula `k_2=f(x_0+h,y_0+hk_1,z_0+hl_1)`

Second order Runge-Kutta (RK2) method for second order differential equation formula
`k_1=f(x_n,y_n,z_n)`

`l_1=g(x_n,y_n,z_n)`

`k_2=f(x_n+h,y_n+hk_1,z_n+hl_1)`

`l_2=g(x_n+h,y_n+hk_1,z_n+hl_1)`

`y_(n+1)=y_n+(h(k_1+k_2))/2`

`z_(n+1)=z_n+(h(l_1+l_2))/2`



for `n=0,x_0=0,y_0=1,z_0=0`

`k_1=f(x_0,y_0,z_0)`

`=f(0,1,0)`

`=0`

`l_1=g(x_0,y_0,z_0)`

`=g(0,1,0)`

`=-1`

`k_2=f(x_0+h,y_0+hk_1,z_0+hl_1)`

`=f(0.2,1,-0.2)`

`=-0.2`

`l_2=g(x_0+h,y_0+hk_1,z_0+hl_1)`

`=g(0.2,1,-0.2)`

`=-0.992`

`y_1=y_0+(h(k_1+k_2))/2`

`=1-0.02`

`=0.98`

`z_1=z_0+(h(l_1+l_2))/2`

`=0-0.1992`

`=-0.1992`

`x_1=x_0+h=0+0.2=0.2`



for `n=1,x_1=0.2,y_1=0.98,z_1=-0.1992`

`k_1=f(x_1,y_1,z_1)`

`=f(0.2,0.98,-0.1992)`

`=-0.1992`

`l_1=g(x_1,y_1,z_1)`

`=g(0.2,0.98,-0.1992)`

`=-0.9525`

`k_2=f(x_1+h,y_1+hk_1,z_1+hl_1)`

`=f(0.4,0.9402,-0.3897)`

`=-0.3897`

`l_2=g(x_1+h,y_1+hk_1,z_1+hl_1)`

`=g(0.4,0.9402,-0.3897)`

`=-0.8232`

`y_2=y_1+(h(k_1+k_2))/2`

`=0.98-0.0589`

`=0.9211`

`x_2=x_1+h=0.2+0.2=0.4`

`:.y(0.4)=0.9211`

`n``x_n``y_n``z_n``k_1``l_1``k_2``l_2``x_(n+1)``y_(n+1)``z_(n+1)`
00100-1-0.2-0.9920.20.98-0.1992
10.20.98-0.1992-0.1992-0.9525-0.3897-0.82320.40.9211




Method-2 : Using formula `k_2=f(x_0+h/2,y_0+(hk_1)/2,z_0+(hl_1)/2)`

Second order Runge-Kutta (RK2) method for second order differential equation formula
`k_1=f(x_n,y_n,z_n)`

`l_1=g(x_n,y_n,z_n)`

`k_2=f(x_n+h/2,y_n+(hk_1)/2,z_n+(hl_1)/2)`

`l_2=g(x_n+h/2,y_n+(hk_1)/2,z_n+(hl_1)/2)`

`y_(n+1)=y_n+hk_2`

`z_(n+1)=z_n+hl_2`



for `n=0,x_0=0,y_0=1,z_0=0`

`k_1=f(x_0,y_0,z_0)`

`=f(0,1,0)`

`=0`

`l_1=g(x_0,y_0,z_0)`

`=g(0,1,0)`

`=-1`

`k_2=f(x_0+h/2,y_0+(hk_1)/2,z_0+(hl_1)/2)`

`=f(0.1,1,-0.1)`

`=-0.1`

`l_2=g(x_0+h/2,y_0+(hk_1)/2,z_0+(hl_1)/2)`

`=g(0.1,1,-0.1)`

`=-0.999`

`y_1=y_0+hk_2`

`=1-0.02`

`=0.98`

`z_1=z_0+hl_2`

`=0-0.1998`

`=-0.1998`

`x_1=x_0+h=0+0.2=0.2`



for `n=1,x_1=0.2,y_1=0.98,z_1=-0.1998`

`k_1=f(x_1,y_1,z_1)`

`=f(0.2,0.98,-0.1998)`

`=-0.1998`

`l_1=g(x_1,y_1,z_1)`

`=g(0.2,0.98,-0.1998)`

`=-0.9524`

`k_2=f(x_1+h/2,y_1+(hk_1)/2,z_1+(hl_1)/2)`

`=f(0.3,0.96,-0.295)`

`=-0.295`

`l_2=g(x_1+h/2,y_1+(hk_1)/2,z_1+(hl_1)/2)`

`=g(0.3,0.96,-0.295)`

`=-0.8955`

`y_2=y_1+hk_2`

`=0.98-0.059`

`=0.921`

`x_2=x_1+h=0.2+0.2=0.4`

`:.y(0.4)=0.921`

`n``x_n``y_n``z_n``k_1``l_1``k_2``l_2``x_(n+1)``y_(n+1)``z_(n+1)`
00100-1-0.1-0.9990.20.98-0.1998
10.20.98-0.1998-0.1998-0.9524-0.295-0.89550.40.921





This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



4. Formula-2 & Example-1 : `y'=(x-y)/2`
(Previous example)
6. Example-3 : `y'=-y`
(Next example)





Share this solution or page with your friends.
 
 
Copyright © 2026. All rights reserved. Terms, Privacy
 
 

.