title: How to compute the covariant derivative of a vector in Mathematica?
body: <p>I want to compute a derivative of a vector, but I'm new to mathematica (I programmed in other languages). I was advised to work with the diffgeo.m package.</p>
  <p>What I want to do is calculate</p>
  <p><a href="https://i.stack.imgur.com/fNzcB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fNzcB.png" alt="enter image description here" /></a></p>
  <p>using einstein sum and calculating Christoffel symbols manually or with some mathematica function.</p>
  <p>Basically, what I want to do is exactly what is below, but in the mathematica language:</p>
  <pre><code>d = 2 ;
  M = Manifold (d, ' M')
  
  w[:] = [r,r*sin(th)]
  
  sum(w[i].diff(i)+w[i]*sum([g.christoffel_symbols()[j,i,j] for j in M.irange()]) for i in M.irange())
  </code></pre>
  <p>Or, in a more direct way,</p>
  <pre><code>d = 2 ;
  M = Manifold (d, ' M')
  
  w[:] = [r,r*sin(th)]
  
  Dw = (nab(w)['^a_b']*delta['_a^b'])
  DW.expr()
  </code></pre>
  <p>Should I download packages other than giffgeo.m? A package for symbolic programming, for example?</p>
  <p>How can I do this account for the covariant derivative with mathematica?</p>
  <p>I appreciate any help.</p>