# how to solve a Partial Differential equations numerically of the kind given below [closed]

eq=D[f[x,y],y]+ f[x,y]/y == Q[x,y]


The equation doesn't have any derivative with respect to x. If I use the following syntax for NDSolve will it give me the correct result?

NDSolve[{eq, boundary condition},{x,x_min,x_max},{y,y_min,y_max}]

• Have you defined the value of $Q$? NDSolve is a numerical solver so everything must reduce to a numerical value for it to work. Also, have you tried to run your syntax and see what happens? – MarcoB Feb 7 at 13:52
• Yes, I have defined Q numerically. My syntax is working but the answer I am getting from it is not the one I am looking for. I want to know if this syntax works properly for my differential equation. – Prantik Sarmah Feb 8 at 11:15
• Prantik, you should include the definition of $Q$, the results you get from the NDSolve, and your reason why those results do not make sense to you. Itâ€™s hard to help further otherwise. – MarcoB Feb 8 at 17:58
• The form of Q is "y x^-2" kind. The exact expression is difficult to write here. – Prantik Sarmah Feb 10 at 4:19

Some insight can be obtained by solving this differential equation symbolically.

DSolveValue[eq, f[x, y], {x, y}]
(* C[1][x]/y + Inactive[Integrate][K[1]*Q[x, K[1]], {K[1], 1, y}]/y *)


If Q[x,y] is given by y/x^2, the solution reduces to

(* y^2/(3*x^2) + C[1][x]/y *)


And, to answer the question explicitly posed, the code in the question should yield the correct answer, barring numerical instabilities and the like.

• Thank you very much for your help – Prantik Sarmah Feb 12 at 6:04