How would you go about calculating the derivative d/dx of the below function f(x)?
a and c are scalars.
$f(x)=\phi(x)^T\phi(x)$, $\phi(x)=$$\begin{bmatrix}\sin(ax_1) \\ \sin(acx_2) \\ 2x_1 \\ 2cx_2\end{bmatrix}$
My guess would be the following (i.e. treating each element in the vector as its own function to the power of two, and spreading the derivative on two columns to get a Jacobian), but that's just a wild guess, as I have never worked with equations with such structure before.
$J_f(x) = \begin{bmatrix}a \cdot cos(2ax_1) & 0\\0 & ac \cdot cos(2acx_2)\\8x_1 & 0\\0 & 8c^2x_2\end{bmatrix}$
I usually always had an x vector inside of an equation, not individual elements of the variable vector mixed in one vector... Maybe I can/should somehow rewrite the equation so that there is a variable vector in there?