Modified Euler's
Method :
The Euler forward scheme may be very easy to implement but it can't
give accurate solutions. A very small step size
is required for any meaningful result. In this scheme, since, the
starting point of each subinterval is used to find the slope of the solution
curve, the solution would be correct only if the function is linear.
So an improvement over this is to take the arithmetic average of the slopes
at x_{i} and x_{i+1}(that is, at the
end points of each subinterval). The scheme so obtained is called modified
Euler's method. It works first by approximating a value to y_{i+1}
and then improving it by making use of average slope.
y_{i+1} 
= y_{i}+ h/2 (y'_{i} + y'_{i+1}) 

= y_{i} + h/2(f(x_{i}, y_{i}) + f(x_{i+1},
y_{i+1})) 
If Euler's method is used to find the first approximation
of y_{i+1} then
y_{i+1 }= y_{i} + 0.5h(f_{i} +
f(x_{i+1}, y_{i }+ hf_{i}))
Truncation error:
y_{i+1} = y_{i} + h y'_{i } + h^{2}y_{i}''
/2 + h^{3}y_{i}''' /3! + h^{4}y_{i}^{iv}
/4! + . . .
f_{i+1} = y'_{i+1 } = _{ }y'_{i}
+ h y''_{i } + h^{2}y_{i'}''' /2 + h^{3}y_{i}^{iv}
/3! + h^{4}y_{i}^{v} /4! + . . .
By substituting these expansions in the Modified Euler formula gives
y_{i} + h y'_{i } + h^{2}y_{i}''
/2 + h^{3}y_{i}''' /3! + h^{4}y_{i}^{iv}
/4! + . . . = y_{i}+ h/2 (y'_{i} +
y'_{i} + h y''_{i } +
h^{2}y_{i'}''' /2 + h^{3}y_{i}^{iv}
/3! + h^{4}y_{i}^{v} /4! + . . . )
So the truncation error is:  h^{3}y_{i}''' /12 
h^{4}y_{i}^{iv} /24 + . . . that is,
Modified Euler's method is of order two.
Worked
out problems
Example 1 
Find y(1.0) accurate upto four
decimal places using Modified Euler's method by solving the IVP y'
= 2xy^{2}, y(0) = 1 with step length 0.2. 
Solution 
Example 2 
Find y in [0,3] by solving the initial value problem
y' = (x  y)/2, y(0) = 1. Compare solutions for h = 1/2, 1/4
and 1/8. 
Solution 
Example 3 
Find y(0.1) for y' = x  y^{2}, y(0) = 1 correct upto
four decimal places. 
Solution 
Example 4 
Find y at x = 1.1 and 1.2 by solving y' = x^{2} + y^{2}
, y(1) = 2.3 
Solution 