Find the maximum value of the function:

f(x) = sin^2 (x/2) + sin(x/2) + cos(x/2) + cos^2 (x/2)

sin^2 (x/2) + sin(x/2) + cos(x/2) + cos^2 (x/2)

= 1 + sin(x/2) + cos(x/2)
= 1 + √2 sin(π/4 + x/2)
so the max value is 1+ √2