# Vector derivatives of vector functions

I need to evaluate the expression

$${\partial \over \partial \mathbf a} \arctan(\mathbf{|a \times b| \over a^T b})$$

where $\mathbf {a,b} \in \mathbf R^3$ are functions of nodal positions on a chain: $\mathbf a = \mathbf {x_{i-1} - x_i}$ and $\mathbf{b=x_i - x_{i+1}}$.

This is a vector derivative of a scalar function so we expect to get a vector at the end (in fact, a force).

Making the small angle approximation we can say $\arctan \theta \approx \theta$, and then using the product rule we have

$${{{\partial \over \partial \mathbf a} (\mathbf{|a \times b|})}\over\mathbf a^T \mathbf b} + {{\partial \over \partial \mathbf a} (\mathbf a^T \mathbf b)^{-1} (|\mathbf a \times \mathbf b|)}$$

Just looking at the first term for now:

$${\partial \over \partial \mathbf a} \mathbf{| a \times b |} = {\partial \over \partial \mathbf a}((\mathbf{a \times b})^T(\mathbf{a \times b}))^{1/2}\\ ={1 \over 2 \mathbf {|a \times b|}} (({\partial \over \partial \mathbf a}(\mathbf{a \times b})^T)(\mathbf{a \times b})+ (\mathbf{a \times b})^T({\partial \over \partial \mathbf a}(\mathbf{a \times b})))$$

Now the difficulty I'm having is that presumably ${\partial \mathbf a^T \over \partial \mathbf a} = \mathbf I^{3\times3}$ which is a matrix, not a vector, and thus can't be crossed with $\mathbf b^T$, which is nonsensical. Is this correct, and if not, how do I proceed with the derivation?

-