So, guys, here's my problem. I have this differential equation
$$ U''_{xx}+U''_{yy}=0 $$
with these boundary conditions:
$$ U'_{y}(x,0)=0 $$ $$ U'_{y}(x,\pi)=0 $$ $$ U(0,y)=0 $$ $$ U(\pi,y)=1+\cos(2y) $$
Now, I obtain this solution for the first three conditions:
$$ \sum_{n=1}^{\infty} K_n \cdot \sinh(nx) \cdot \cos(ny) $$
And it has to verify the last condition, so
$$ U(\pi,y)=\sum_{n=1}^{\infty} K_n \cdot \sinh(n\pi) \cdot \cos(ny)=1+\cos(2y) $$
So, $ K_n \cdot \sinh(n\pi) $ has to be the coefficient of the Fourier series of $ 1+\cos(2y) $. My problem is, how do I calculate $ K_n $?
I tried to obtain the constant by using the following formula
$$ K_n \cdot sinh(n\pi)=\frac{1}{\pi} \int_{-\pi}^{\pi} (1+ \cos(2y)) \cdot \cos(ny) \ dy $$
But, according to Wolfram Alpha and my own results, it's equal to $0$.
Thank you very much, guys!
You have this mostly right. As @Brian Rushton says, the finite FS in the BC means that you only need contend with the $n=0$ and $n=2$ terms. The tricky part is getting the $n=0$ term right. In that case,you may be tempted to set that term to zero identically, but that's not right. The fact that $U(\pi,0)=2$ means that a different approach is warranted. In this case, if you imagine that
$$U(x,y) = \sum_{n=0}^{\infty} A_n \sinh{n x} \cos{n y}$$
set $A_n = B_n/(n \pi)$. Then $\lim_{n \to 0} A_n \sinh{n x} = B_0 (x/\pi)$. The BC at $x=\pi$ demands that $B_0=1$. It is then straightforward to write that
$$U(x,y) = \frac{x}{\pi} + \frac{\sinh{2 x}}{\sinh{2 \pi}} \cos{2 y}$$
You may verify that this $U$ satisfies the BCs and the differential equation.