Historically, it is agreed that both get the credit. Newton seems to have discovered it prior to Leibniz but did not publish. Less well known, is that earlier mathematicians like Fermat were discovering portions of it. Even Johannes Kepler solved an integration by stuffing rectangles under a curve and imagining what would happen if there were an infinite number of rectangles that were infinitely small. The beginnings of integral calculus.