0
$\begingroup$

Here I am trying to solve a simple partial differential equation i.e. $ \frac{\partial^2f}{\partial x^2}+\frac{\partial^2f}{\partial y^2}=6y $ but for some reason it won't solve it. There clearly is a solution as shown in the bottom and the code gives me a perfectly valid solution if I replace 6y with 0. Any thoughts? enter image description here

$\endgroup$
9
  • $\begingroup$ This is an elliptic PDE and it as infinitely many solutions. You need some boundary conditions or something the like to make the solution unique. $\endgroup$ Jan 10, 2018 at 14:49
  • $\begingroup$ how can I tell mathematica to only give me polynomial solutions? $\endgroup$ Jan 10, 2018 at 14:54
  • $\begingroup$ Make an ansatz and compare coefficients. See, e.g., CoefficientRules. $\endgroup$ Jan 10, 2018 at 14:56
  • $\begingroup$ What is an ansatz? $\endgroup$ Jan 10, 2018 at 15:11
  • 1
    $\begingroup$ en.wikipedia.org/wiki/Ansatz $\endgroup$
    – Chris K
    Jan 10, 2018 at 16:38

2 Answers 2

2
$\begingroup$
n = 3;
coeffs = Flatten[Table[c[i, j], {i, 0, n}, {j, 0, n}]];
ansatz = Sum[c[i, j] x^i y^j, {i, 0, n}, {j, 0, n}];
result = ansatz /. 
   Solve[Flatten[
       CoefficientList[
        D[ansatz, x, x] + D[ansatz, y, y] - y, {x, y}]] == 0, 
     coeffs][[1]]

c[0, 0] + y c[0, 1] - x^2 c[0, 2] + y^2 c[0, 2] + x^2 y (1/2 - 3 c[0, 3]) + y^3 c[0, 3] + x c[1, 0] + x y c[1, 1] - 1/3 x^3 c[1, 2] + x y^2 c[1, 2] - x^3 y c[1, 3] + x y^3 c[1, 3]

A test:

D[result, x, x] + D[result, y, y] // Simplify

y

You see, there are plenty solutions...

$\endgroup$
0
$\begingroup$

Mathematica can solve this pde :

DSolve[Derivative[2, 0][g][x, y] + Derivative[0, 2][g][x, y] ==0, g, {x, y}]
(* {{g -> Function[{x, y}, C[1][I x + y] + C[2][-I x + y]]}} *)

The solution of your problem is f[x,y]=g[x,y]+y^3 !

$\endgroup$
1
  • $\begingroup$ Yes, I noted this in my question as well. $\endgroup$ Jan 10, 2018 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.