# Chain rule, rescaling ode

I have $x(t)$ and $t$, to rescale and ODE, I need to perform a change of variable $x = \alpha x_s$ and $t = \beta t_s$

I was told that the derivative $\frac{dx}{dt} = \frac{dx}{dx_s}\frac{dx_s}{dt_s}\frac{dt_s}{dt}$ which then equals $\frac{\alpha}{\beta}\frac{dx_s}{dt_s}$ due to chain rule But I'm having trouble understanding how chain rule works when $t$ is also a function of something else.

I'm also trying to find a expression for $\frac{d^2x}{dt^2}$

If t is a function of something else we need to consider what we are differentiating with respect to. That is, of course the derivative of $t$ with respect to itself ($dt/dt$) is one. But now, look at $t=\beta t_s$. We treat $t$ as a function of $t_s$, so $\frac{dt}{dt_s}=\beta\frac{dt_s}{dt_s} =\beta$. Next, look at $x=\alpha x_s$. One thing to note, that is when we do this change in variable, we are actually saying $x(t)=\alpha x_s(t_s)$ where $t=\beta t_s$. So $\frac{dx}{dt}=\frac{d}{dt}[\alpha x_s(t_s)]=\alpha\frac{d}{dt}x_s(t_s)$. Now, we need to look at $\frac{d}{dt}x_s(t_s)$. This is the main part of chain rule. $x_s$ is a function of $t_s$, so $\frac{d}{dt}x_s$ is kind of off. Chain rule tells us that if $y=f(u)$ and $u=g(x)$ then $\frac{df}{dx}=\frac{df}{du}\frac{du}{dx}$. So, in our case, $\frac{d}{dt}x_s=\frac{dx_s}{dt_s}\frac{dt_s}{dt}$. And $\frac{dt_s}{dt}=1/\beta$. Which putting all together gives the result. Now we have that $\frac{dx}{dt}=\frac{\alpha}{\beta}\frac{dx_s}{dt_s}.$ For the 2nd derivative, its similar. We want to find $\frac{d}{dt}(\frac{\alpha}{\beta}\frac{dx_s}{dt_s})$, but $\frac{\alpha}{\beta}\frac{dx_s}{dt_s}$ is now the function that depends on $t_s$.