Babylon. But the Greeks took it to the next level.
And calculus was invented by a Christian theologian named Sir Isaac Newton, who finished the work of a predecessor theologian Rene Descartes.
The Greek Diophantus was the first to do something sort of recognizable as or algebra. Meaning he used symbols to express mathematical relationships. Prior to that, mathematical relationships were described in words - sentences. His texts dealt with solving algebraic equations. Diophantine equations (”Diophantine geometry”) and Diophantine approximations are important areas of mathematical research. Arabs (such as Musa al-Kharzim) preserved and extended his work.
Read See Amazon link below! (Read this book and you’ll never look at algebra the same way! It’s very very very readable!)