Length of wire Y is very high compared to length of wire X. So we can assume length of wire Y is infinite compare to wire X. Magnetic field due to wire y from 5cm from wire towards wire X is, B=
µ0I1
2πd
=
µ0×3
2π×0.05
And direction of B is outward. Now force on wire X due to wire Y, FYX=I2Bl =2×
µ0×3
2π×0.05
×0.5 =1.2×10−5N Current flowing in both the wire in same direction so both wire will attract each other with equal force. ∴FYX=FXY ∴FXY=1.2×10−5N, attractive force towards wire X.