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

조회 수: 2 (최근 30일)
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 CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by