Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/main/141-Labs/Lab 05 - Differentiation and Tangent Lines.ipynb
Views: 491
Lab 05 - Differentiation and Tangent Lines
Overview
In this lab, we will learn how to use SageMath to find derivatives and the equation of the tangent line to a curve at a given point.
Important SageMath Commands Introduced in this Lab
ParseError: KaTeX parse error: Undefined control sequence: \hfill at position 32: …|l|l|} \hline \̲h̲f̲i̲l̲l̲ ̲\textbf{Command…Related Course Material
Recall the point-slope form of the equation of the line: where is a point on the line and is the slope of the line. Next, since is on the tangent line, we can substitute and move it to the other side. Therefore, we get: Finally, we know that the derivative evaluated at is the same as the slpoe of the tangent line to the graph of at . Thus, we get the following formula for the equation of the tangent line to the graph of at :
Example 1
In the previous lab, we learned how to use limits and the difference quotient to calculate the derivative of . In SageMath, a more direct way is to use the command to calculate . This command can also be used to find higher order derivatives. The command will calculate the derivative of .
Let . Use SageMath to find the following:
Suppose we want to calculate . One thought might be to try .
Note that this output is wrong. If we use this command, SageMath first calculates , and then takes the derivative of this constant which resulted in 0. Instead, we could do one of the following:
We can let and then evaluate .
We can have SageMath calculate , and then use our command to evaluate the function at
Example 2
Find , , and for the following functions:
Example 3
Consider the function . We will use SageMath to find the equation of the tangent line of at and to plot both the function and the tangent line. In order to find the equation of the tangent line, we need to find both and .
Recall from the notes at the beginning of this lab that the equation of the tangent line of at is We use SageMath to find this line.
Therefore, is the equation of the tangent line of at . We now plot both and the tangent line on the same graph. Choose a domain which has the -value in the center.
Example 4
Repeat Example 3 with the following functions:
at
at
at