Question: Derivation Current Value Hamiltonian. It should be as easy as 1-2-3-4

I want to be able to do the following in Maple 1) Set up the current value hamiltonian H:=u(c(t))+lambda(t)*(f(k)-c(t)-delta*k) ; 2) Take the foc with respect to c(t) which should give me u'(c(t))=lambda(t) 3) Differentiate with respect to time which should give me u''(c(t))*diff(c(t),t)=diff(lambda(t), t) 4) Divide both sides by u'(c(t))=lambda(t) should give me u''(c(t))*diff(c(t),t) / u'(c(t)) =diff(lambda(t), t) / lambda(t) I have tried to set up the hamiltonian in maple but I find it quite hard for numerous reasons: A) I cannot differentiate a function w.r.t a function i.e H:=u(c(t))+lambda(t)*(f(k)-c(t)-delta*k) ; foc_1:=diff(H,c(t))=0; Error B) Cannot isolate a function in an expression containing a function i.e > foc_1; > subs(u(c)=u(c(t)),%); > isolate(%,lambda(t)); Error C) If I use the sdiff function I still cannot isolate a function in an expression containing a function i.e ###### > restart; > sdiff := proc(expr, sym) > local t; > subs(t=sym, diff( subs(sym=t,expr), t) ); > end; ##### >H:=u(c(t))+lambda(t)*(f(k)-c(t)-delta*k) ; >foc_1:=sdiff(H,c(t))=0; >isolate(foc_1,lambda(t)); Error D) I cannot differentiate a function w.r.t a function twice i.e >diff( diff(u(c(t)),c(t)), c(t); Error
Please Wait...