Second derivative of right cauchy-green tensor in freefem

Dear All,

I am working on 3D compressible neo-hookean solid with Freefem. I searched and got this 2D example from the forum (from Simulating neo-hookean material) and here is the code provided:
ElasticLaw2d.idp (2.9 KB)

I am trying to extend the code to 3D. I have managed to derive the first order derivative dC2 in the example code however I meet difficulty when trying to derive the second order derivative ‘ddC2’ in the example code. My hand-derivation leads to a different result. Could you maybe point me to any derivation process of the expression?

Thank you in advance!

Best wishes
Yue