8. (10%) Solve the differential equation (x2 + 1)dx + cos y dy = 0.