Find the maximum and the minimum values of sinx + cosx and the smallest value of x which they have these values

let y = sinx + cosx

dy/dx = cosx - sinx
at a max or min, dy/dx = 0
cosx - sinx = 0
cosx = sinx
1 = sinx/cosx
tanx = 1
x = 45° or 225°

when x = 45°
y = cos45° + sin45° = √2/2+√2/2 = √2
when x = 225°
y = cos225 +sin225 = -√2/2 - √2/2 = -√2

we get a min of -√2 when x = 225° or 5π/4
we get a max of √ when x = 45° or π/4