Whole derivation of two variable differential function
Show older comments

I am struggleing with the whole derivation of differential equation.
Can y'all give me an advice how to implement that into a code?
I've tried using diff() but diff(f(x,y), y) gives 1 not y'.
Answers (2)
James Tursa
on 22 Jun 2022
0 votes
Please show the code you are using.
y' means derivative of y with respect to x, not derivative of y with respect to y. You should be taking derivative of f(x,y) with respect to x, not y.
2 Comments
Minjae Cho
on 22 Jun 2022
Edited: Minjae Cho
on 22 Jun 2022
Is there any way to get a whole derivative rather than a partial derivative?
syms x y
f = y - x^3 + x + 1
dy = f
df = diff(f, x) + diff(f, y)
simplify(subs(df, diff(y,x), dy))
You may notice that this is not what you wanted... but it satisfies at least one plausible definition of what a "whole derivative" means.
I recommend that you re-examine that derivative provided. I think you will find that it makes no sense unless it is the derivative with respect to x with the assumption that y is a function of x
The equations are being careless about which variables depend on which variables, and on which variable the differentiation is with respect to.
syms x y(x)
f = y - x^3 + x + 1
dy = f
df = diff(f, x)
simplify(subs(df, diff(y,x), dy))
2 Comments
Minjae Cho
on 22 Jun 2022
Edited: Minjae Cho
on 22 Jun 2022
Plug what values into y(x) ?
syms x y(x) yx
f = y - x^3 + x + 1
dy = f
df = diff(f, x)
sol = simplify(subs(subs(df(x), diff(y,x), dy), y, yx))
[X, Y] = ndgrid(linspace(-1, 1, 15));
solgrid = double(subs(sol, {x, yx}, {X, Y}));
whos
surf(X, Y, solgrid)
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!