I would like find out how to get the middle and last term together
There are several ways of solving quadratics: the quadratic formula, completing the square, square root, factoring. If your lesson is asking you to use a specific method you should use that one. In this case, I think you should just use the quadratic formula since you will not be able to factor out 47z.
So, first recall the equation is in the form ax2+bx+c=0 and the quadratic formula is x=-b±√b2-4ac / 2a. There are two solutions since there is a ± in the formula.
So, plug in the numbers from your situation: x=-(-47)±√(-47)2-4(40)(12) / 2(40)
Now work out the numbers: x=47±√2209-1920 / 80
Take it further: x=47±√289 / 80
Once more: x=47±17 / 80
Finally: x=64/80 or x=30/80 which are reducible to x=4/5 or x=3/8