Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The first case works for me

sage: L.<w, x, y, z> = LazyPowerSeriesRing(QQ)
....: f = exp(w + x + y + z)
....: g = cos(-w + 2 * x - z)
sage: f
1 + (w+x+y+z) + (1/2*w^2+w*x+1/2*x^2+w*y+x*y+1/2*y^2+w*z+x*z+y*z+1/2*z^2) + (1/6*w^3+1/2*w^2*x+1/2*w*x^2+1/6*x^3+1/2*w^2*y+w*x*y+1/2*x^2*y+1/2*w*y^2+1/2*x*y^2+1/6*y^3+1/2*w^2*z+w*x*z+1/2*x^2*z+w*y*z+x*y*z+1/2*y^2*z+1/2*w*z^2+1/2*x*z^2+1/2*y*z^2+1/6*z^3) + ... + O(w,x,y,z)^7
sage: g
1 + ... + O(w,x,y,z)^7
sage: f/g
1 + (w+x+y+z) + (w^2-w*x+5/2*x^2+w*y+x*y+1/2*y^2+2*w*z-x*z+y*z+z^2) + (2/3*w^3-w^2*x+1/2*w*x^2+13/6*x^3+w^2*y-w*x*y+5/2*x^2*y+1/2*w*y^2+1/2*x*y^2+1/6*y^3+2*w^2*z-2*w*x*z+1/2*x^2*z+2*w*y*z-x*y*z+1/2*y^2*z+2*w*z^2-x*z^2+y*z^2+2/3*z^3) + ... + O(w,x,y,z)^7

For the second case, if your equations are polynomials, you can use resultants to find polynomial equations that each variable satisfies then solve from there. If not, I am afraid there's not much better ways... maybe still use resultant symbolically first before using power series ring.