Derivative Signs
Author
Ruth Dover
Title
Derivative Signs
Description
Plots a function with colors to show where the first and second derivatives are positive and negative.
Category
Educational Materials
Keywords
Calculus, Derivative
URL
http://www.notebookarchive.org/2018-12-bkof6n9/
DOI
https://notebookarchive.org/2018-12-bkof6n9
Date Added
2018-12-25
Date Last Modified
2018-12-25
File Size
16.08 kilobytes
Supplements
Rights
Redistribution rights reserved



Derivative Signs
by Ruth Dover, Math Instructor (Emeritus), Illinois Mathematics and Science Academy (IMSA), Aurora, IL
Enter a function and the min and max values for x. (An example is given, but this may be changed.)
A basic graph is shown. (In some cases, you might want to control the PlotRange for this and for the subsequent graphs.)
A basic graph is shown. (In some cases, you might want to control the PlotRange for this and for the subsequent graphs.)
f[x_]:=-6+5x+8;xmin=-2;xmax=6;Plot[f[x],{x,xmin,xmax},PlotStyleThick]
3
x
2
x
First derivative
First derivative
This will plot the function red where the first derivative is positive and blue where the derivative is negative.
In[]:=
fder[x_]:=Evaluate[D[f[x],x]];Show[Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},fder[x]>0],PlotStyle{Red,Thick}],Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},fder[x]<0],PlotStyle{Blue,Thick}],PlotRangeAll]
Below, you will see the same colored graph along with the graph of the first derivative of ƒ shown in green.
In[]:=
fder[x_]:=Evaluate[D[f[x],x]];Show[Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},fder[x]>0],PlotStyle{Red,Thick}],Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},fder[x]<0],PlotStyle{Blue,Thick}],Plot[fder[x],{x,xmin,xmax},PlotStyle{Thick,Green}],PlotRangeAll]
Second derivative
Second derivative
This next command will plot the function green where the second derivative is positive and purple where the second derivative is negative.
In[]:=
secder[x_]:=Evaluate[D[f[x],{x,2}]];Show[Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},secder[x]>0],PlotStyle{Cyan,Thick}],Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},secder[x]<0],PlotStyle{Purple,Thick}],PlotRangeAll]
Below, you will see the same colored graph along with the graph of the second derivative of ƒ shown in blue.
In[]:=
secder[x_]:=Evaluate[D[f[x],{x,2}]];Show[Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},secder[x]>0],PlotStyle{Cyan,Thick}],Plot[f[x],{x,xmin,xmax},RegionFunctionFunction[{x,y},secder[x]<0],PlotStyle{Purple,Thick}],Plot[secder[x],{x,xmin,xmax},PlotStyleThick],PlotRangeAll]


Cite this as: Ruth Dover, "Derivative Signs" from the Notebook Archive (2019), https://notebookarchive.org/2018-12-bkof6n9

Download

