I apologize for such a poorly worded question, but I'm not quite sure how else to word it.
You're given, x and y, both symbolic variables as a function of time. y is also a function of x. You determine the time derivative of y, ydot. xdot also appears in ydot because y is a function of x, and x is a function of time. How do you then differentiate ydot with respect to xdot?
Here's my code:
syms y x(t) ty = sin(x);ydot = diff(y,t);diff(ydot,D(x)(t))
I've also tried this method:
syms y x(t) ty = sin(x);ydot = diff(y,t);syms Dxydot = subs(ydot,sym('D(x)'),Dx);diff(ydot,Dx)
But that gives me an output of:
ans(t) = 0
The answer should be cos(x(t))
Best Answer