Gain of particular op-amp circuit (A combination of inverting, non-inverting and differential configurations)

amplifier

I have a following circuit with an operational amplifier. It is a configuration I haven't seen before and I am not quite sure how to calculate the gain in terms of its inputs A and B.

enter image description here

The input B is just the configuration of Inverting Amplifier
$$Gain_B = -\frac{470}{240}$$
Then I am puzzled by the 4k3 resistor. If the resistor wouldn't be there, the configuration would be similar to the differential amplifier and the gain would be
$$ G = \bigg(\frac{240+470}{240}\bigg)\bigg(\frac{3k6}{3k6+510}\bigg)A-\bigg(\frac{470}{240}\bigg)B$$
However, that is neglecting the 4k3 resistor, which somehow changes the gain – it reminds me of the non-inverting amplifier configuration, which would have gain of $$G_\text{part} = 1+\frac{470}{4k3}$$ and the two resistor in front of it would just act as a potential divider \$\frac{3k6}{3k6+510}A\$

The correct solution should be $$G \approx 2.687A-1.9583B$$

Just to clarify, I am assuming and ideal op-amp here (i.e. infinite gain, etc.). This should not be a hard problem, however, I have failed to find even after a hour of googling (it might be caused by the fact that I do not know how to call this circuit configuration).

Best Answer

It's just a supeposition of two common circuits, ground B and evaluate the gain you get from A, then ground A and evaluate for B.

you've got the B term right "-470/240" = -1.9583

for the A term ground the B input so the 4.3K is parallel with the 240

$$ \bigg(\frac{240||4k3+470}{240||4k3}\bigg)\bigg(\frac{3k6}{3k6+510}\bigg)A $$