Non-inverting and inverting gain of differential amplifier
First we must start with some basic assumptions, we assume that the inputs of the circuit are fed from ideal voltage sources and that the op-amp is an ideal op-amp. The latter means that the circuit is linear and we can apply the principle of superposition to calculate the two gains..

For the inverting gain we treat things as if the + input of the circuit (not the + input of the op-amp) is connected to ground. The bottom two resistors have no affect since the op-amps inputs are high-impedance and the top two resistors act just like a normal inverting amplifier.

-Rf/Rg = -20/5 = -4

For the non-inverting gain we treat things as if the - input of the circuit (not the - input of the op-amp) is connected to ground.

When we do this we find that the non-inverting gain is made up of two stages. First we have a voltage divider formed by the bottom two resistors in the diagram. Then we have the op-amp along with the top two resistors in the diagram acting as a non-inverting amplifier. So the overall non-inverting gain works out to

(30/(20+30)) * (1+(20/5)) = (3/5) * 5 = 3