Given data:
The value of the socks are x+y=$40,000.
The total interest is I=$2100.
The interest on first stock is,
i=x(4%)(1)/100
i=0.04x
The interest on second stock is,
i'=y(6%)(1)/100
=0.06x
0.04x+0.06y=2100
Substitute 40,000-x for y in the above expression.
0.04x+0.06(40,000-x)=2100
0.04x-0.06x=-300
-0.02x=-300
x=$15000
The value of second stock is,
y=40,000-15,000
=$25,000