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)?
 A: 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.]
A: So it's true that the correct answer is that if we want to differentiate f(x) with respect to another g(x) that we take $$\frac{f'(x)}{g'(x)}$$, but I think just calling this chain rule cancellation is not exactly correct (though it is both intuitive and also gives the right answer... lol).
To formalize things, let's say we have (1) $$f(t) = h(t,g(t))$$, which for simplicity in applying the multivariate chain rule we can write as $$f(t) = h(x(t), y(t))$$
So then (2) $$\frac{df}{dy} = \frac{dh}{dx}\frac{dx}{dy} + \frac{dh}{dy}\frac{dy}{dy}$$. We know that $$\frac{dx}{dy} = \frac{dt}{dg} = \frac{1}{\frac{dg}{dt}} = \frac{1}{g'(t)}$$, by the inverse derivative theorem, and we know $$\frac{dy}{dy} = 1$$.
So in (1) if we multiply $$\frac{dh}{dy}$$ by $$1  = \frac{g'(t)}{g'(t)}$$, we get (3) $$\frac{df}{dy} = \frac{\frac{dh}{dx}*1 + \frac{dh}{dy}\frac{dy}{dt}}{g'(t)}$$, since y=g, and then since x=t, we can write $$1 = \frac{dx}{dt}$$, which gives us
$$\frac{df}{dy} = \frac{\frac{dh}{dx}*\frac{dx}{dt} + \frac{dh}{dy}\frac{dy}{dt}}{g'(t)}$$, which is just $$\frac{f'(t)}{g'(t)}$$.
A: 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$.
