MATLAB: How to find total derivative

derivative

i want to find total derivative in MATLAB eq== cos(x) = sin(y)*x the solution should be like this -sin(x) = x*cos(y)*dy/dx + sin(y)

Best Answer

Hey Kanav,
Check out "diff" in the Symbolic Math Toolbox. One thing to note is that for the form you want, you need to explicitly define y as a function of x.
syms x y(x)
diff(cos(x) - sin(y)*x,x)
returns
- sin(y(x)) - sin(x) - x*cos(y(x))*diff(y(x), x)
-Adam