f(x)=(4cos^4x-2cos2x-1)/[sin(π/4+x)*sin^2(π/4-x)]
=(4cos^4x-4cos²x+1)/[sin(π/4)*cosx+sinx*cos(π/4)*(1-cos(π/2-2x))/2]
=(2cos²x-1)²/[√2/2*(cosx+sinx)*(1-sin2x)/2]
=(cos²x-sin²x)²/[√2/4*(cosx+sinx)*(cosx-sinx)²
=(cosx+sinx)²*(cosx-sinx)²/[√2/4*(cosx+sinx)*(cosx-sinx)²
=2√2*(cosx+sinx)=4*sin(π/4+x)