Let f(x)=sinx+cosx⇒f′(x)=cosx−sinx
and f′′(x)=−sinx−cosx=−(sinx+cosx)
For maxima or minima put f′(x)=0. ∴cosx−sinx=0 ⇒sinx=cosx ⇒cosxsinx=1 ⇒tanx=1 ⇒x=4π,45π,…
Now, f′′(x) will be negative when (sinx+cosx) is positive i.e., when sinx and cosx are both positive. Also, we know that sinx and cosx both are positive in the first quadrant.
Then, f′′(x) will be negative when x∈(0,2π).
Thus, we consider x=4π. f′′(4π)=−(sin4π+cos4π) =−(21+21)=−22=−2<0
By second derivative test, f will be maximum at x=4π and the maximum value of f is f(4π)=sin4π+cos4π=21+21=22=2