given the function f(x)=X^3 - 6X^2+9X. Find the first derivative of the function of f(x)

2 ビュー (過去 30 日間)
Emmerenciana
Emmerenciana 2025 年 5 月 2 日
回答済み: Star Strider 2025 年 5 月 2 日
given the function f(x)=X^3 - 6X^2+9X. Find the first derivative of the function of f(x)

回答 (2 件)

Sam Chak
Sam Chak 2025 年 5 月 2 日
You can use the first derivative formula from Larson/Edwards Calculus of a Single Variable textbook.
For more info, please look up for examples in this link:
%% declare symbolic variable
syms x
%% function
a = 3;
b = 2;
c = 1;
y = x^a + 6*x^b - 9*x^c
y = 
%% 1st derivative formula
dy = a*x^(a-1) + 6*b*x^(b-1) - 9*c*x^(c-1)
dy = 
fplot([y, dy], [-8, 4]), grid on, xlabel x, ylabel f(x)

Star Strider
Star Strider 2025 年 5 月 2 日
Use the polyder function —
f = @(x) x.^3 - 6*x.^2 + 9*x; % Anonymouus Function
p = [1 6 3 0] % Coefficient Vector
p = 1×4
1 6 3 0
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
dfdxp = polyder(p) % Polynomial Derivative
dfdxp = 1×3
3 12 3
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
x = -10:0.1:10;
figure
plot(x, polyval(p,x), DisplayName='f(x)')
hold on
plot(x, polyval(dfdxp,x), DisplayName='f''(x)')
hold off
grid
legend(Location='best')
You can also use the gradient funciton or the Symbolic Math Toolbox diff function for the derivative.
.

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by