The equations of the given lines are
→r=(^i+^j)+λ(2^i+^j−^k) and →r=(^i−^j+^k)+μ(−^i+^j−^k)
It is known that the shortest distance between the lines →r=→a1+λ→b1 and →r=→a2+μ→b2 is given by
d=∣∣
∣
∣∣(→b1×→b2).(→a2−→a1)∣∣→b1×→b2∣∣∣∣
∣
∣∣ ......(1)
Comparing the equations,
→a1=^i+^j
→a2=^i−^j+^k
→b1=2^i+^j−^k
→b2=−^i+^j−^k
→a2−→a1=^i−^j+^k−^i−^j=−2^j+^k
→b1×→b2=∣∣
∣
∣∣^i^j^k21−1−11−1∣∣
∣
∣∣
=^i(−1+1)−^j(−2−1)+^k(2+1)
=3^j+3^k
∣∣→b1×→b2∣∣=√32+32=√18=3√2
∴d=∣∣
∣
∣∣(→b1×→b2).(→a2−→a1)∣∣→b1×→b2∣∣∣∣
∣
∣∣
=∣∣
∣
∣∣(3^j+3^k).(−2^j+^k)3√2∣∣
∣
∣∣
=∣∣∣−6+33√2∣∣∣
=1√2
∴ the shortest distance between the two lines is 1√2