When was Algebra Invented?

Honestly, I wish it never was invented. Algebra was my worst subject and I still have nightmares about those classes. I can blame Al Khwarizimi for inventing it in 820 AD