Just finished coding a method (named it 'expansion') to giv the above 
desired result. Example of input-output ->

>>> expansion((x+y)**2)
x**2 + 2*x*y + y**2
>>> expansion((3*a+2*b)**2)
9*a**2 + 12*a*b + 4*b**2
>>> expansion((x+y)**0.2)
x**0.2 + 0.2*x**-0.8*y - 0.08*x**-1.8*y**2 + 0.048*x**-2.8*y**3 - 
0.0336*x**-3.8*y**4 + 0.025536*x**-4.8*y**5 + O(y**6)
>>> expansion((3*x+y+z+2)**3.4)
(3*x + z + 2)**3.4 + 3.4*y*(3*x + z + 2)**2.4 + 4.08*y**2*(3*x + z + 
2)**1.4 + 1.904*y**3*(3*x + z + 2)**0.4 + 0.1904*y**4*(3*x + z + 2)**-0.6 - 
0.022848*y**5*(3*x + z + 2)**-1.6 + O(y**6)

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sympy/-/Nl7QgQG2fecJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to