# Is this result of the derivative of the composition of two functions correct?

I have the following functions:

$$f(x,y)=xy,\; g(t)=(e^t,\cos(t))$$

And I want to calculate the derivative matrix of $$f$$ after $$g.$$

I calculate the jacobian matrix of $$f$$, which was a matrix, like

$$D_f=\begin{bmatrix} y & x \end{bmatrix}$$

then on the components of $$g$$

$$D_f(e^t,\cos(t))=\begin{bmatrix} \cos(t) & e^t \end{bmatrix}$$

then calculate the matrix of $$g$$

$$D_g(e^t,\cos(t))=\begin{bmatrix} e^t \\ -\sin(t) \end{bmatrix}$$

then to calculate the matrix of the derivatives of $$f$$ after $$g$$, I multiplied the matrices

$$D_f(e^t,\cos(t))=\begin{bmatrix} \cos(t) & e^t \end{bmatrix}$$

times

$$D_g(e^t,\cos(t))=\begin{bmatrix} e^t \\ -\sin(t) \end{bmatrix}$$

$$= \cos(t)e^t-e^t\sin(t).$$

I have no way of checking if this is correct. Is this correct?

Yes, this is correct. You can easily check this yourself. The composition is given by \begin{align} f(g(t))=f(e^{t},\cos (t))=e^{t}\cos(t). \end{align} If we differentiate this function we get \begin{align} (f(g(t))'=\frac{d}{dt}(e^t\cos(t))=e^t\cos (t)-e^t\sin(t) \end{align}