0
16kviews
Using R.K. method of 4th order solve $\dfrac {dy}{dx}=\dfrac {y^2-x^2}{y^2+x^2}$ given $y(0)=1 \space at \space x=0.2 , 0.4$
1 Answer
4
2.4kviews

$$Let \space f(x,y)= \dfrac {dy}{dx}=\dfrac {y^2-x^2}{y^2+x^2}$$

Part I

Here $h=0.2 , x_0 = 0$ & $y_0 = 1$

By Runge kutta method of 4th order

$$k_1=hf(x_0,y_0)=0.2\times f(0,1)=0.2(\dfrac {1^2-0}{1^2+0})=0.2$$ $ k_2=hf(x_0+\dfrac h2,y_0+\dfrac {k_1}2)\\ = hf(0+\dfrac {0.2}2,1+\dfrac {0.2}2)\\ =0.2\dfrac {(1.1^2-0.1^2)}{(1.1^2+0.1^2)}=0.1967 \\ k_3=hf(x_0+\dfrac h2,y_0+\dfrac {k_2}2) =0.2f(0+\dfrac {0.2}2,\dfrac {1+0.1963}2)\\ =0.2\times \dfrac{1.0984^2-0.1^2}{1.0984^2+0.1^2}\\ =0.1967 \\ k_4=hf(x_0+h,y_0+k_3)=0.2\times f(0+0.2,1+0.1967)\\ =0.2\dfrac {(1.1967^2-0.2^2)}{(1.1967^2+0.2^2)} =0.1891 \\ K=\dfrac 16(k_1+2k_2+2k_3+k_4)\\ =\dfrac 16[0.2+2(0.1967)+2(0.1967)+0.1891]\\ =0.1960\\ y=y_0+k=1+0.1960\\ =1.1960$

The correct value of y when $x=0.2$ is $1.1960$

Part 2

Here $h=0.2 , x1=0.2$ and $y_1=1.1960 $

$$k_1=hf(x_1,y_1)=0.2\times f(0.2,1.960) $$ $ =0.2(\dfrac {1.960^2-0.2^2}{1.960^2+0.2^2})\\ =0.1891 \\ k_2=hf(x_1+\dfrac h2,y_1+\dfrac {k_1}2)\\ = 0.2f(0.2+\dfrac {0.2}2,1.1960 +\dfrac {0.1891}2)\\ =0.2\times\dfrac {(1.2906^2-0.3^2)}{(1.2906^2+0.3^2)}=0.1795 \\ k_3=hf(x_1+\dfrac h2,y_1+\dfrac {k_2}2) =0.2\times \dfrac {(1.2858^2-0.3^3)}{(1.2858^2+0.3^3)} \\ =0.1793 \\ k_4=hf(x_1+h,y_1+k_3)=0.2\times f(0.2+0.2,1.1960+0.1793) \\ =0.2\dfrac {(1.3753^2-0.4^2)}{(1.3753^2+0.4^2)} =0.1688 \\ k=\dfrac 16(k_1+2k_2+2k_3+k_4)\\ =\dfrac 16[0.1891+2(0.1795)+2(0.1793)+0.1688]\\ =0.1793\\ y=y_1+k=1.1960 +0.1793 \\ =1.3753$

The correct value of y when $x=0.4$ is $1.3753$

Please log in to add an answer.