What is the maximum of Re(z) + Im(z)? 
I shaded the area to which $z$ belongs, with $z$ satisfying $$|z - i| \leq1$$ and
  $$\frac{\pi}{4}\leq \arg(z-i) \leq \frac{3\pi}{4}$$ How to find the
  maximum of $\text{Re}(z) + \text{Im}(z)$? I know this means if $Z = x + iy$, I have
  to find the maximum of $x + y$. But how?


 A: For any $k\in\Bbb R$, $x+y=k$ is a line of gradient $-1$, so you need to find which such line, with at least one pink point on it, is furthest into the first quadrant. It'll have to be a tangent to the circle $x^2+(y-1)^2=1$, at a point where the radius has gradient $1$. But such a radius has equation $y=x+1$, so the tangent is at $x=\frac{1}{\sqrt{2}}$ with $k=\sqrt{2}+1$. (In particular, you cans see this is a tangent to the pink part of the circle, with greater $x+y$ than is obtained where it meets the lines of gradient $\pm1$ already in the diagram.)
A: 
Observe that the maximum must be obtained in the first quadrant. Also, it must be on the boundary of the open shaded area in the first quadrant. 


*

*On the vertical segment $AB$, the max of $x+y$ is $2$. 

*On the other segment $AC$, the max of $x+y$ is 
$$
\frac{\sqrt2}{2}+(1+\frac{\sqrt2}{2})=1+\sqrt2.
$$ 

*One can calculate the coordinate of $C$ is $(\frac{\sqrt2}{2},1+\frac{\sqrt{2}}{2})$. Thus on the arc $BC$, 
$$
x+y=f(y):=\sqrt{1-(y-1)^2}+y,\quad y\in[y_0,2],\quad y_0:=1+\frac{\sqrt{2}}{2}\;.\tag{1}
$$
One can check that for all $y\in(1+\frac{\sqrt{2}}{2},2)$,
$$
f'(y)=1-\frac{y-1}{\sqrt{1-(y-1)^2}}>0,
$$
Thus
$$
\max_{y\in[y_0,2]}f(y)=f(1+\frac{\sqrt2}{2})=\sqrt{\frac{1}{2}}+(1+\frac{\sqrt2}{2})=1+\sqrt2
$$
is the desired maximum.

[Added:] Alternatively, as @J.G. suggested, one can use geometry in the following picture to find the answer:

A: Well, clearly the partial derivatives of x+ y are not 0 so it does not have max or min in the interior of this set.  So look at the boundary.  We can divide that into three parts, y= x, y= -x, and $x^2+ (y-1)^2= 1.  Further, since x+ y is linear, any max and min must be at the vertices- where those parts intersect.
The two lines intersect, of course, at (0, 0).  The line y= x intersects $X^2+ (y-1)^2= x^2+ (x-1)^2= 2x^2- 2x+ 1= 1$ when $2x(x-1)= 0$ or x= 0 and x= 1. That is, at (0,0) and (1, 1).  The line y= -x intersects the circle at (0, 0) and (-1, 1).
So this is just a matter of evaluating x+ y at (0, 0), where it is 0, at (1, 1), where it is 2, and at (-1, 1), where it is 0.  The maximum value is 2.
A: Here is an intuitive way to do this problem. 
Unfortunately, the shaded area is not correct. For example, $0$ is in the shaded region, but $\arg(0-i) = \frac{3 \pi}{2}$. To find the shaded region, do the following: Let $R$ be the region in which every complex number has an argument between $\frac{\pi}{4}$ and $\frac{3\pi}{4}$ (basically the region defined by the two lines you drew). We want $z-i$ to equal $w$ for some $w \in R.$ Thus $z=w+i$. So the region we want our $z$ in is: $R$ shifted up by $1$. 

Now imagine that you are at the point $2i$. Your $x+y$ is $2$. Now, staying on the circle, move a little bit to the right. What is your new $x+y$? You gave away a little bit of $y$, but you gained a lot more in $x$, because the steepness near the top of the circle is very little. Now continue moving to the right; as long as the tangent line is shallower than a 45 degree angle, you will keep gaining more $x$ than you lose $y$; but once it gets steeper than $45$ degrees, you will start losing more $y$ than you gain $x$. So therefore, to accumulate the maximum $x+y$, you should keep moving all the way to the edge of the red region (you are not allowed to move further anyway, but like we discussed, you wouldn't want to move further).
