____________________________________________________________________________________
Taken from Mathematica DSolve help pages.
Solve for \(u\left ( x,y\right ) \) \begin {align*} u_{xx}+ u_{yy} + 5 u(x,y) & = 0 \end {align*}
Boundary conditions \begin {align*} u(x,0) &= \text {UnitTriangle[x-2]} \\ u(x,2) &= 0 \\ u(0,y) &= 0 \\ u(4,y) &=0 \end {align*}
Mathematica ✓
ClearAll["Global`*"]; pde = {Laplacian[u[x, y], {x, y}] + 5*u[x, y] == 0}; bc = {u[x, 0] == Piecewise[{{-1 + x, x > 1 && x < 2}, {3 - x, x > 2 && x < 3}}], u[x, 2] == 0, u[0, y] == 0, u[4, y] == 0}; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}], 60*10]]; sol = sol /. K[1] -> n
\[\left \{\left \{u(x,y)\to \underset {n=1}{\overset {\infty }{\sum }}\frac {64 \left (\cos \left (\frac {n \pi }{8}\right )+\cos \left (\frac {3 n \pi }{8}\right )\right ) \text {csch}\left (\frac {1}{2} \sqrt {n^2 \pi ^2-80}\right ) \sin ^3\left (\frac {n \pi }{8}\right ) \sin \left (\frac {n \pi x}{4}\right ) \sinh \left (\frac {1}{4} \sqrt {n^2 \pi ^2-80} (2-y)\right )}{n^2 \pi ^2}\right \}\right \}\]
Maple ✓
restart; pde := diff(u(x,y),x$2)+diff(u(x,y),y$2)+5*u(x,y)=0; bc := u(x,0)=piecewise( x>1 and x<2, -1+x,x>2 and x<3 ,3-x), u(x,2)=0, u(0,y)=0, u(4,y)=0; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc],u(x,y))),output='realtime'));
\[u \left (x , y\right ) = \sum _{n=1}^{\infty }\frac {32 \left (\left (\cos \left (\frac {\pi n}{4}\right )-1\right ) \cos \left (\frac {\sqrt {-\pi ^{2} n^{2}+80}}{2}\right ) \cos \left (\frac {\pi n}{4}\right ) \sin \left (\frac {\pi n}{4}\right ) \sin \left (\frac {\sqrt {-\pi ^{2} n^{2}+80}\, y}{4}\right )+\frac {\left (\sin \left (\frac {\pi n}{2}\right )-\frac {\sin \left (\frac {\pi n}{4}\right )}{2}-\frac {\sin \left (\frac {3 \pi n}{4}\right )}{2}\right ) \cos \left (\frac {\sqrt {-\pi ^{2} n^{2}+80}\, y}{4}\right ) \sin \left (\frac {\sqrt {-\pi ^{2} n^{2}+80}}{2}\right )}{2}\right ) \sin \left (\frac {\pi n x}{4}\right )}{\pi ^{2} n^{2} \sin \left (\frac {\sqrt {-\pi ^{2} n^{2}+80}}{2}\right )}\]
____________________________________________________________________________________
Added December 27, 2018.
Solve for \(u\left ( x,y\right ) \) \begin {align*} u_{xx}+u_{yy} + 5 u(x,y) & = 0 \end {align*}
Mathematica ✓
ClearAll["Global`*"]; pde = {Laplacian[u[x, y], {x, y}] + 5*u[x, y] == 0}; sol = AbsoluteTiming[TimeConstrained[DSolve[pde, u[x, y], {x, y}], 60*10]];
\[\left \{\left \{u(x,y)\to e^{\sqrt {c_5} (-x)} \left (c_1 e^{2 \sqrt {c_5} x}+c_2\right ) \left (c_4 \cos \left (\sqrt {5+c_5} y\right )+c_3 \sin \left (\sqrt {5+c_5} y\right )\right )\right \}\right \}\] why? It solved earlier with BC?
Maple ✓
restart; pde := diff(u(x,y),x$2)+diff(u(x,y),y$2)+5*u(x,y)=0; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve(pde,u(x,y),'build')),output='realtime'));
\[u \left (x , y\right ) = \left (c_{1} {\mathrm e}^{2 x \sqrt {\mathit {\_c}_{1}}}+c_{2}\right ) \left (c_{3} \sin \left (\sqrt {\mathit {\_c}_{1}+5}\, y \right )+c_{4} \cos \left (\sqrt {\mathit {\_c}_{1}+5}\, y \right )\right ) {\mathrm e}^{-x \sqrt {\mathit {\_c}_{1}}}\]
____________________________________________________________________________________
Added December 20, 2018.
Example 24, taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018
Solve for \(u\left ( x,y\right ) \) \begin {align*} \frac {\partial ^{2}u}{\partial x^{2}}+\frac {\partial ^{2}u}{\partial y^2} - k u(x,y) & = 0 \end {align*}
With \(k>0\). It is called reduced Helmholtz, because of the minus sign above. Otherwise, standard Helmholtz has a positive sign.
Boundary conditions \begin {align*} u(x,0) &= 0 \\ u(x,\pi ) &= 0 \\ u(0,y) &= 1 \\ u(\pi ,y) &=0 \end {align*}
Mathematica ✓
ClearAll["Global`*"]; pde = Laplacian[u[x, y], {x, y}] - k*u[x, y] == 0; bc = {u[x, 0] == 0, u[x, Pi] == 0, u[0, y] == 1, u[Pi, y] == 0}; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc}, u[x, y], {x, y}, Assumptions -> k > 0], 60*10]];
\[\left \{\left \{u(x,y)\to \underset {K[1]=1}{\overset {\infty }{\sum }}-\frac {2 \left (-1+(-1)^{K[1]}\right ) \text {csch}\left (\pi \sqrt {K[1]^2+k}\right ) \sin (y K[1]) \sinh \left ((\pi -x) \sqrt {K[1]^2+k}\right )}{\pi K[1]}\right \}\right \}\]
Maple ✓
restart; pde := diff(u(x, y), x$2)+diff(u(x, y), y$2)-k*u(x, y) = 0; bc_left_edge:=u(0, y) = 1; bc_lower_edge:=u(x, 0) = 0; bc_top_edge:=u(x,Pi)=0; bc_right_edge:=u(Pi,y)=0; bc:=bc_left_edge,bc_lower_edge,bc_top_edge,bc_right_edge; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,bc ], u(x, y)) assuming k>0),output='realtime'));
\[u \left (x , y\right ) = \sum _{n=1}^{\infty }-\frac {2 \left (\left (-1\right )^{n}-1\right ) \left (-{\mathrm e}^{\sqrt {n^{2}+k}\, x}+{\mathrm e}^{-\left (x -2 \pi \right ) \sqrt {n^{2}+k}}\right ) \sin \left (n y \right )}{\left ({\mathrm e}^{2 \sqrt {n^{2}+k}\, \pi }-1\right ) \pi n}\]