First equation: $q=-36$, $p=5$. The factors of $36$ are
$$(1, 36), (2, 18), (3, 12), \boxed{(4,9)}, (6,6)$$
Which of these pairs has a difference of $5$?
$$x^2 + 5x - 36 = (x-4)(x+9)\tag{1}$$
Second equation: $q=12$, $p=7$. The factors of $12$ are
$$(1,12), (2,6), \boxed{(3,4)}$$
Which of these pairs has sum of $7$?
$$x^2 - 7x + 12= (x-3)(x-4)\tag{2}$$
You see how the game is played. Create your factors list. Stop just before the first number is bigger than the second. For example, in the second list you would not consider $(9,4)$ because that combination is already listed as $(4,9)$.
Then sweep through the factors and look at sum and difference.
First equation: $q=-36$, $p=5$. The factors of $36$ are $$(1, 36), (2, 18), (3, 12), \boxed{(4,9)}, (6,6)$$
Which of these pairs has a difference of $5$?
$$x^2 + 5x - 36 = (x-4)(x+9)\tag{1}$$
Second equation: $q=12$, $p=7$. The factors of $12$ are $$(1,12), (2,6), \boxed{(3,4)}$$
Which of these pairs has sum of $7$?
$$x^2 - 7x + 12= (x-3)(x-4)\tag{2}$$
You see how the game is played. Create your factors list. Stop just before the first number is bigger than the second. For example, in the second list you would not consider $(9,4)$ because that combination is already listed as $(4,9)$.
Then sweep through the factors and look at sum and difference.