Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download

derivative worksheet

Views: 72
# Kristen Shine # Using Sage to Explore Derivatives # Consider the function f(x)=x^3-2x #-------------------------------------------------------------------------------------------------------------------- # 1. Find the critical values of the function. # First, declare the function. f(x)=x^3-2*x # Use Sage's "diff" command to see the derivative of our function. fprime(x)=diff(f(x),x) fprime(x)
3*x^2 - 2
# To find critical points of a function, we set the derivative to 0 and solve. # We can use Sage's "solve" command to find the x critical points. # I named this "cps" to stand for "critical points". cps=(solve(fprime(x)==0,x)) cps # I took our x values and named them x1 and x2, and used the "n" command to show them as decimals. x1=-1/3*sqrt(3)*sqrt(2) n(x1) x2=1/3*sqrt(3)*sqrt(2) n(x2)
[x == -1/3*sqrt(3)*sqrt(2), x == 1/3*sqrt(3)*sqrt(2)] -0.816496580927726 0.816496580927726
# The critical values are -0.816 and 0.816 #---------------------------------------------------------------------------------------------------------- # 2. Does f(x) have absolute extrema? # No, since the function is not defined on a closed interval, the function does not have an absolute max or an absolute min. limit(f(x),x=infinity) limit(f(x),x=-infinity) # The function has a domain of (-infinity,infinity), thus there is not absolute extrema. The critical values that we found in #1 were part of the local minimum and local maximum. #------------------------------------------------------------------------------------------------------------- # 3. „Where is the function f(x) increasing and decreasing? # Interval - (-infinity,-0.816),(-0.816,0.816),(0.816,infinity) # Plug numbers into derivative function from each interval fprime(-3) fprime(0) fprime(3) # From -infinity to -0.816, the function f(x) is increasing. # From -0.816 to 0.816, the function f(x) is decreasing. # From 0.816 to infinity, the function f(x) is increasing. #--------------------------------------------------------------------------------------------------------- # 4. Find the points of inflection of f(x). Where is the graph concave up? Concave down? # To solve this problem we need to find the second derivative of f(x). f2prime(x)=derivative(derivative(f(x))) f2prime(x)
+Infinity -Infinity 25 -2 25 6*x
# The point of inflection is the point where the concavity changes. # Set the 2nd derivative equal to 0 in order to find point of inflection. inflection=solve(f2prime(x)==0,x) inflection
[x == 0]
# check to see if its the actual point of inflection by checking concavity. # interval -- (-infinity,0),(0,infinity) # Plug numbers into 2nd derivative function from each interval. f2prime(-2) f2prime(3)
-12 18
# To the left of 0, the graph is concave down. To the right of 0, the graph is concave up. This confirms that 0 is an inflection point of f(x). #-------------------------------------------------------------------------------------------------------------------- # 5. Use Sage to plot f(x) in order to test our findings. Show points of inflection as well as local minimums and maximums. plot(f(x),-5,5,ymin=-30,ymax=30)
# to plot the local min and max - y1=f(x1) y2=f(x2) plot(f(x),-5,5,ymin=-30,ymax=30)+point((x1,y1),size=30)+point((x2,y2),size=30)
# To plot the inflection point - f2prime(0)
0
plot(f(x),-5,5,ymin=-30,ymax=30)+point((x1,y1),size=30)+point((x2,y2),size=30)+point((0,0),size=30)
var('y') z=3*x+4*y
y
diff(z,x)
3