Solution: Consider f(x)=sinx+cosx
f′(x)=cosx−sinx
Now, f′(x)=0
cosx−sinx=0
cosx=sinx
tanx=1
x=nπ+4π
Here, x=nπ+4π is a turning point.
Now, calculate f(nπ+4π):
f(nπ+4π)=sin(nπ+4π)+cos(nπ+4π)
=(−1)nsin4π+(−1)ncos4π
=(−1)n21+(−1)n21
=2(−1)n21
=2(−1)n
If n is even, then
f(nπ+4π)=2
If n is odd, then
f(nπ+4π)=−2
Therefore, the maximum value of f(x) is 2 and the minimum value of f(x) is −2.