OP Amp-Difference amplifier
I'll assume that it's an ideal OP-amp (voltage at (+)input = voltage at (-)input)

So, voltage dividing gives:

\$_{(+)}input=V_0\frac{R_1}{R_1+R_2}\$

And for (-)input: current from left = current from right


\$\frac{V_{IN}-_{(-)}input}{R_1}= \frac{_{(-)}input-V_{OUT}}{R_2}\$

\$\frac{R_2(V_{IN}-_{(-)}input)}{R_1}= _{(-)}input-V_{OUT}\$

\$_{(-)}input - \frac{R_2(V_{IN}-_{(-)}input)}{R_1} =V_{OUT}\$

(+)input into (-)input

remember: (+)input = V0*R1/(R1+R2)
remember: (-)input = (+)input


\$V_0\frac{R_1}{R_1+R_2} - \frac{R_2(V_{IN}-V_0\frac{R_1}{R_1+R_2})}{R_1} =V_{OUT}\$

Tidy up:


\$V_0-V_{IN}\frac{R_2}{R_1}=V_{OUT}\$

Verified here