Because my actual functions are very complex, I would like to calculate the derivative of nested functions first and then substitute the functions afterwards.
A minimal example looks like this:
Q = G(h)
Q = ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1695151/image.png)
dGdt = diff(Q,t)
dGdt =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1695156/image.png)
dGdh = diff(G,h)
dGdh(t) = ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1695161/image.png)
How is it possible, to insert the derivative of G with respect to h as the partial derivative?
I tried this, but it is not working:
I really appreciate any feedback!