Pardon if I didn't ask the question correctly. Still trying to figure out the language. I have the following expression: $$energy=\frac{1}{2}R_s^{'}[t]^2==\frac{4}{3}G\pi\rho R_s[t]^2$$
energy = (1/2)*Derivative[1][Subscript[R, s]][t]^2 == (4/3)*G*
Pi*\[Rho]*Subscript[R, s][t]^2
I have the following identity: $$R_s[t]==a[t]r_s$$ When I make this substitution: $$energy/.R_s[t]\rightarrow a[t]r_s$$
energy /. Subscript[R, s][t] -> a[t]*Subscript[r, s]
I get this result:
$$\frac{1}{2}R_s^{'}[t]^2 == \frac{4}{3}G\pi\rho R_s[t]^2$$
(1/2)Derivative[1][Subscript[R, s]][t]^2 == (4/3)GPi[Rho]a[t]^2 Subscript[r, s]^2
What do I need to do for the derivative $R_s^{'}[t]^2$ to understand the substitution. I was expecting the result to be:
$$\frac{1}{2}r_s a'[t]^2 == \frac{4}{3}G\pi\rho (r_s a[t])^2$$
EDIT: Accessing external code is a bad idea and should be avoided at all costs. It's just one more thing that can go wrong when sharing code. I'm looking for a solution that solves this problem with the native Mathematica instructions.