Python | sympy.expand_power_base() method
Last Updated :
25 Jun, 2019
With the help of sympy.expand_power_base()
method, we can simplify the powers of mathematical expression by using sympy.expand_power_base()
method.
Syntax : sympy.expand_power_base()
Return : Return the simplified mathematical expression using base.
Example #1 :
In this example, we can see that by using sympy.expand_power_base()
method, we are able to simplify the powers of mathematical expression using base.
from sympy import *
x, y = symbols( 'x y' )
gfg_exp = x * * 2 + 2 * x * y + y * * 2
fact = expand_power_base(gfg_exp)
print (fact)
|
Output :
x**2 + 2*x*y + y**2
Example #2 :
from sympy import *
x, y, z = symbols( 'x y z' )
gfg_exp = x * * (a + b)
fact = expand_power_base(gfg_exp)
print (fact)
|
Output :
x**a*x**b
Share your thoughts in the comments
Please Login to comment...