Can you see that each term has as a factor.
So you can take it out as a common factor.
Collect the like terms.
Now take out as a common factor.
Btw neither of the questions you posted were actually equations. They were expressions. You only have an equation when there is an equals sign...