Labsheet 6 (Mean Value Theorem, Maxima and Minima)
Labsheet 6 (Mean Value Theorem, Maxima and Minima)
MATLAB
Objective
This lab will guide you through applying the Mean Value Theorem (MVT) and finding
critical points, maxima, and minima of functions using MATLAB. You’ll analyze
functions and use derivatives to identify intervals of increase and decrease, as well
as local maxima and minima.
MATLAB Commands to Know
syms — Define symbolic variables.
diff — Compute the derivative of a function.
solve — Solve equations symbolically.
subs — Substitute values into symbolic expressions.
fplot — Plot functions.
double — Convert symbolic expressions to numerical values.
1. Mean Value Theorem in MATLAB
syms x c
f = x^2 + 2*x;
a = 1;
b = 4;
syms x
f = x^3 - 3*x^2 + 2;