# Analytic solution to Elliptic PDE with constant coefficients

I'm trying to get my feet wet with finite elements and I'm solving the following equation on the unit square in $\mathbb{R}^2$

$-u_{xx} - u_{yy} + au_x + bu_y + u + c = 0$

where $u = 0$ on the boundary and $a,b,c$ are constants.

However, now I want to compare my numerical solution with an analytic solution, and I'm relatively inexperienced when it comes to the analytical solutions of PDEs.

I'm looking for a push in the right direction in terms of solution technique. Since it's a simple domain should I try separation of variables? How do I deal with the nonhomogeneity (the constant $c$)?

• Try this first with $a = b = 0$. Then the solution is expected to depend only on $r = \sqrt{x^2+y^2}$, and the pde becomes an ode which may be solved in terms of Bessel functions. – Hans Engler Oct 28 '15 at 17:03

The easiest way to obtain an exact solution is for non homogeneous equation. For example $$-u_{xx} - u_{yy} + au_x + bu_y + u +c= f(x,y)$$ Assume $u=\sin(A x)\cos(B y)$ then $$f(x,y)=A^2 u + B^2 u + a A \cos(A x)\cos(B y) + b B\sin(A x)\cos(B y) + u +c$$ So, solve it and you have what you need. Similarly you can do it with $u=e^{Ax+By}$
$u= e^{x}e^{y}$ Solves $$-u_{xx} - u_{yy} + u_x + u =0\quad\text{and}\quad -u_{xx} - u_{yy} + u_y + u =0$$
For a very partial test $u=y e^{x}$ as well as $u=x e^{y}$ solves $$-u_{xx} - u_{yy} + u =0$$
Slightly different equation which may be suitable change to you is $$-u_{xx} - u_{yy} + 2 u =0$$ Its solution is $e^{x-y}$.
• I'm not really seeing what I could do with this. I don't have a non-homogenous term in mind (in fact, I though the constant $c$ made this nonhomogenous to begin with), so how do I choose $f(x,y)$? – DisplayName Oct 28 '15 at 18:40