# Change of variable in function

Suppose I have a function $$h(\theta)$$ measuring the height of a piston, with $$\theta = \omega t$$. I would like to know the vertical acceleration of this piston as $$\omega$$ changes at the point $$\theta = \theta_0$$. How would I differentiate $$h$$ to do this?

• I have tried both partial derivation and the total derivative, I get meaningless results each time. E.g. $\frac{\partial h}{\partial \omega}(\omega t) = t \frac{\partial h}{\partial \theta}(\omega t)$. To me, this seems incorrect as you would expect the velocity to increase with $\omega$. Would you consider showing me what you mean? – Mikkel Rev Apr 7 '19 at 10:15

If $$\omega$$ is not constant, I don't really see a reason to write $$\theta = \omega t$$. You can do it, I just don't see why it would be convenient. It's probably better to just think of $$\theta(t)$$.

So, I'm assuming that you have actual expressions for the functions $$h(\theta)$$ and $$\theta(t)$$ somewhere, even if you didn't put them in your question. If I misunderstood, please correct me.

We will use the chain rule:

$$\frac{d}{dx} f(g(x)) = \frac{df}{dg}\Big(g(x)\Big) \, \frac{dg}{dx}(x)$$

More specifically:

$$\frac{d}{dt}f(\theta(t)) = \frac{df}{d\theta}\Big( \theta(t) \Big) \, \frac{d\theta}{dt}(t)$$

You are interested in the vertical acceleration, so that is the second derivative of $$h$$ with respect to time:

$$\frac{d^2}{dt^2} h(\theta(t)) = \frac{d}{dt} \Bigg( \frac{dh}{d\theta} \bigg( \theta(t) \bigg) \, \frac{d\theta}{dt}(t) \Bigg) = \frac{d}{dt} \Bigg( \frac{dh}{d\theta} \bigg( \theta(t) \bigg) \Bigg) \, \frac{d\theta}{dt}(t) + \frac{dh}{d\theta} \bigg( \theta(t) \bigg) \, \frac{d^2\theta}{dt^2}(t) = \frac{d^2h}{d\theta^2} \bigg( \theta(t) \bigg) \bigg( \frac{d\theta}{dt} (t) \bigg)^2 + \frac{dh}{d\theta} \bigg( \theta(t) \bigg) \, \frac{d^2\theta}{dt^2}(t)$$

In your case, where you are interested in the acceleration at a specific angle $$\theta = \theta_0$$, you'll need to work out the values of all elements in the expression above at the moment that $$\theta = \theta_0$$ and use those to get your result.