# differentiate with respect to a function

Let's say I have this function $f(x)=x$. I want to differentiate with respect to $x^2$. So I want to calculate $\large\frac{df(x)}{dx^2}$. In general, how can I calculate the derivative of a function $f(x)$ with respect to a function $g(x)$, so $\large\frac{df(x)}{dg(x)}$?

(I dont know whether this is a good notation)?

-
Could you please define $\frac{df}{dx^2}$? – Siminore Jan 31 '13 at 14:58
@Siminore I want to differentiate with respect to $x^2$, but I dont know if thats the good notation. – Badshah Jan 31 '13 at 15:01

You can think about it in terms of "cancellation":

$$\frac{df(x)}{d (x^2)} = \frac{df(x)/dx}{d(x^2)/dx} = \frac{1}{2 x} \frac{df(x)}{dx}$$

More formally, let $y=x^2$, then consider $x=\sqrt{y}$ and differentiate $\,df(\sqrt{y})/dy$.

-
@rlgordanma if $y=x^2$ then $x=\sqrt{y}$ or $x=-\sqrt{y}$. So how should I interpret this negative one? – Badshah Jan 31 '13 at 14:49
@Badshah: interesting question. I guess it depends on the domain of $f$. – Ron Gordon Jan 31 '13 at 14:54
When does this trick with operating on dx (multipling/dividing by it) works? Does it always valid or are there some invalid cases? – Trismegistos Jan 31 '13 at 14:55
@Trismegistos: Another good question. You'd think that this trick which is just a play on formalism would break down at some point. But I have yet to see where it does - at least where the derivative is defined. It all holds together because the derivative is the limit of a fraction. – Ron Gordon Jan 31 '13 at 14:58

As mostly a follow-up to rlgordonma's answer, here's a way to explain the method that perhaps fits a bit closer to things you're probably used to seeing.

Let $u = x^2$ and use the chain rule as follows for the function $f(x)$:

$$\frac{df}{dx} \; = \; \frac{df}{du} \frac{du}{dx} \; = \; \frac{df}{du} \cdot 2x$$

$$\implies \;\; \frac{df}{du} \; = \; \frac{1}{2x} \cdot \frac{df}{dx}$$

For what it's worth, I've seen problems stated in exactly the way Badshah stated his question in old calculus texts, such as:

George Abbott Osborne, Differential and Integral Calculus (1908). [See page 60 for several neat examples.]

-