In the first task, the definition of a derivative is used to find the derivative of a given function, and MATLAB is used to graph the function, its derivative, and the second derivative.
Trang 11
VIETNAM NATIONAL UNIVERSITY – HO CHI MINH
Section 2.8 – Exercise 47, 48
Instructor: Phan Thành An CC03 – Semester 232
Trần Quốc Thắng 2353125
+ Problem 1: II The MATLAB commands + Cotent synthesis
Nguyễn Quốc Cường 2352150 + Problem 1: I The theory and algorithm and III The
result and conclusion
Đặng Duy Nguyên 2352821 + Problem 2: The MATLAB commands
Hồ Ngọc Quỳnh Anh 2352033 + Problem 2: I The theory and algorithm and III The
result and conclusion
Trang 2The work of a group of students from Vietnam National University - Ho Chi Minh City's Ho Chi Minh City University of Technology on the subject of calculus derivatives is presented in this report
There are two primary issues in the report In the first task, the definition of a derivative is used to find the derivative of a given function, and MATLAB is used to graph the function, its derivative, and the second derivative Finding the first and second derivatives of a different function and graphing them on a shared screen are also required for the second challenge The report contains MATLAB commands, the theory and algorithm, as well as the findings and recommendations for every problem
The purpose of this assignment is to reinforce the students' understanding of the concept of derivatives, their applications, and the use of MATLAB in graphing and analyzing mathematical functions
Trang 33
Table of Contents
PROBLEM 1: 4
I The theory and algorithm: 4
1 Finding Derivative: 5
2 Graphing and Explaning: 5
II The MATLAB commands : 6
III The result and conclusion: 8
PROBLEM 2: 9
I The theory and algorithm : 9
1 Finding Derivative: 10
2 Graphing and Explaning: 10
II The MATLAB commands: 11
III The result and conclusion 13
Trang 4PROBLEM 1: Use the definition of a derivative to find f’(x) and f”(x) Then graph f, f’, and f” on a common screen and check to see if your answers are reasonable.
f(x) = 𝟑𝒙𝟐+ 𝟐𝒙 + 𝟏
I The&theory&and&algorithm:&
We have seen that the same type of limit arises in finding the slope of a tangent line (Equation 2) or the velocity of an object (Equation 3) In fact, limits of the form
𝑙𝑖𝑚
"→$
𝑓(𝑎 + ℎ − /𝑓(𝑎) ) ℎ
arise whenever we calculate a rate of change in any of the sciences or engineering, such as a rate of reaction in chemistry or a marginal cost in economics Since this type of limit occurs so widely, it is given a special name and notation
Definition: The derivative of a function f at a number a, denoted by 𝒇%(𝒂), 𝒊𝒔
𝑓%(𝑎) = 𝑙𝑖𝑚
"→$
𝑓(𝑎 + ℎ − /𝑓(𝑎) ) ℎ
If this limit exists
If we write, then we have and approaches if and only if approaches Therefore an equivalent way of stating the definition of the derivative, as we saw in finding tangent lines, is
𝑓%(𝑎) = 𝑙𝑖𝑚"→$𝑓(𝑥) − /𝑓(𝑎)
𝑥 − /𝑎
Trang 55
1 Finding Derivative:
f(x) = 𝟑𝒙𝟐+ 𝟐𝒙 + 𝟏
We can find f’(x):
𝑓%(𝑥) = lim
"→$
𝑓(𝑥 + ℎ − 𝑓(𝑥) )
ℎ = lim"→$
[ ( 3 𝑥 + ℎ)&+ 2(𝑥 + ℎ) + 1] − (3𝑥&+ 2𝑥 + 1)
ℎ
= lim"→$[3𝑥&+ 6𝑥ℎ + 3ℎ&+ 2𝑥 + 2ℎ + 1] − (3𝑥&+ 2𝑥 + 1)
[6𝑥ℎ + 3ℎ&+ 2ℎ] ℎ
= / lim"→$6𝑥 + 3ℎ + 2 = 6𝑥 + 2
Then, We can find f”(x):
𝑓"(𝑥) = lim
"→$
[6(𝑥 + ℎ) + 2] − (6𝑥 + 2)
ℎ = lim"→$
6ℎ
ℎ = 6
2 Graphing:
Trang 6II The MATLAB functions and code explanation:
plot
plot (x,y,‘blue’,linewidth,2) plot (x,t, ‘red’, linewidth,2) plot(x,z,'green','linewidth',2)
2-D Line Plot
hold on hold on Retain current plot when adding new plots legend legend('label1', 'label2', ) Helps label parts of a plot
%the graph for the function f(x), f’(x) and f”(x)
x = -10:0.01:10;
% the graph for the function f(x)
y=3*x.^2+(2*x)+1;
plot (x,y,'blue','linewidth',2);
xlabel('x'
ylabel('y'
title('the graph for the function');
hold on;
% the graph for the function f’(x)
t= (6*x)+2;
plot(x,t,'red','linewidth',2);
% the graph for the function f”(x)
z = 0*x+6;
plot(x,z,'green','linewidth',2);
legend( 'y=3*x.^2+(2*x)+1' , 't= (6*x)+2' 'z=6'); ,
ylim ([-10 10])
grid on
Trang 77
[1] Defines the range of x values from -10 to 10 with a step size of 0.01 [2] Calculates the values of the function for each value of x in the
defined range [3] Plots the graph of f(x) with blue color and a line width of 2
[4-6] Adds labels to the x- axis, y axis, and a title to the graph
-[7] Keeps the current plot and adds subsequent plots to it
[8] Calculates the values of the first derivative f’(x) for each value of x
[9] Plots the graph of f’(x) with red color and a line width of 2
[10] Calculates the values of the second derivative f”(x) for each value of
x Since the second derivative of f(x)=6, it's a constant function
[11] Plots the graph of f”(x) with green color and a line width of 2
[12] Adds a legend to the graph indicating the functions plotted [13] Sets the y-axis limits from -10 to 10
[14] Adds a grid to the graph
Trang 84 Plot result
III. The result and conclusion:
f′(x) seems reasonable since f′(x) has negative values when the slope of f(x) has a negative slope, f′(x) is 0
when the slope of f(x) is 0, and f′(x) has positive values when the slope of f(x) has a positive slope.
f′′(x) seems reasonable since f′(x) has a constant slope of 6
Trang 99
PROBLEM 2: Use the definition of a derivative to find f’(x) and f”(x) Then graph f, f’, and f” on a common screen and check to see if your answers are reasonable
f(x) = x3 − 3x
I The theory and algorithm :
We have seen that the same type of limit arises in finding the slope of a tangent line (Equation 2):
𝑚 = 𝑙𝑖𝑚"→$𝑓(𝑎 + ℎ − /𝑓(𝑎) )
ℎ
In fact, limits of the form:
𝑙𝑖𝑚
"→$
𝑓(𝑎 + ℎ − /𝑓(𝑎) ) ℎ arise whenever we calculate a rate of change in any of the sciences or engi- neering, such as a rate of reaction in chemistry or a marginal cost in economics Since this type of limit occurs so widely, it is given a special name and notation
If we write x = a + h, then we have h = x - a and approaches 0 if and only if x approaches a Therefore
an equivalent way of stating the definition of the derivative, as we saw in finding tangent lines, is:
𝑓%(𝑎) = 𝑙𝑖𝑚"→( 𝑓(𝑥) − /𝑓(𝑎)
𝑥 − /𝑎
We defined the tangent line to the curve y = f(x) at the point P(a, f(a)) to be the line that passes
through P and has slope m given by Equation 1 or 2 Since, by Definition 4, this is the same as the
derivative f’(a), we can now say the following
The tangent line to y = f(x) at (a, f(a)) is the line through (a, f(a)) whose slope is equal to f’(a), the
derivative of at a
If we use the point-slope form of the equation of a line, we can write an equation of the tangent line
to the curve y = f(x) at the point (a, f(a)) :
𝑦 − /𝑓 (𝑎) = /𝑓′(𝑎)(𝑥 − 𝑎)
Trang 101 Finding Derivative:
𝑓%(𝑥) = / lim"→$𝑓(𝑥 + ℎ) − 𝑓(𝑥)
ℎ = lim"→$
[(𝑥 + ℎ))− 3 𝑥 + ℎ ( )] − (𝑥 − 3𝑥))
ℎ
= / lim"→$𝑥
)+ 3𝑥 ℎ + 3𝑥ℎ + ℎ& & )− 3𝑥 − 3ℎ
ℎ = lim"→$
3𝑥&ℎ + 3𝑥ℎ&+ ℎ)− 3ℎ
ℎ
= / lim"→$ℎ(3𝑥
&+ 3𝑥ℎ + ℎ − 3& )
ℎ = lim"→$(3𝑥&+ 3𝑥ℎ + ℎ&− 3) = 3𝑥&− 3
𝑓"(𝑥) = lim"→$𝑓
%(𝑥 + ℎ) − 𝑓%(𝑥)
ℎ = lim"→$
[ ( 3 𝑥 + ℎ)&− 3] − 3𝑥 ( &− 3 )
ℎ
= lim"→$(3𝑥&+ 6𝑥ℎ + 3ℎ&− 3) − (3𝑥&− 3)
ℎ = lim"→$
( 6𝑥ℎ + 3ℎ&)
ℎ = lim"→$
ℎ(6𝑥 + 3ℎ) ℎ
= lim
"→$6𝑥 + 3ℎ = 6𝑥
2 Graphing:
Trang 1111
1 MATLAB command:
plot
plot (x, y, ‘blue’,linewidth,2 ) plot (x, t, ‘red’, linewidth,2) plot(x,z,'green','linewidth',2)
2-D Line Plot
hold on hold on Retain current plot when adding new plots legend legend('label1', 'label2', ) Helps label parts of a plot
2 MATLAB code:
%the graph for the function f(x), f’(x) and f”(x)
x = 4:0.01:4;
-% the graph for the function f(x)
y=x.ˆ3-(3*x);
plot (x,y, ’blue’ , ’linewidth’ ,3);
xlabel( ’x’ );
ylabel( ’y’ );
title( ’the graph for the function’ );
hold on ;
% the graph for the function f’(x)
t= (3*x.ˆ2)-3;
plot(x,t, ’red’ , ’linewidth’ ,3);
% the graph for the function f”(x)
z=6*x;
plot(x,z, ’green’ , ’linewidth’ ,3);
legend( ’y=x.ˆ3-(3*x)’ , ’t= (3*x.ˆ2)-3’ ’z=6*x’ , );
Trang 123 MATLAB explanation:
[1] Defines the range of x values from 10 to 10 with a step size of 0.01
-[2] Calculates the values of the function for each value of x in the
defined range [3] Plots the graph of f(x) with blue color and a line width of 2
[4-6] Adds labels to the x- axis, y axis, and a title to the graph
-[7] Keeps the current plot and adds subsequent plots to it
[8] Calculates the values of the first derivative f’(x) for each value of x
[9] Plots the graph of f’(x) with red color and a line width of 3
[10] Calculates the values of the second derivative f” (x) for each value
of x Since the second derivative of f(x)=6x, it's a linear function
[11] Plots the graph of f” (x) with green color and a line width of 3
[12] Adds a legend to the graph indicating the functions plotted
4 Plot Result:
Trang 1313
III
We see from the graph that our answers are reasonable because the graph of f’ is that of an even function (f
is an odd function) and the graph of f” is that of an odd function Furthermore, f’ = 0 when f has a horizontal tangent and f”= 0 when f’ has a horizontal tangent
Trang 14REFERENCES
[1] J Stewart, Calculus Concepts and Contexts, 7th ed., Thomson Learning, 2012.: https://www.stewartcalculus.com/media/17_home.php
[2] Desmos-graphing calculator: Desmos | Graphing Calculator