I'm new in using Matlab and I'm very confused of how I would solve a derivative problem. Here is the equations and problem

1 回表示 (過去 30 日間)

採用された回答

Hiro Yoshino
Hiro Yoshino 2022 年 9 月 24 日
You are using the capabilities of Symbolic Math Toolbox and with this you can manupulate your equations symbolically.
Let's define your symbol x. Then the following equation y1 is also defined symbolically as follows:
syms x a
y1(x) = 1/((x+1)^3*(2*x-1)^3) + a
y1(x) = 
Derivative of y1 is quite straightfoward. If you want to differentiate y1 with respect to x, diff is the one:
yp1 = diff(y1)
yp1(x) = 
If you want to know the variables used in the function y1, symvar will do the work
symvar(y1)
ans = 
x

その他の回答 (1 件)

Davide Masiello
Davide Masiello 2022 年 9 月 24 日
編集済み: Davide Masiello 2022 年 9 月 24 日
I think what you have in your snapshot is already ok. You just need to save the functions in y1, y2 and y3. There are also some errors with the brackets, check your code carefully.
syms x
y1(x) = 1/((x+1)^3*(2*x-1)^3);
y2(x) = 1/(1+sqrt(1-x))^3;
y3(x) = (x^2/(4-x))^(3/2);
yp1 = diff(y1)
yp1(x) = 
yp2 = diff(y2)
yp2(x) = 
yp3 = diff(y3)
yp3(x) = 
  2 件のコメント
Davide Masiello
Davide Masiello 2022 年 9 月 24 日
My pleasure. Please consider that it is costumary to accept the answer if it helped, as a reference other users with the same or similar problems.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by