I tried using Mathematica 11 to solve a Sturm-Liouville problem:

DSolve[{r f''[r] + f'[r] - r^3 f[r] + (4 k - 2 ) r f[r] == 0}, 
f[r], {r, 0, \[Infinity]}, 
Assumptions -> k \[Element] Integers && k <= 0]

But I got two linearly dependent solutions:

{{f[r] -> 
Sqrt[2] E^(r^2/2) (C[1] HypergeometricU[k, 1, -r^2] + C[2] LaguerreL[-k, -r^2])}}

(It is true that for non-negative integer values of a:

 LaguerreL[a , z] = C(a) HypergeometricU[-a, 1, z]

Where C(a) is some constant, so the solutions really are the same...)

I don't know if it is relevant, but this equation is a special case of a more complicated one from which I started, in which I got 2 linearly independent solutions, both of which converged to this identical solution above. That equation was:

DSolve[r f''[r] + f'[r] - b^2 r^-1 f[r] - r^3 f[r] + k r f[r] == 0,
f[r], {r, 0, \[Infinity]}]

And it reduces to the problematic equation by taking b->0

What did I do wrong?



1 Answer 1


Assumptions on negative k are not used.

You get same solution without the assumption (I think using assumptions with DSolve does not always go through, or are ignored), there are number of posts related to this.

DSolve[{r f''[r]+f'[r]-r^3 f[r]+(4 k-2) r f[r]==0},f[r],r,

Mathematica graphics

You get same solution without the assumption on k

DSolve[{r f''[r] + f'[r] - r^3 f[r] + (4 k - 2 ) r f[r] == 0}, f[r], r]

Mathematica graphics

To check for L.I. using the Wronskian

f1 = (Sqrt[2]*E^(r^2/2)*Sqrt[r^2]*HypergeometricU[k, 1, -r^2])/r
f2 = (Sqrt[2]*E^(r^2/2)*Sqrt[r^2]*LaguerreL[-k, -r^2])/r; 
mat = {{f1, f2}, {D[f1, r], D[f2, r]}}; 
w = Det[mat]

Mathematica graphics

Now we can look at L.I. or not for different k.

 Plot[w /. k -> 1, {r, 0, 5}]

Mathematica graphics

Not zero. Hence L.I. for positive k.

  Plot[w /. k -> -1, {r, 0, 5}]

But for negative k they are L.D.

Mathematica graphics

The whole point is that assumptions on k are not used when finding the solution.

Compare to Maple solution, which also behaves the same way, but in reverse. Maple gives two L.I. solutions for negative k but not for positive k.

Maple gives this solution to the ODE

Mathematica graphics

But the Wronskian is zero for positive k and non-zero for positive k.

Mathematica graphics

Mathematica graphics

So if you want solution for negative k, use Maple's solution. For positive k, use Mathematica's solution.

Assumptions on k do not change the solution either in Maple, just like with Mathematica. So I do not think this is a bug.


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.