# DSolve and assuming: wrong solution found by Mathematica 6. A bug or

Discussion in 'Mathematica' started by Pianiel, Nov 7, 2008.

1. ### PianielGuest

Hi all,

I tried unsuccessfully to find the solution of a differential equation
using Mathematica 6.0.2.1. The given solution is wrong. Would it be
possible to help me? Here is what I have done:

Knowing that n is an integer, I want to solve the following
differential equation:

DSolve[r^2A''[r]+r A'[r]+(K^2r^2-n^2)A[r]==r( n B1- B2),A[r],r]

So what I wrote is:

Res=Assuming[Element[n,Integers],DSolve[r^2A''[r]+r A'[r]+(K^2r^2-
n^2)A[r]==r( n B1- B2),A[r],r]]

I checked using:

Res /. n -> 1

And the result is Indeterminate! Sad!! (same thing with n->2 or n-
On the contrary when I change directly the value of n in the equation
and set it n=1:

DSolve[r^2 A''[r] + r A'[r] + (K^2 r^2 - 1^2) A[r] == r ( 1 B1 - B2),
A[r], r]

Mathematica find a solution!
Where is the bug? How to find the general solution with n integer
for:

DSolve[r^2A''[r]+r A'[r]+(K^2r^2-n^2)A[r]==r( n B1- B2),A[r],r]

Is Mathematica able to do that??

Pianiel

Pianiel, Nov 7, 2008

2. ### sjoerd.c.devriesGuest

The manual has the following about DSolve and symbolic parameters
(tutorial/DSolveSymbolicAndInexactQuantities):

In summary, the ability to solve differential equations with symbolic
parameters is a powerful and essential feature of any symbolic solver
such as DSolve. However, the following points should be noted.
- The solution might be complicated, and such calculations often
require significant time and memory.
- The answer might not be valid for certain exceptional values of the
parameters.
- The solution might be easy to verify symbolically for some special
values of the parameters, but in the general case a numerical
verification method is preferable.

Cheers -- Sjoerd

sjoerd.c.devries, Nov 16, 2008