(%i1) plot2d([sin(x),cos(x)],[x,-2*%pi,2*%pi]);
The objective of this lab is to explore and understand the concepts of slopes (derivatives) of trigonometric functions, as well as to practice applying derivative rules, such as the product and quotient rules, using both manual calculations and Maxima computer algebra system (CAS). Students will:
diff function in Maxima for symbolic differentiation.By the end of this lab, students will have a comprehensive understanding of the derivatives of trigonometric functions, proficiency in using Maxima for symbolic differentiation, and enhanced skills in applying the product and quotient rules to various functions.
Let’s plot the sin(x) and cos(x) function on the same window:
(%i1) plot2d([sin(x),cos(x)],[x,-2*%pi,2*%pi]);
focus at \(x=0\), what is the slope of \(\cos(x)\)? answer here:
focus at \(x=0\), what is the slope of \(\sin(x)\)? answer here:
Now do finite advance on \(x\), between 0 and \(pi/2\) and comment how the slope is changing for \(\cos(x)\). Answer here:
Now do finite advance on \(x\), between 0 and \(pi/2\) and comment how the slope is changing for \(\sin(x)\). Answer here:
diff(f(x),x,1)The function which do the trick on maxima is called diff, and have 3 arguments, the first is the function, second is the independent variable you are calculating the derivative, and third is how many times you want to differentiate, e.g. if you want to calculate twice the derivative of the function \(f(x)\) the maxima code is diff(f(x),x,2)
Lets try to calculate first the derivative of the following function : \[f(x)= x^5-\frac{1}{x^2}-2x -7\]
Using the power rule we know that \[f' = 5x^4 +\frac{2}{x^3} -2 \] easy-peasy !
How we use maxima to get the same answer?
Write what could be the code which calculate that derivative:
(%i2) define(f(x),x^5 -1/x^2-2*x-7);\[\mathtt{(\textit{%o}_{2})}\quad f\left(x\right):=x^5-2\,x-\frac{1}{x^2}-7\]
(%i3) diff(f(x),x,1);\[\mathtt{(\textit{%o}_{3})}\quad 5\,x^4+\frac{2}{x^3}-2\]
maxima-casUsing what you learn on the previous section:
Calculate the derivative of \[y = \frac{x^3}{3} + x^2 + x + 3 \]
Do the following 7 steps on a paper, then take a screenshot and uploaded to the computer:
Compare your results with what maxima can calculate by a couple lines of instructions:
(%i4) define(y(x),x^3/3 +x^2 +x +3);\[\mathtt{(\textit{%o}_{4})}\quad y\left(x\right):=\frac{x^3}{3}+x^2+x+3\]
(%i5) diff(y(x),x,1);\[\mathtt{(\textit{%o}_{5})}\quad x^2+2\,x+1\]
(%i6) factor(%);\[\mathtt{(\textit{%o}_{6})}\quad \left(x+1\right)^2\]
It is the same? if not why not?
Note: To factor an expression using maxima you can use the command factor. % refer to the last output
Calculate the derivative of \[y = \frac{x^2+3x+4}{x^2-1} \]
Do the following 7 steps on a paper, then take a screenshot and uploaded to the computer:
Cell -> Insert Image)Shift+Enter in each code chunk.Ctrl+RFINAL_Lab3_Calc1_YOURLASTNAME_mmddyy.wxmx.)pictures need to be in the same folder of your .wxmx file↩︎