On 07/12/2011 06:11 PM, robin hankin wrote:
> Hi.
> 
> 
> The psi function is defined over the entire complex plane.
> 
> But sage doesn't seem to know anything about its properties.
> 
> For example, I happen to know that psi(1-z) == pi/tan(pi*z) + psi(z)
> 
> So I would expect the following sage command:
> 
> sage:  (psi(1-z)- psi(z)-pi/tan(pi*z)).full_simplify()
> 
> [complicated expression deleted].
> 
> 
> to give zero.
> 
> How do I tell sage to simplify this expression?
> 

Slight non-sequitur: is there an easy-to-express notion of which is the
simpler of two expressions in Sage? For example, the way that I'd go
about adding a simplification for this is the following pseudo-code:


  def simplify_psi(expr):
    for v in expr.variables():
      if v is complex:
        # Try to substitute one psi expression for the other.
        simple_expr = expr.subs({psi(1-v): pi/tan(pi*v) + psi(v)})

        # Return the answer if the substitution did any good.
        if simple_expr <simpler than> expr:
          return simple_expr
        else:
          return expr


But generally this transformation would make the expression more
complex. In a few cases, it would wind up simpler; but, how do we tell
which we've just done?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to