Find harmonic function in $U=[0,\pi]^2\subset R^2$ such that \begin{cases} u(x,0)=3\sin(x)+7\sin(17x)\\ u(x,\pi)=0\\ u(0,y)=\sin(3y)+17\sin(7y)\\ u(\pi,y)=0 \end{cases}
I tried to use separation of variables and look for solution in form $$u(x,y)=X(x)Y(y)$$ But I don't know how to satisfy 1. and 3. condition.
Harmonic functions satisfy $\Delta u = 0$. Let $u(x,y) = X(x) Y(y)$ then $X'' Y + X Y'' = 0$. Rearranging, $X''/X = - Y''/Y = C$ where $C$ is a constant.
Consider first $C > 0$, and define $\mu^2 = C$, then $X'' - \mu^2 X = 0$. Solving yields $X(x) = A \sinh [\mu (\pi - x)]$. Similarly $Y(y) = B\sin \mu y$. Plugging in the boundary condition $Y(\pi) = B \sin \mu \pi = 0$ implies that $\mu_n = n$ for $n \in \mathbb Z$. Hence a solution is given by $$ u(x,y) = \sum_n A_n \sinh[n(\pi - x)] \sin n y. $$ Plugging in the condition $u(0,y)$ implies that $A_n = 0$ unless $n = 3,7$, hence $$ u(x,y) = \frac{\sinh[3(\pi-x)]}{\sinh 3\pi} \sin 3y + \frac{17 \sinh[7(\pi-x)]}{\sinh 7\pi} \sin 7y. $$ Can you finish the rest?