Vector-valued function composition

25 Views Asked by At

I was going through the blog article at Matrix Calculus. Under the section Vector chain rule they did some function composition thing to demonstrate the chain rule. The example that they took is as follows

$y = f(x)$ where $f = \begin{bmatrix} \ln(x^2) \\\ \sin(3x) \end{bmatrix}$.

let, $g = \begin{bmatrix} x^2 \\\ 3x \end{bmatrix}$. Then, $f(g(x)) = \begin{bmatrix} \ln(g) \\\ \sin(g) \end{bmatrix} = \begin{bmatrix} \ln(x^2) \\\ \sin(3x) \end{bmatrix}$

After this, they calculate the derivative. But my main concern is $f$ is $R \to R^2$ and $g$ is also $R \to R^2$. Is function composition valid here? Because the output dimension of $g$ doesn't match that of the input dimension of $f$.

P.S.: Correct me if my logic is flawed. Thanks