# A pde question that "DSolve" fails to solve

DSolve[{Laplacian[u[x, y],{x, y}] == x y,
DirichletCondition[u[x, y] == x y, True]},
u[x, y], {x, y} \[Element] Disk[{0, 0}, 1]]


This is the code I used to solve this equation; But it does not evaluate and just outputs what I inputted... It's sure that it's not a Dirichlet problem but I don't know how to modify it.

I never use region thing with DSolve. It does not look like it works with DSolve but only with NDSolve. So as a workaround, you could do the following

ClearAll[x, y, u, r, theta]
rhs = r^2 Cos[theta]*Sin[theta];
pde = Laplacian[u[r, theta], {r, theta}, "Polar"] == rhs;
bc = u[1, theta] == Cos[theta]*Sin[theta];
soldsolve = u[r, theta] /. First@DSolve[{pde, bc}, u[r, theta], {r, theta}]


To plot

ParametricPlot3D[{r Cos[theta], r Sin[theta], soldsolve}, {r, 0,
1}, {theta, 0, 2*Pi}, AxesLabel -> {"x", "y", "u"}, BaseStyle -> 15,
ImageMargins -> 5, PerformanceGoal -> "Quality",
BoxRatios -> {1, 1, 1/2}]


Compare the solution to numerical solution

ClearAll[x, y, u];
pde = Laplacian[u[x, y], {x, y}] == x y;
bc = DirichletCondition[u[x, y] == x y, True];
solNdsolve = NDSolve[{pde, bc}, u, Element[{x, y}, Disk[{0, 0}, 1]]]


Plot3D[Evaluate[u[x, y] /. solNdsolve],  Element[{x, y}, Disk[{0, 0}, 1]]]


Pick a random position to verify against numerical solution:

soldsolve /. {r -> Sqrt[1/4 + 1/4], theta -> Pi/4} // N
(* 0.239583 *)

Evaluate[u[1/2, 1/2] /. solNdsolve]
(* {0.239578} *)

• Thanks for your answer. I find that DSolve can work out laplace's equation with boundary condition in that way, which bothers me even more... anyway, I have learned much from your detailed answer, thanks again.
– pei
Commented Jul 6, 2021 at 10:54