Given $A=\left ( 1, 1, 1 \right )$ be vector in $\mathbb{R}^{3}$. Let $L$ be a subspace of $\mathbb{R}^{3}$ spanned by the vectors $\left ( 1, 0, -1 \right )$ and $\left ( 3, 5, x \right )$. Find the values of x for which the distance between $A$ and $L$ is maximal.
The approach for the above formulation was calculating the proj$_{L}$$A$ i.e. the orthogonal projection of $A$ on $L$ subspace. Then the distance $d=\left \| A-proj_{L}A \right \|$. The calculations are getting tedious in this process as in the first step for getting the projection matrix, the basis matrix is formed for the given spanned vectors which is then used for further calculations. I am getting x=-8 and the square of distance as 3.
Can you please let me know if the above approach followed for the formulation is correct?
Your approach is correct, but I'll show you another way:
Let's reason about the problem geometrically. You have a fixed vector and a plane that can move, and you want to tilt the plane in such a way that the tip of the vector is as far away from the plane as possible. Maybe you can convince yourself that the optimal configuration is for the plane and the vector to be made orthogonal to each other. (The shadow of the vector on the plane will be as short as possible, making the distance between them as large as possible).
Now, can we make $A$ perpendicular to $L$? It suffice to make $A$ perpendicular to both of the basis vectors $v_1 := (1, 0, -1)$ and $v_2 := (3, 5, x)$. Luckily for us, we can observe that $v_1$ and $A$ are already orthogonal. But what about $A$ and $v_2$? It suffice to impose that their dot product is zero:
$$A \cdot v_2 = (1, 1, 1) \cdot (3, 5, x) = 8 + x = 0,$$ and $x = -8$ appears! Now that you know the optimal position of the plane, your procedure can get the orthogonal projection and desired distance.