Let L1 be the line passing through the point P1=(4, 5, −5) with direction vector →d1=[0, −1, 1]T, and let L2 be the line passing through the point P2=(13, 0, 0) with direction vector →d2=[4, −1, 3]T.

Find the shortest distance d between these two lines, and find a point Q1 on L1 and a point Q2 on L2 so that d(Q1,Q2) = d.

To find the shortest distance (d) between the two lines (L1 and L2), we need to find a point on each line that is closest to the other line. We follow these steps:

1. Calculate the vector →v between the two points P1 and P2: →v = P2 - P1 = [13, 0, 0] - [4, 5, -5] = [9, -5, 5].

2. Calculate the dot product between →v and →d1: →v · →d1 = [9, -5, 5] · [0, -1, 1] = 9(0) + (-5)(-1) + 5(1) = 0 + 5 + 5 = 10.

3. Calculate the dot product between →v and →d2: →v · →d2 = [9, -5, 5] · [4, -1, 3] = 9(4) + (-5)(-1) + 5(3) = 36 + 5 + 15 = 56.

4. Calculate the dot product between →d1 and →d1: →d1 · →d1 = [0, -1, 1] · [0, -1, 1] = 0(0) + (-1)(-1) + 1(1) = 0 + 1 + 1 = 2.

5. Calculate the dot product between →d2 and →d2: →d2 · →d2 = [4, -1, 3] · [4, -1, 3] = 4(4) + (-1)(-1) + 3(3) = 16 + 1 + 9 = 26.

6. Calculate the dot product between →v and →d1: →v · →d1 = 10, and calculate the dot product between →v and →d2: →v · →d2 = 56.

7. Calculate the dot product between →d1 and →d1: →d1 · →d1 = 2, and calculate the dot product between ->d2 and →d2: →d2 · →d2 = 26.

8. Calculate the scalar values s and t as follows:
s = ( →v · →d1 ) / ( →d1 · →d1 ) = 10 / 2 = 5.
t = ( →v · →d2 ) / ( →d2 · →d2 ) = 56 / 26 = 28/13.

9. Calculate the points Q1 and Q2 as follows:
Q1 = P1 + s * →d1 = [4, 5, -5] + 5 * [0, -1, 1] = [4, 5, -5] + [0, -5, 5] = [4, 0, 0].
Q2 = P2 + t * →d2 = [13, 0, 0] + (28/13) * [4, -1, 3] = [13, 0, 0] + [112/13, -28/13, 84/13] = [205/13, -28/13, 84/13].

10. Calculate the distance d(Q1, Q2) between the points Q1 and Q2 using the distance formula (Euclidean distance):
d(Q1, Q2) = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2)
= sqrt((205/13 - 4)^2 + (-28/13 - 0)^2 + (84/13 + 5)^2).

You can simplify the expression for d(Q1, Q2) and evaluate it to get the exact value for d, which will give the shortest distance between the two lines.

You can find a helpful discussion here:

https://math.stackexchange.com/questions/2168307/distance-between-2-skew-lines-weird-result