Solving the Laplace equation in terms of exponential of hyperbolic trigonometric functions
I'm solving the Laplace equation $U_{xx}+U_{yy}=0$ subject to BC's: \begin{align} U(0,y) &= 0 \\ U(a,y) &= 0 \\ U(x,0) &= 0 \\ U(x,b) & = \begin{cases} x & \text{if } x \in \left[0,\frac{a}{2}\right]\\ a - x & \text{if } x \in \left[\frac{a}{2},a\right] \end{cases} \end{align}
Since the $Y$ dimension has homogeneous BCs, I solve it first by separation of variables to get $Y(y) = k \sin(n \pi \frac{x}{b})$
My question is: when solving the second ODE, the solution can be written as either $k_1 e^{\cdots} + k_2 e^{-(\cdots)}$ OR $k_1 \cosh(\cdots) + k_2 \sinh(\cdots)$.
Using the exponentials, the first boundary condition $U(x,0)$ gives $k_1=-k_2$. Using hyperbolics, which every formal solution I have found does, you immediately find that $k_1 = 0$, which is required to finish the solution. Can anyone explain where my mistake is?
the solution can be written as either $k_1 e^{\cdots} + k_2 e^{-(\cdots)}$ OR $k_1 \cosh(\cdots) + k_2 \sinh(\cdots)$.
Yes, but those $k_1$ and $k_2$ are not the same numbers in these two formulas. For clarity, let's call the second form of solution $p_1 \cosh(\cdots) + p_2 \sinh(\cdots)$. Using $e^{\pm x} = \cosh x\pm \sinh x$, you will find that $p_1 = k_1+k_2$ and $p_2=k_1-k_2$. Thus, $k_1=-k_2$ is indeed the same as $p_1=0$. No mistake anywhere.