Confusion related to smoothness of a function I just found this thing that $\operatorname{trace}(AB)$ where $A$ and $B$ are two matrices, it is a smooth function.  I didn't understand how it is a smooth function.  Any suggestions?
 A: A smooth function has derivatives of all orders.  In this case, trace$(AB)$ is a product and sum of entries.  The partial derivative with respect to any of the entries is again a product and sum of entries, hence well-defined.
Example as requested: 
Let $A=[x], B=[y]$.  Then $AB=[xy]$ and $tr(AB)=xy$.  $\frac{\partial}{\partial x} tr(AB)=y$, and $\frac{\partial}{\partial y} tr(AB)=x$.  Further partial derivatives will be constants, then zero, so all partial derivatives exist of all orders.
A: You can think of an $m \times n$ matrix $B$ as an element of $\mathbb{R}^{m \times n}$.  Now, say $A$ is an $n \times m$ matrix, so that the product $AB \in \mathbb{R}^{n \times n}.$  Now, the function that you're interested in is the composition
$$
\mathbb{R}^{n \times m} \times \mathbb{R}^{m \times n} \longrightarrow \mathbb{R}^{n \times n} \overset{\operatorname{trace}}{\longrightarrow} \mathbb{R}.
$$
Write the formula for this map and you ought to be able to see that it's a smooth function.  (It belongs to a certain class of functions that you likely already know are all smooth.)
