I am trying to use Symbolics.derivative and Linear Algebra. I am confused with how things work and I am stuck with a specific problem that I have reduced to a MWE.
using Symbolics
@variables x A[1:3,1:3]
v=[1,x,x^2]
Symbolics.derivative(A[1:3,1:3]*v,x) # This outputs [0,0,0]
Symbolics.derivative(collect(A[1:3,1:3]*v),x) # This works as I want
Symbolics.derivative(transpose(hcat(v))*A[1:3,1:3]) # This does not work and gives an error
The reason why I also want to multiply a transposed vector in front is that I want to work with quadrics.
However I can’t seem to make it work even with combinations of collect. (They also give an error.)