Partial derivative with respect to x^2
10 ビュー (過去 30 日間)
古いコメントを表示
Suppose I have a function f
f = (x^5*y^3+ z^2*x^2+y*x) / (x^3*y+x*y)
how do I take derivative of this function with respect to x^2.
I have used diff(f, x^2) but it is returning an error.
syms x y z
f= (x^5*y^3+ z^2*x^2+y*x) / (x^3*y+x*y)
diff(f,x^2)
0 件のコメント
回答 (3 件)
David Goodmanson
2022 年 11 月 18 日
編集済み: David Goodmanson
2022 年 11 月 18 日
Hi Yadavindu,
df/d(x^2) = (df/dx) / (d(x^2)/dx) = (df/dx) / (2*x)
which you can code up without the issue you are seeing.
5 件のコメント
David Goodmanson
2022 年 11 月 18 日
yes, although you could write it in one line and toss in a simplify:
syms x y z
f= (x^5*y^3+ z^2*x^2+y*x) / (x^3*y+x*y);
f1 = simplify(diff(f,x)/(2*x))
f1 = (2*x^5*y^3 + 4*x^3*y^3 - x^2*z^2 - 2*x*y + z^2)/(2*x*y*(x^2 + 1)^2)
KSSV
2022 年 11 月 18 日
syms x y z
f= (x^5*y^3+ z^2*x^2+y*x) / (x^3*y+x*y)
dfdx = diff(f,x)
dfdx2 = diff(dfdx,x)
参考
カテゴリ
Help Center および File Exchange で Particle & Nuclear Physics についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!