Question: How can I substitute an alias by a given expression?

In the code above expression #1 contains the term D(Phi)(X): how can I replace the "abstract" function Phi by a "specific" one  phi = k*X(t) ?

restart:
alias(X = X(t)):
alias(Phi=Phi(X(t))):
kin := 1/2*M*diff(X, t)^2 + 1/2*m*diff(Phi, t)^2;  #1

# attempt to replace Phi by phi=k*X(t))
alias(phi=k*X(t)):
eval(kin, Phi=phi);                                #2 ... I expected phi would replace Phi

The attached file  How_to_eval.mw contains a more detailed explanation and a more general situation.

Thanks in advance

Please Wait...