I'm currently trying to solve some problems using symbolic vectors and matrices of arbitrary size. However, I have some problems with understanding and verifying the results:
I defined the vectors as mentioned here
$Assumptions = { Element[x, Matrices[{m, 1}, Reals]],
Element[a, Matrices[{m, 1}, Reals]] };
Now I'm trying to compute the gradient (m x 1 matrix) and hessian (m x m matrix) of the function f
f[x_, a_] := Dot[a, x]^2
using
In[144]:= D[f[x, a], x]
Out[144]= 2 a.1 a.x
In[143]:= D[f[x, a], x, Transpose[x]]
Out[143]= 0
What does a.1 mean? is it just a or more like sum[a] ? And why does the second term for the hessian just give 0? Shouldn't it be something like 2*a*Transpose[a] ?
m), or use packages that can do this. I would look at NCAlgebra and see if it has support for derivatives. http://math.ucsd.edu/~ncalg/DOWNLOAD2010/DOCUMENTATION/html/NCBIGDOCch4.html – Szabolcs Jan 11 '17 at 10:26