Let's factor x squared plus 5x plus 4. Factoring means we want something like, x plus blank, x plus blank. What numbers go in the blanks? Let's put a and b in the blanks and use FOIL to multiply it out.
We see that a and b need to be two numbers that, multiply together to get 4, and add together to get 5. Can you think of the two numbers? Let's think of pairs of numbers that multiply together to get 4. 1 times 4 is 4. and 2 times 2 is 4. For each pair, let's add the two numbers together to see which pair adds up to 5. We see that 1 plus 4 is 5. So 1 and 4 are the numbers we were looking for. Let's go back and fill in the blanks.
With 1 and 4 to get, x plus 1 times x plus 4. Let's check our answer using FOIL to multiply it out. We get x squared plus 5x plus 4 so we know our answer is correct. Our final answer is, x plus 1 times x plus 4.