Leibniz formula for determinants