sin(x+h)-sinx
=sin[(x+h/2)+h/2]-sin[(x+h/2)-h/2]
=sin(x+h/2)cos(h/2)+cos(x+h/2)cos(h/2)-[sin(x+h/2)cos(h/2)-cos(x+h/2)sin(h/2)]
=2cos(x+h/2)sin(h/2)
sin(x+h)-sinx
=sin[(x+h/2)+h/2]-sin[(x+h/2)-h/2]
=sin(x+h/2)cos(h/2)+cos(x+h/2)cos(h/2)-[sin(x+h/2)cos(h/2)-cos(x+h/2)sin(h/2)]
=2cos(x+h/2)sin(h/2)