Factoring Quadratic equations

I remember doing something like this in Algebra 2, but I am in PreCal so sorry if it is the wrong section..

The equation is:

2x^2+9x+4=0

When I plug this equation into the quadratic formula I get the same answers my teacher got: x=-1/2 & x=-4

This is how she factored it:

2x^2+9+4=0

(2x+1)(x+4)=0

2x+1=0 | x+4=0

2x=-1 | x=-4

x=-1/2

The problem I have w/ understanding this equation is the numbers inside the parentheses. We were taught to find factors of 4 that add up to 9 and 4+1 clearly doesn't equal 9. Can someone please explain to me how she got those numbers?

/first post. This looks like a cool site and I will be coming here for math help from now on. Hopefully I will be able to answer just as many questions as I propose :p