Show that anecessary and sufficient condition for $x_{p}$ to be tangent to $S^{n}$ at $p$ 
Please help me! How do I solve this problem? I didnt produce any idea because I didnt understand this topic properly. Thus, please can you explain the solution explicitly? Thank you for help:) 
 A: *

*Necessary condition means:

$X_p \in T_p S^n$ implies $\sum a^i p^i = 0$

If $X_p \in T_p S^n$, then $X_p(f)$ is the directional derivative along the tangential direction of a smooth function $f$ at $p$. Now if $X_p = \sum a^i \partial /\partial x^i|_p$ , this representation requires $a = (a^1,\ldots, a^{n+1})$ is a tangent vector to the sphere at point $p$. Being tangent means inner product with normal vector equaling 0. The unit normal vector to the sphere at point $p$ is $\frac{\nabla \varphi}{\|\nabla \varphi\|}|_{x=p} $, where $\varphi = \sum(x^i)^2$ is the equation for $S^n$. Therefore the normal at $p$ is $n = (p^1,\ldots,p^n)$, and the inner product with $a$ at $p$ is $\sum a^i p^i = 0$.

*Sufficient condition means:

$\sum a^i p^i = 0$ implies $X_p \in T_p S^n$ 

This direction is trivial because the relation $\sum a^i p^i = 0$ says $a\cdot n = 0$, which is to say $a$ is tangent vector to the sphere at $p = (p^1,\ldots,p^n)$. Hence $X_p = \sum a^i \partial /\partial x^i|_p$ is taking direction derivative of a smooth function along any tangential direction, so $X_p \in T_p S^n$.
