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

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

  1. Pianiel

    Pianiel Guest

    Hi all,

    I tried unsuccessfully to find the solution of a differential equation
    using Mathematica 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

    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??

    Thanks somuch for your help!

    Pianiel, Nov 7, 2008
    1. Advertisements

  2. I'm not sure about this, but I don't think DSolve uses assumptions.

    The manual has the following about DSolve and symbolic parameters

    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
    - 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
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.