Hi Vinayak,
I wrote a reply a few days ago, but apparently I managed to address it to Wolfgang rather than the mailing list. Oops... I know that you've made some progress since then but since maybe these details could be of some further interest I've copied it verbatim. I think that the last sentence aligns with what you've already done.
-----------------
To answer your earlier question [from 18 July] directly, I think that the feature that you're looking for is called make_symbolic_function() for scalars, or make_[vector, tensor, symmetric_tensor]_of_symbolic_functions() for higher dimension entities. These allow you to generically express symbolic functions with other functions as arguments, and differentiate correctly.
That said, I don't think that this is what you want to do. There is an example in the tests for step-44, namely tests/symengine/step-44-sd-quadrature_level_0[1,2,3].cc that exploits the relationship between det(b) and det(F) = sqrt(det(b)) = sqrt(det(C)) to compute the kinetic variables and their derivatives. I think that you'd be able to solve your problem most easily if you follow suite. Otherwise you'd really have to differentiate with respect to F, which you state as being the true parameterisation of the energy, and then push forward the Piola-Kirchoff stress tensor and its linearisation (e.g. using the functions in the namespace Physics::Transformations if any of them seem like good candidates).
-----------------
Best,
Jean-Paul