Site logo MA251: Calculus I
MA251
Problems
Matlab
Locating a local max or min is a very simple task if you have Matlab! Suppose you have the function
f(x) = 2x6 + 3x5 +3x3-2x2
and you want to find its critical points. All you have to do is type the following in Matlab:

>>syms x
>> f =2*x^6 + 3*x^5 +3*x^3-2*x^2;
>> df = diff(f);
>> cp = solve(df);

At this point you should be able to tell what each step does.

To plot the function and its critical points, you would do the following:
>> X = linspace(-2,2);
>> plot(X,subs(f,x,X));
>> hold on
>> plot(cp,subs(f,x,cp),'r*')