Who invented algebra and why?

The word "algebra" comes from the Arabic word "al-jabr", meaning reunion and is part of the title of from a book on mathematics written by Muhammed ibn Musa Al-Khwarizmi.

He was an Arab mathematician who worked on algebra, arithmetic, and astronomical tables. The word "algorithm" is also derived from his name.

Al-Khwarizmi did not invent algebra but his book was very influential in bringing algebra to the western world so he is generally considered the father of algebra.

A Greek mathematicians Diophantus is sometimes called the father of algebra as he developed one of the earliest forms of solving equations. However he used mostly special ad hoc methods to solve equations, whilst Al- Khwarizmi was the first to solve equations using general methods.