Finding the equation of the straight (l1), which passes in point $\displaystyle P(2,1,-1)$ and perpendicular to the straight (l2): $\displaystyle (x,y,z)=(2,0,0)+t(3,1,-1)$
Answer:
$\displaystyle (x,y,z)=(2,1,-1)+h(2,-3,3)$
There are 2 completely different ways to do this problem:
1. By calculus: Let Q denote a point on $\displaystyle l_2 : Q \in l_2$
Then calculate the distance $\displaystyle |\overline{PQ}|$ which will give you an equation of a function with respect to t. Calculate the minimum distance using the first derivative.
$\displaystyle (d(t))^2=2-4t+11t^2$
If d(t) has an extreme value then (d(t))^2 has an extreme value too. Therefore it is sufficient if you examine (d(t))^2.
Solve $\displaystyle ((d(t))^2)' = 0$ for t.
Calculate the coordinates of Q.
Calculate the equation of the line PQ.
2. By analytic geometry: Calculate the equation of an auxiliar plane a perpendicular to $\displaystyle l_2$ and containing P.
Then calculate the intersection of $\displaystyle l_2$ and a which is the point Q.
Calculate the equation of the line PQ.