Your replies are the best way to learn more about sympy, thanks!!

On Tue 23. May 2023 at 20:21, Oscar Benjamin <[email protected]>
wrote:

> On Tue, 23 May 2023 at 06:51, Paul Royik <[email protected]> wrote:
> >
> > How do I simplify the following expressions: i**(-2*i), (-i)**(-2*i),
> ((-sqrt(3) - i)/2)**(-2*i), ((sqrt(3) - i)/2)**(-2*i) ?
> >
> > Is there any built-in function?
> >
> > For example, i**(-2*i) should give e^pi and ((sqrt(3) - i)/2)**(-2*i)
> should give e^(-pi/3).
>
> The word "simplify" is ambiguous but I assume from your examples that
> what you want is to rewrite powers as exponentials if possible. If so
> that can be done with e.rewrite(exp):
>
> >>> from sympy import *
> >>> i = I
> >>> a =  i**(-2*i), (-i)**(-2*i), ((-sqrt(3) - i)/2)**(-2*i), ((sqrt(3) -
> i)/2)**(-2*i)
> >>> [ai.rewrite(exp) for ai in a]
> [exp(pi), exp(-pi), exp(-5*pi/3), exp(-pi/3)]
>
> --
> Oscar
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHVvXxSjECmJoTVL6SJ27uzYrXHOWUiqKaMTK0gW6LfJXJrsfQ%40mail.gmail.com
> .
>
-- 
Best regards,

Peter Stahlecker

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CABKqA0YVZi86WZw8nZSsHfaXPrWo4yxZ%2B1uMV7ZFU9ZCfc%3DBpg%40mail.gmail.com.

Reply via email to