sqrt(1/2+sin^2 x)=(sqrt(2)/2)(cosx+sin^2 x)