The mean value theorem states that if `f(x)` is continuous on `[a,b]` and differentiable on `(a,b)` , then there exists `c in [a,b]` such that `f'(c)=(f(b)-f(a))/(b-a)`
(1) sec(x) is continuous everywhere except `x=pi/2 +pi*n,n in ZZ` . So sec(x) is continuous on `[-pi/6,pi/3]`
(2) sec(x) is differentiable on its domain, so it is differentiable on the given interval.
(3) The theorem does not require f(b)=f(a) anywhere in the interval. The theorem applies to monotonic functions as well, as long as they meet the continuity and differentiability criterion.
This is confusing the mean value theorem with its special case, Rolle's theorem.
(4) Note that `f(pi/3)=2` and `f(-pi/6)=2/sqrt(3)` . Then:
`(f(b)-f(a))/(b-a)=(2-2/sqrt(3))/(pi/3-pi/6)`
`=((2sqrt(3)-2)/sqrt(3))/(pi/2)`
`=(4sqrt(3)-4)/(sqrt(3)pi)`
`=(12-4sqrt(3))/(3pi)`
So the theorem has been properly applied to the function f(x)=sec(x) on the given interval.
Further Reading