# How do I enforce this boundary condition?

I am solving this differential equation:

(1 - 2 M/r) D[(1 - (2 M)/r) D[q[r], r], r] - (1 - 2 M/r) ((l (l + 1))/r^2 - (6 M)/r^3) q[r]


with the boundary conditions that q[0]==0 and $$q\rightarrow\dfrac{1}{r^l}$$ at infinity. How do I enforce the second condition?

• Do you need a symbolic solution or numeric solution? If the latter, what's the value of those paremeters? – xzczd Oct 9 '20 at 2:25
• @xzczd I need a numerical solution. You can set M=1 and l=2 – mattiav27 Oct 9 '20 at 4:41
• If $l=2$, isn't the b.c. at infinity equivalent to $q(\infty)=0$? – xzczd Oct 9 '20 at 5:08
• @xzczd I am following this paper articles.adsabs.harvard.edu/pdf/1978ApJ...224..643C (page 4 of 25) They say to impose that b.c. – mattiav27 Oct 9 '20 at 5:39
• The output of AsymptoticDSolveValue[{(1 - (2 M)/r) D[(1 - (2*M)/r)*D[q[r], r], r] - (1 - (2 M)/r) ((l (l + 1))/r^2 - (6 M)/r^3) q[r] == 0(*,q[0]\[Equal]0*)}, q@r, {r, Infinity, 1}] seems to suggest such solution doesn't exist… Perhaps there's some deeper math here? Or the paper is wrong? – xzczd Oct 9 '20 at 6:00

Mathematica's result doesn't really make sense with the paper you reference. We can solve the ode without boundary conditions.

ode = (1 - (2*M)/r)*D[(1 - (2*M)/r)*D[q[r], r], r] -
(1 - (2*M)/r)*((l*(l + 1))/r^2 - (6*M)/r^3)*q[r] == 0

\$Assumptions = r >= 0 && M > 0

sol = DSolve[ode, q[r], r] // Flatten // FunctionExpand


We get hypergeometric functions, but they simplify if we define $$l$$.

For $$l=2$$

sol /. l -> 2 // Simplify


$$\left\{q(r)\to c_2 \left( \begin{array}{cc} \{ & \begin{array}{cc} \frac{r^3}{8 M^3} & r<2 M \\ 0 & r>2 M \\ \text{Indeterminate} & \text{True} \\ \end{array} \\ \end{array} \right)-\frac{c_1 r^3}{8 M^3}\right\}$$

We can make $$q=0$$ for $$r<2M$$ by setting $$c_1=c_2$$, but for $$r>2M$$ we get a solution proportional to $$r^3$$ which will not satisfy your boundary at infinity.

• DSolveValue[ode /. l -> 2, q[r], r] gives a different answer, r^3 C[1] + (C[2] (12 M^4 + 8 M^3 r + 6 M^2 r^2 + 6 M r^3 - 3 r^4 Log[r] + 3 r^4 Log[-2 M + r]))/(96 M^5 r). The discrepancy is due to a bug in Mathematica that I reported to Wolfram Inc over three years ago. See 138440. Simply stated, Mathematica has given you only one independent solution instead of two due to this bug. I agree, though, that this problem has no solution for the boundary conditions specified. – bbgodfrey Oct 10 '20 at 1:14