getting curl from gradient According to my book, the following is valid
$$
\frac{1}{2}\nabla v^2-v\cdot \nabla v = v\times \nabla \times v 
$$
where $v$ is a vector. No assumptions are made on $v$ at all.
IMO this should be 0. Where does the curl enter in all of this?
 A: Curl comes in because of the following identity:
$\epsilon_{ijk}\epsilon_{i\alpha\beta} = \delta_{j\alpha}\delta_{k\beta}-\delta_{j\beta}\delta_{k\alpha}$
Where the epsilons represent the levi-civita symbol and the deltas are Kronecker deltas. Can you use this to transform the right hand side into the left hand side?
Edit: Some preliminaries for manipulating vectors. Throughout I use summation convention, i.e. if a subscript appears twice in the same expression it means you should sum over it. $\{e_i\}$ refers to the standard basis.
Given vectors $v_ie_i$ and $w_ie_i$, their dot product is $v_iw_i$ and the $i^{th}$ co-ordinate of their cross product is $\epsilon_{ijk}v_jw_k$. The corresponding formulae for div, grad, curl, etc, are obtained by treating $\nabla$ like a vector, e.g. curl can be thought of as the cross product of $\nabla$ with a vector.
Taking the right hand side of the identity, we get that the $i^{th}$ co-ordinate of $v\times(\nabla\times v)$ is:
$$v\times(\nabla\times v)_i= \epsilon_{ijk}v_j(\epsilon_{k\alpha \beta}\frac{\partial}{x_\alpha}v_\beta) = (\delta_{i\alpha}\delta_{j\beta}-\delta_{i\beta}\delta_{j\alpha})v_j\frac{\partial v_\beta}{x_\alpha}=v_j\frac{\partial v_j}{x_i}-v_j\frac{\partial v_i}{x_j}$$
Which is equal to $\frac{1}{2}\nabla v^2-v\cdot \nabla v$.
In particular, your comment is incorrect, since $\partial_i v_jv_j = (\partial_iv_j)v_j+v_j(\partial_iv_j) = 2v_j\partial_iv_j$, by chain rule.
A: Your formula
$$\frac{1}{2}\nabla v^2-v\cdot \nabla v = v\times \nabla \times v$$
is a special case of the following,
as copied literally from a Wikipedia page :
$$
\nabla(\vec{u}\cdot\vec{v})=
(\vec{u}\cdot\nabla)\vec{v}+(\vec{v}\cdot\nabla)\vec{u}+
\vec{u}\times(\nabla\times\vec{v})+\vec{v}\times(\nabla\times\vec{u})
$$
Step by step for your formula:
$$
\frac{1}{2} \nabla (\vec{v} \cdot \vec{v} )= \frac{1}{2} \left[ \begin{array}{c}
\frac{\partial}{\partial x} \\ \frac{\partial}{\partial y} \\ \frac{\partial}{\partial z} \end{array} \right]
\left(v_x^2 + v_y^2 + v_z^2 \right) = \left[ \begin{array}{c}
v_x \frac{\partial v_x}{\partial x} +
v_y \frac{\partial v_y}{\partial x} +
v_z \frac{\partial v_z}{\partial x} \\
v_x \frac{\partial v_x}{\partial y} +
v_y \frac{\partial v_y}{\partial y} +
v_z \frac{\partial v_z}{\partial y} \\
v_x \frac{\partial v_x}{\partial z} +
v_y \frac{\partial v_y}{\partial z} +
v_z \frac{\partial v_z}{\partial z} \end{array} \right]
$$
$$
(\vec{v}\cdot\nabla)\vec{v} = 
\left(v_x \frac{\partial}{\partial x} + v_y \frac{\partial}{\partial y} + v_z \frac{\partial}{\partial z} \right)
\left[ \begin{array}{c} v_x \\ v_y \\ v_z \end{array} \right] = 
\left[ \begin{array}{c}
v_x \frac{\partial v_x}{\partial x} + v_y \frac{\partial v_x}{\partial y} + v_z \frac{\partial v_x}{\partial z} \\
v_x \frac{\partial v_y}{\partial x} + v_y \frac{\partial v_y}{\partial y} + v_z \frac{\partial v_y}{\partial z} \\
v_x \frac{\partial v_z}{\partial x} + v_y \frac{\partial v_z}{\partial y} + v_z \frac{\partial v_z}{\partial z}
\end{array} \right]
$$
Left hand side:
$$
\frac{1}{2} \nabla (\vec{v} \cdot \vec{v} ) -
(\vec{v}\cdot\nabla)\vec{v} = 
\left[ \begin{array}{c}
v_y \frac{\partial v_y}{\partial x} + v_z \frac{\partial v_z}{\partial x}
- v_y \frac{\partial v_x}{\partial y} - v_z \frac{\partial v_x}{\partial z} \\
v_x \frac{\partial v_x}{\partial y} + v_z \frac{\partial v_z}{\partial y}
- v_x \frac{\partial v_y}{\partial x} - v_z \frac{\partial v_y}{\partial z} \\
v_x \frac{\partial v_x}{\partial z} + v_y \frac{\partial v_y}{\partial z}
- v_x \frac{\partial v_z}{\partial x} - v_y \frac{\partial v_z}{\partial y}
\end{array} \right]
$$
Definition of cross product:
$$
\vec{a}\times\vec{b} = \left[ \begin{array}{c}
a_y b_z - a_z b_y \\ a_z b_x - a_x b_z \\ a_x b_y - a_y b_x
\end{array} \right]
$$
Right hand side:
$$
\vec{v}\times(\nabla\times\vec{v}) = \vec{v} \times \left[ \begin{array}{c}
\frac{\partial v_z}{\partial y} - \frac{\partial v_y}{\partial z} \\
\frac{\partial v_x}{\partial z} - \frac{\partial v_z}{\partial x} \\
\frac{\partial v_y}{\partial x} - \frac{\partial v_x}{\partial y}
\end{array} \right] =
\left[ \begin{array}{c}
  v_y \frac{\partial v_y}{\partial x} - v_y \frac{\partial v_x}{\partial y}
- v_z \frac{\partial v_x}{\partial z} + v_z \frac{\partial v_z}{\partial x} \\
  v_z \frac{\partial v_z}{\partial y} - v_z \frac{\partial v_y}{\partial z}
- v_x \frac{\partial v_y}{\partial x} + v_x \frac{\partial v_x}{\partial y} \\
  v_x \frac{\partial v_x}{\partial z} - v_x \frac{\partial v_z}{\partial x}
- v_y \frac{\partial v_z}{\partial y} + v_y \frac{\partial v_y}{\partial z}
\end{array} \right]
$$
You can check out (any typos?) that left hand side and right hand side are equal.
Its' a tedious job though, even more if you try to do it for the Wikipedia formula.
