1
$\begingroup$

Suppose I want to numerically calculate a PDE as following $$a\frac{\partial^2}{\partial x^2}f(x)+\frac{b}{x}\frac{\partial }{\partial x}f(x)+c=0, x\in (-1, 1)$$ where $a$, $b$, $c$ are constants. So basically, the PDE has a singularity at $x=0$. Now since I don't know the principle behind the numerical calculations. I wonder, can I avoid the singularity simply by multiplying $x$ at both sides, namely $$ax\frac{\partial^2}{\partial x^2}f(x)+b\frac{\partial f(x)}{\partial x }+cx=0?$$

$\endgroup$
2
  • $\begingroup$ Note that either way f[x] -> (x (-c x + (2 a (a + b) x^(-(b/a)) C[1])/(a - b)))/( 2 (a + b)) + C[2] $\endgroup$
    – Feyre
    Jul 11, 2016 at 10:20
  • 1
    $\begingroup$ You seem to ask about solving an ODE numerically but accepted an answer that solve it symbolically. The question and answer seem unrelated, except that they are about the same ODE. Please clarify. Is the question how to solve this ODE, or about how numerical solvers work? $\endgroup$
    – Michael E2
    Jul 11, 2016 at 18:42

1 Answer 1

1
$\begingroup$

As you might expect: the solution itself has a singularity at $x=0$.

Solving either PDE gives the same solution:

DSolve[a x D[f[x], x, x] + b D[f[x], x] + c x == 0, f[x], x]

{{f[x] -> (x (-> c x + (2 a (a + b) x^(-(b/a)) C1)/(a - b)))/(2 (a + b)) + C[2]}}

The function has the form:

enter image description here

Which, as you can see has no value for $x=0$.

I wouldn't normally be so quick to multiply out the $x$, but in this case it's possible.

$\endgroup$

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.