# differentiable functions and chain rule

Given $A$- a symmetric matrix size $n\times n$, And given $f,g:\mathbb{R}^n \rightarrow \mathbb{R}^n$ differentiable functions. We define function $H: \mathbb{R}^m \rightarrow \mathbb{R}$ by: $x \mapsto f(x)^t \cdot A \cdot g(x)$.

I need to define $H$ by a composition of differentiable functions, and write the formula of $D_H$.

I know that it is related to the chain rule but I really have no idea where should I start from :-(

Thank You!

-
What have you done so far? Maybe try to write down the component functions $$H_i: \mathbb{R}\to\mathbb{R}$$ And find a pattern. Then use the chain rule for partial derivatives. –  AlexR Aug 23 '13 at 21:35

Define $F:\mathbb{R}^{n}\to\mathbb{R}^{2n}$ by $F(x)=(f(x),g(x))$ and define $G:\mathbb{R}^{2n}\to\mathbb{R}$ by $G(x,y)=x^{T}Ay$. These functions are differentiable and $H=G\circ F$.

You can check that $DG(x,y)=\begin{pmatrix} y^{T}A,x^{T}A \end{pmatrix}$.

Also $DF(x,y)=\begin{pmatrix} Df(x,y)\\ Dg(x,y)\\ \end{pmatrix}$.

So $DH(x,y)=DG(f(x),g(y))DF(x,y)=g(x)^{T}ADf(x,y)+f(x)^{T}ADg(x,y)$.

-
For the circle $\circ$ used in composition, you can use \circ –  Pedro Tamaroff Aug 24 '13 at 0:51
I was wondering how to get that symbol. Thank you for sharing Peter. –  user71352 Aug 24 '13 at 1:08
thank you very much!! but I don't understand why DG(x,y) is equal to what you wrote, czn you please explain again –  Yuina Kamimura Aug 24 '13 at 8:19
First notice that $x^{T}Ay=y^{T}Ax$ since $A$ is symmetric. Denote the columns of $A$ by $A_{i}$. Now notice that $x^{T}Ay=\begin{pmatrix}x^{T}A_{1}&x^{T}A_{2}&...&x^{T}A_{n}\\ \end{pmatrix} \begin{pmatrix}y_{1}\\ y_{2}\\ ...\\ y_{n}\\ \end{pmatrix}=\sum_{j=1}^{n}(x^{T}A_{j})y_{j}$. Now by taking partials with respect to $y_{i}$ for $i=1,...,n$ we get that the derivative matrix of $G$ in $y$ is $x^{T}A$. Interchaning $x$ and $y$, since $A$ is symmetric, gives you the other portion of the derivative. If you are still having trouble understanding I am more than happy to help. –  user71352 Aug 25 '13 at 6:08
thank you!!! it's clear now! –  Yuina Kamimura Aug 25 '13 at 6:11