0
3.4kviews
Using Euler's method find the approximate value of y where $\frac{dy}{dx}=\frac{y-x}{x}$ and y(1)=2 at x=2, taking h= 0.2 and compare it with exact value.
1 Answer
0
142views

$ f(x,y) = \frac{y-x}{x}, x_0 =1, y_0 = 2 , h = 0.2 \\ $

$ At \thinspace x_1 = x_0 + h = 1 + 0.2 = 1.2 \\ $

$ At \thinspace y_1 = y_0 + hf(x_0,y_0) = 2 + 0.2(1) = 2.2 \\ $

$ At \thinspace x_2 = x_1 + h = 1.2 + 0.2 = 1.4 \\ $

$ At \thinspace y_2 = y_1 + hf(x_1,y_1) = 2.2 + 0.2(0.8333) = 2.3667 \\ $

$ At \thinspace x_3 = x_2 + h = 1.4 + 0.2 = 1.6 \\ $

$ At \thinspace y_3 = y_2 + hf(x_2,y_2) = 2.3667 + 0.2(0.6905) = 2.5048 \\ $

$ At \thinspace x_4 = x_3 + h = 1.6 + 0.2 = 1.8 \\ $

$ At \thinspace y_4 = y_3 + hf(x_3,y_3) = 2.5048 + 0.2(0.565) = 2.6179 \\ $

$ At \thinspace x_5 = x_4 + h = 1.8 + 0.2 = 2 \\ $

$ At \thinspace y_5 = y_4 + hf(x_4,y_4) = 2.6179 + 0.2(0.4544) = 2.7088 \\ $

$ Consider $

$ \frac{dy}{dx} = \frac{y-x}{x} = \frac {y}{x} - 1 \\ $

$ \frac{dy}{dx} -\frac{y}{x} = -1 \\ $

$ \text{ It is of the form } \frac {dy}{dx} + py = Q,\text{ where p = } \frac{-1}{x} Q = -1 \\ $

$ e^{\int pdx } = e^ { \int \frac{1}{x} dx } = e^{- log x } = \frac{1}{x} \\ $

$ Solution \thinspace is \thinspace \frac{y}{x} - \int \frac{1}{x} (-1) dx + c = -logx + c \\ $

$\text{ when x = 1, y =2 } \Longrightarrow c = 2 \\ $

$ \therefore \frac{y}{x} = -logx + 2 \\ $

$ \text{ when x = 2, y= 2.6137 }\\ $

Please log in to add an answer.