Ask Your Question
1

bug? multiply symbolic exponents

asked 2021-01-01 11:47:14 +0200

gam gravatar image

updated 2021-01-01 12:09:10 +0200

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:
edit retag flag offensive close merge delete

Comments

but

sage: (e^x)^y - e^(x*y)                                                                                                                     
    y       
⎛ x⎞     x⋅y
⎝ℯ ⎠  - ℯ   
sage: simplify(_)                                                                                                                           
0
FrédéricC gravatar imageFrédéricC ( 2021-01-01 12:10:40 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2021-01-01 12:20:22 +0200

Emmanuel Charpentier gravatar image

updated 2021-01-01 21:18:45 +0200

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
edit flag offensive delete link more

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 ( 2021-01-01 14:06:04 +0200 )edit

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: 2021-01-01 11:47:14 +0200

Seen: 354 times

Last updated: Jan 01 '21