Extrema for Multivariate Functions
John Travis
Mississippi College
This sage worksheet takes a given multivariate function and compute various derivatives, critical points and the other stuff necessary to locate critical points and aid in describing any possible extreme values. Students using this for preparing homework should copy the results of each cell into a word processor and prepare a report with all conclusions. In other words, let Sage do the calculus and the student do the interpretation/application. If pasting formulas into a Word document, the formulas might look funny. That's ok.
Don't forget to get a nice perspective on your surface with all the points plotted (at the bottom) before pasting it into your document.
|
(Be certain to evaluate each cell--in order--from the top. The results from each active cell should print below the cell.)
The gradient vector The gradient vector |
The collection of second partial derivatives The collection of second partial derivatives |
|
The collection of solutions to grad(f)=0 The collection of solutions to grad(f)=0 |
At critical point ,
Traceback (click to the left of this block for traceback) ... ValueError: power::eval(): division by zero
At critical point ,
Traceback (most recent call last): d = (fxx(x=sol[x],y=sol[y])*fyy(x=sol[x],y=sol[y])-fxy(x=sol[x],y=sol[y])^2).n() File "", line 1, in <module> File "/tmp/tmpSltbGG/___code___.py", line 5, in <module> exec compile(u"for sol in solns:\n if numerical:\n html('At critical point $%s$,'%str(latex((sol[x],sol[y]))))\n d = (fxx(x=sol[x],y=sol[y])*fyy(x=sol[x],y=sol[y])-fxy(x=sol[x],y=sol[y])**_sage_const_2 ).n()\n html(' d = $%s$ '%str(latex(d))+'with $f_{xx} = %s.'%str(latex((fxx(x=sol[x],y=sol[y])).n())))\n else:\n html('At critical point $%s$,'%str(latex((sol[x],sol[y]))))\n d = (fxx(x=sol[x],y=sol[y])*fyy(x=sol[x],y=sol[y])-fxy(x=sol[x],y=sol[y])**_sage_const_2 )\n html(' d = $%s$ '%str(latex(d))+'with $f_{xx} = %s.'%str(latex((fxx(x=sol[x],y=sol[y])))))" + '\n', '', 'single') File "", line 4, in <module> File "sage/symbolic/expression.pyx", line 5437, in sage.symbolic.expression.Expression.__call__ (build/cythonized/sage/symbolic/expression.cpp:30903) File "sage/symbolic/ring.pyx", line 981, in sage.symbolic.ring.SymbolicRing._call_element_ (build/cythonized/sage/symbolic/ring.cpp:11110) File "sage/symbolic/expression.pyx", line 5291, in sage.symbolic.expression.Expression.substitute (build/cythonized/sage/symbolic/expression.cpp:30025) ValueError: power::eval(): division by zero |
range of x values: (-2*sqrt(3), 2*sqrt(3)) range of y values: (-2, 2) range of x values: (-2*sqrt(3), 2*sqrt(3)) range of y values: (-2, 2) |
|
A nice plot of the given surface with critical points. A nice plot of the given surface with critical points. |
Click to the left again to hide and once more to show the dynamic interactive window |
|
|