Tangent plane to sphere Let $S$ be the sphere
$$ x^2 + y^2 + z^2 = 14$$
I need help finding:
A. Tangent plane to $S$ at the point $P(1, 2, 3)$.
B. Distance from $Q(3, 2, 1)$ to the above tangent plane.
 A: 1) $f(x,y,z)=x^2+y^2+z^2-14$
$$\frac{\partial f}{\partial x} (x,y,z)=2x,\frac{\partial f}{\partial y} (x,y,z)=2y,\frac{\partial f}{\partial z} (x,y,z)=2z.$$
The vector
$$\overrightarrow{n}=\overrightarrow{grad} f (P)= (2,4,6)$$
is a normal vector for the plane.
A point $M(x,y,z)$ is in the plane if and only if :
$$\overrightarrow{PM}. \overrightarrow{n} = 0$$ thus $$2(x-1)+4(y-2)+6(z-3)=0$$ thus: $$\Pi_P: \quad \quad 2x+4y+6z-28=0$$
2) $$d(Q,\Pi_P)=\frac{|2x_Q+4y_Q+6z_Q-28|}{\sqrt{2^2+4^2+6^2}}= \frac{2\sqrt{14}}{7}$$
A: Or, we can use a bit of geometry.
Using the fact that the normal of the tangent plane to the given sphere will pass through it's centre, $(0,0,0).$ 
We get the normal vector of the plane as:
$\hat i+2\hat j+3\hat k$.  (Vector joining point of tangency to centre of sphere).
Then equation of plane can be written as:
$x(1)+y(2)+z(3)=p$. Where '$p$' is some scalar.
As the plane passes through $(1,2,3)$;
We get $p=14$,
Hence the tangent plane:-
$$x+2y+3z-14=0$$
For finding the distance, simply use the distance formula!
A: First, find the gradient $\nabla f$. Then the equation of the tangent plane to the surface is
$${f_x}(1,2,3) \cdot (x - 1) + {f_y}(1,2,3) \cdot (y - 2) + {f_z}(1,2,3) \cdot (z - 3) = 0$$
where $ \cdot $ denotes the dot product. You can then find the distance (using the Euclidean norm) from $Q$ to any point on the plane.
