Let P be the foot of the perpendicular fromt the point `A(5, 4, -1)` to the line `l` whose equation is `vecr=hati+lamda(2hati+9hatj+5hatk)`.
The coordinates on any point on the line are given by
`" "x=1+2lamda`,
`" "y=9lamda and z=5lamda`.
The coordinates of P are given by `1+2lamda, 9lamda and 5lamda` for some value of `lamda`.
The direction ratios of AP are `1+2lamda-5, 9lamda-4 and 5lamda-(-1) or 2lamda-4, 9lamda-4 and 5lamda+1`.
Also, the direction ratios of `l` are 2, 9 and 5.
Since `AP bot l, a_(1)a_(2)+b_(1)b_(2)+c_(1)c_(2)=0`
`rArr" "2(2lamda-4)+9(9lamda-5)+5(5lamda+1)=0`
or `" "4lamda-8+81lamda-36+25lamda+5=0`
or `" "110lamda-39=0 or lamda=39//110`
Now, `AP^(2) = (1+2lamda-5)^(2)+(9lamda-4)^(2)+(5lamda-(-1))^(2)`
`" "=(2lamda-4)^(2)+(9lamda-4)^(2)+(5lamda+1)^(2)`
`" "=4lamda^(2)-16lamda+16+ 81lamda^(2)-72lamda+16 + 25lamda^(2) +10lamda+1=110lamda^(2)-78lamda+33`
`" "=110((39)/(110))^(2)-78((39)/(110))+33`
`" "=(39^(2)-78xx39+33xx110)/(110)=(2109)/(110)`
or `" "AP=sqrt((2109)/(110))`