#16813: symbolic Legendre / associated Legendre functions / polynomials
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.4
      Component:  symbolics          |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/rws/symbolic_legendre___associated_legendre_functions___polynomials|  
0f86b77a9aa818add6848cacf9a3f371d49c7d3a
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by maldun):

 Oh yeah it's again the non uniqueness of the representation of the complex
 logarithm

 {{{
 sage: log((x+1)/(1-x)).subs(x=3)
 I*pi + log(2)
 sage: (log(x+1)-log(1-x)).subs(x=3).simplify_log()
 -I*pi + log(2)
 sage: log((x+1)/(1-x)).subs(x=3).conjugate()
 -I*pi + log(2)
 }}}

 confusing as hell ...

 I think Wolfram uses the log(1+x)-log(1-x) representation simply by the
 fact that it is independent of the branch in the following sense:
 Let log(x) = ln|x| + i*arg(x) + 2kπi and log(y) = ln|y| + i*arg(y) + 2kπi
 then
 {{{
 log(x) - log(y) = ln|x| + i*arg(x) + 2kπi- ln|y| + i*arg(y) + 2kπi =
 = ln|x/y| + i*(arg(x) - arg(y)) + 0
 }}}
 I.e. if we have the same branch on the logarithm the module of 2kπi
 cancels out.

 That means the formula isn't exactly wrong, it uses simply a different
 branch of the logarithm. But the representation of log as difference saves
 us indeed a lot of trouble, and as showed above is independent of the
 branch we use.

 Nevertheless I think we should stick to the recursion with W(n,x), because
 from a computational view it is a lot better since:

 1) The computational complexity is the same (solving a two term recursion)

 2) we save computation time since we don't have to simplify expressions
 containing logarithms but only polynomials which are much simpler to
 handle and expand.

--
Ticket URL: <http://trac.sagemath.org/ticket/16813#comment:24>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to