It dawns on me that you may not have wanted 'n' to mean the same number in EACH case. That would require a much lengthier response. In fact, you should have whole chapters on it in your book, if you have one. Rewriting your text book won't help anyone. Do you have a book?
Look Up:
* Factoring
* Completing the Square
* Quadratic Formula
Post a specific problem and what you have done to solve it. Give us a chance to se where you are struggling.