cos2x+3cosx=-2