1

Is it possible to get symbolic derivatives of equations with vectors as arguments without specifying every vector element explicitly.

Something like

f[A_Vector, B_Vector] := Dot[A, B]
D[f[a, b], a[[1]]]
paw
  • 5,650
  • 23
  • 31

1 Answers1

1

The vector elements just need to be specified symbolically. This can be done implicitly by specifying the dimension of the vectors.

f[a_,b_,n_]:=Dot[Table[Subscript[a, i],{i,1,n}],Table[Subscript[b, i],{i,1,n}]]
D[f[a, b, 5], Subscript[a, 1]]

Subscript[b, 1]

Which looks nicer in the notebook: enter image description here

Karsten7
  • 27,448
  • 5
  • 73
  • 134