Ask Your Question
1

bug? multiply symbolic exponents

asked 4 years ago

gam gravatar image

updated 4 years ago

FrédéricC gravatar image

Is this a bug ?

sage: var('a b c x y z')
(a, b, c, x, y, z)
sage: assert( (e^x)^y == e^(x*y) )
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/Users/marks/mysage/sage-9.0/local/lib/python3.7/site-packages/sage/all_cmdline.py in <module>()
----> 1 assert( (e**x)**y == e**(x*y) )

AssertionError: 
sage: assert( (e^2)^3 == e^(2*3) )
sage:
Preview: (hide)

Comments

but

sage: (e^x)^y - e^(x*y)                                                                                                                     
    y       
 x     xy
⎝ℯ   -    
sage: simplify(_)                                                                                                                           
0
FrédéricC gravatar imageFrédéricC ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

Emmanuel Charpentier gravatar image

updated 4 years ago

Not necessarily true. See sympy's documentation for a nice abstract on the problems...

EDIT : This is the third case mentioned in the pointed documentation :

sage: bool((x^a)^b==x^(a*b))
False
sage: with assuming(b,"integer"): bool((x^a)^b==x^(a*b))
True
Preview: (hide)
link

Comments

A nice beginning to 2021: this answer led me to some new-to-me math, to a new appreciation of sage/sympy, and to gratitude for this forum. Thanks--and happy new year!

gam gravatar imagegam ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 4 years ago

Seen: 711 times

Last updated: Jan 01 '21