# 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.

-

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}$$
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$ is the dot product. You can then find the distance (using Euclidean norm) from $Q$ to any point on the plane.