function rk2(F, XBEGIN, YBEGIN, XEND, NSTEPS)

%*****************************************************************************80
%
%  Reference:
%
%    Samuel Conte, Carl de Boor,
%    Elementary Numerical Analysis,
%    Third Edition,
%    SIAM, 2017,
%    ISBN: 978-1-611975-19-2.
%
H = (XEND - XBEGIN)/NSTEPS; XN = XBEGIN; YN = YBEGIN;  DERIV = F(XN,YN);
N = 0;
% fprintf(' %15.8e  %15.8e  %15.8e  %15.8e\n',[H,XN,YN,DERIV])
count = 1;
for N=1:NSTEPS
   k1 = H*F(XN,YN); k2 = H*F(XN+H,YN+k1); 
   YN = YN + (k1+k2)/2; XN = XN+H; DERIV = F(XN,YN);
   if XN==1.5
      out1p5 = [H,YN,DERIV];
   elseif XN==2
      fprintf(' %15.8e  %15.8e  %15.8e  %15.8e  %15.8e\n',[out1p5,YN,DERIV])
   end
end
return, end
