Let $n \geq 1$. Calculate the differential of the function G:
$$G: M_n( \mathbb{R}) \times M_n( \mathbb{R}) \rightarrow M_n( \mathbb{R})$$ $$(A,B)\rightarrow A^tBA$$
My first thought was to add small matrix variations $H$ and $K$ to $A$ and $B$ and then try to write as in the definition: $$D_{(A,B)}G=A^tBA + Lin(H,K)+o(||(H,K)||)$$
But then I end up with a long string of terms in $H,K$ and I can't determine which are the ones that fall into the Landau $o(||(H,K)||)$ and which are part of the linear expression.
So, could anyone explain to me where "to draw the line"?
The matrix $( D_{(A,B)} ) G((H,K)) $ is the directional derivative of $D$ at $(A,B)$ in the directions $(H,K)$. That is,
$$ ( D_{(A,B)} )G(H,K) = \frac{d}{ds} G(A + sH, B + sK)|_{s = 0}. $$
Write $G(A + sH, B + sK)$ explicitly, ignoring terms of order $s^2$ or $s^3$ as they will drop when differentiating and then differentiate and plug in $s = 0$.