In numerical differential equation method Taylor high order 2 formula in initial value problem $ y'=f(t,y), y(a)=\alpha, a\leq t \leq b,$ $h$ is step size of $N=2$
$$w_0=\alpha, w_{i+1}=w_i + hf(t_i,w_i)+ \frac{h^2}{2}f'(t_i,w_i) $$
is it correct?
then problem is $ y'=\sin t + e^{-t}=f(t,y) , 0\leq t\leq1, y(0)=0$ with $h = 0.5 $
first $t=0$ i am calculating the $w_1$ this is correct $0.5$ ok
but $t=0.5$ my calculation is $w_2$ is $0.856807508$
but correct solution is $1.07xxxxxxx$
my algorithm is $w_2=0.5+0.5\times(f(0.5,0.5)+0.125\times f'(0.5,0.5))$
again calculating is $0.856807508$ by scientific calculator or r code
is there my calculation mistake?
It always helps to stay as close to the theoretical formula as possible. In this case, $$ w_{k+1}=w_k+hf(t_k,w_k)+\frac12h^2(f_t(t_k,w_k)+f_y(t_k,w_k)f(t_k,w_k)) \\ =w_k+h\left(\left(1+\frac h2f_y(t_k,w_k)\right)f(t_k,w_k)+\frac h2f_t(t_k,w_k)\right) $$
which prints out
In the formula you used you have an error in the inner factor
0.5*h, as instead of $0.5^2=0.25$ you got there $0.125=0.5^3$.