Find a function $\phi(x, y)$ that is harmonic in the infinite vertical strip
$${z: -1 \le \text{Re } z \le 3}$$
and takes the value $0$ on the left edge and the value $4$ on the right edge.
This problem is easy enough to realize that the function we are looking for is $\phi (x, y)=x+1$ because it meets the requirements, however I don't know how to solve these harmonic boundary questions algebraically.
The left vertical line is $x=-1$ the right vertical line is $x=3$, both of these are the real part of $z$, so we have $\phi (x, y)=A(x)+B=\text{Re } Az+B$.
When $x=-1$ we want $\phi=0$ and when $x=3$ we want $\phi=4$ therefore,
$$-A+B=0$$
$$3A+B=4$$
$A=1$ and $B=1$ therefore $\phi(x, y)=x+1$
Does this make sense?