If $f(x,y,z)=(r \times A)\cdot (r\times B)$, where $r=(x,y,z)$ and $A$ and $B$ are constant vectors, show that $\nabla f(x,y,z)=B\times (r\times A)+A\times (r\times B)$.
I'm a bit lost on this problem. I tried using cross product equalities to solve it, but I'm not getting a clean answer. I'm thinking that there's a simple way to solve it. I would greatly appreciate any solutions, suggestions, or hints.
We can use $(u\times v)\cdot w=u\cdot(v\times w)$ to prove this.
First, let's distinguish between the two $r$ vectors and write the expression $$ g(u,v)=(u\times A)\cdot(v\times B) =u\cdot(A\times(v\times B)) =v\cdot(B\times(u\times A)). $$ This makes $f(r)=g(r,r)$ where $r=(x,y,z)$, and differentiating in $r$ is the same as differentiating $g(u,v)$ in $u$ and in $v$ separately and inserting the value $r$ for both: $$ \nabla_r f(r)=\nabla_r(g(r,r)) =\left(\nabla_ug(u,v)+\nabla_v g(u,v)\right)|_{u=v=r}. $$ However, using the first expressions, we get $$ \nabla_u g(u,v)=A\times(v\times B),\quad \nabla_v g(u,v)=B\times(u\times A), $$ and so $$ \nabla_r f(r)=A\times(r\times B)+B\times(r\times A). $$