I am trying to understand the solution to a quiz I had, and am having trouble.

The question was:

The solution says:

First off, why (when they solve for internal energy and specific volume) do thy use the formula (Quality)*Uvapor + (1-quality)*Uliquid ? This makes sense to me in my head, but it says no our text that the generic equation for u,h,or v is:
Y = Yliq + (Quality)*Ysat.vapor

so why dont they use it in this scenario?

Second, why do they use internal energy and not enthalpy?

The equation you're trying to write: Y = Yliq + (Quality)*Ysat.vapor

... is off just a bit. The correct equation is: Y = Y_{f} + X Y_{fg}
Where Y_{f} is the fluid property at 100% saturated liquid
and
Y_{fg} is the difference between the fluid property at 100% saturated gas and 100% saturated liquid.

Regarding why not enthalpy, if you rewrite the first law it helps to clear this up. Normally, we write:
dU = dQ + dW

But for any control volume with flow in and out, we can also rewrite it:
dU = dQ + dW + dH
where
dH = (U_{in} + pV_{in}) - (U_{out} + pV_{out})
Note that gas flowing into or out of a control volume does work pV so we say H = U + pV
(See ref: http://web.mit.edu/16.unified/www/FALL/thermodynamics/chapter_4.htm )

So if we apply this to the system with two separated tanks that has a control surface around both tanks, we find no heat or work crossing the control surface (dQ=0 and dW=0), nor do we find any flow across the control surface, so dH = 0. All we're left with is dU = 0 (or U1 + U2 = U3).