# Derivative of a function with respect to another function [duplicate]

This question already has an answer here:

I have a question, I would be grateful if someonr helped me.

Suppose I have these functions:

te[x_] := x^2
te1[x_] := te[x] x


How can I numericaliy differentiate te1 with respect to te — something like

D[te1[x], te[x]]


and

ND[te1[x], te[x]]


I know there are much easier ways to obtain these two, but I want to understand the logic of these calculations.

## marked as duplicate by Carl Woll, m_goldberg, Coolwater, bbgodfrey, Henrik SchumacherDec 27 '17 at 7:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• @ Carl Woll for numerical too ND?? – kmsin Dec 25 '17 at 20:32
• You can use te1'[1.] / te'[1.] for a numerical derivative at x=1.. Note that you need to use machine numbers instead of integers. – Carl Woll Dec 25 '17 at 22:54
• @ Carl Woll Thanks But I need some thing with ND – kmsin Dec 25 '17 at 23:26
• Is ND actually a function? It doesn't seem like it. – numbermaniac Dec 26 '17 at 0:01