Generalization of Kennedy’s integral formula using milnor defect