using SymPy
using PyCall
sp = pyimport("sympy")
t1 = sp.Function("theta_1")(t)
f = t1^2 +t1
df = sp.diff(f,t)
# so df = 2*t1*(d(t1)/d(t))+ (d(t1)/d(t))
# if substitution done of t1 value that is t1 = 2
s = df.subs([(t1,2)])
# the s is s = 2*2*(d(2)/d(t))+ (d(2)/d(t))
# but i need s =2*2*(d(t1)/d(t))+ (d(t1)/d(t))

so i need that sympy will treat two different things t1 and d(t1)/dt
thanks…

Thanks, but this not a stable method, I also deal this problem like that. but if i have 10 variable with second order differential equation. i have to write substitute things every time. is there any method or library or python sympy method for that?
thanks…