Since I'm beginner in matrix algebra, please help me to find the gradient of the following function with respect to $\phi$ and $u$, both are vectors. $ Bs, Bd\ and \ E$ are matrices
$$f(s,t) = \int_{-1} ^{1} \int_{-1}^{1} {\left| [Bs][{\phi}]-[E][Bd][{u}] \right|}^2 ds\ dt\ det(J)$$
My try doesn't make any sense to me. I applied chain rule and got the following result. $$ \frac{\partial f}{\partial \phi} \ = \ 2* {[Bs][{\phi}]-[E][Bd][{u}] } * [Bs]$$