Hi I simplified my question as I was asked,:
var('xt,m,k,F,omega,E',domain='real')
phi_x(t)=function(r'\phi_x')(t)
dphi_x=diff(phi_x,t,1)
p_x=function('p_x')(t)
#p_x=m*diff(phi_x,t,1)
eqTest=E == 1/2*m*omega^2*phi_x(t)^2 + 1/2*m*dphi_x^2
eqTest_wished=E(t) == 1/2*m*omega^2*phi_x(t)^2 + 1/2*p_x^2/m
print('is it possible to transform equation eqTest into equation eqTest_wished with Sagemath ?')
show('eqTest_wished : \t', eqTest_wished)
show("###############################################################")
show('eqTest : \t \t \t', eqTest)
eqTest_Modified=eqTest.substitute_function(dphi_x,p_x/m)
show('attempt to Modified eqTest : \t \t ', eqTest_Modified)
#eqTest.substitute_function?
how to transform equation eqTest into equation eqTest_wished using SageMath ?