Direction ratios of the line joining the points (3,1,4) and (7,2,12) are =<7−3,2−1,12−4> =<4,1,8> =<a1,a2,a3>(let)
And the direction ratio of given line is =<2,2,1> =<b1,b2,b3>(let)
Let Q be the angle between the lines,
then cosθ=a12+a22+a32b12+b22+b32a1b1+a2b2+a3b3 ⇒cosθ=16+1+644+4+1(4)(2)+(1)(2)+(8)(1) ⇒cosθ=81918=9×318=32 ⇒θ=cos−1(32)