I'm trying to learn how to do vector calculus in Mathematica, just seem to be missing some points along the learning curve.

With assumptions

$Assumptions = {
  (r[t] | r'[t] | r''[t]) \[Element] Vectors[{n}, Reals],
  n >= 2}

I first use sigma[r[t]]==0 to define a surface, I then want to calculate the first and second time derivatives of this(which should both be equal to zero, but I need the algebraic equations for what I'm doing). Evaluating

D[sigma[r[t]], {t}]
D[sigma[r[t]], {t, 2}]

I should get(copy/pasting the following into mathematica should give the correct symbols)

r'[t] . Gradient[sigma[r[t]]]
r''[t] . Gradient[sigma[r[t]]] + (r'[t])^2 . (\[Del]*Gradient[sigma[r[t]]])

where * is the Hadamard product. But I'm instead getting

Derivative[1][r][t] Derivative[1][sigma][r[t]]
Derivative[1][sigma][r[t]] (r^\[Prime]\[Prime])[t] + 
 Derivative[1][r][t]^2 (sigma^\[Prime]\[Prime])[r[t]]

What should I be doing differently to get my equations in the correct form? This is very close, but the lack of dot products doesn't allow calculations to proceed as expected.

  • $\begingroup$ Mathematica can't do this kind of vector calculus out of the box in a component-free way. You need to break things up into components like D[sigma[{rx[t], ry[t]}], t] $\endgroup$
    – flinty
    Commented Feb 3 at 11:19


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.