Algebra was first used to solve equations . Although Diophantus and the Babylonians used mostly special ad hoc methods to solve equations , Al-Khwarizmi was the first to solve equations using general methods .