Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The system can be docoupled

var('th')
s=solve([sin(th)], [th], to_poly_solve='force')[0];s

th == pi*z1698

(z1698 is an arbitrary integer constant)

Easy access to the constant:

k=s.rhs().variables()[0];k

z1698

Second equation is x=cos(th)

assume(k,'integer')
cos(pi*k).full_simplify()

(-1)^z1698

The system can be docoupled

var('th')
s=solve([sin(th)], [th], to_poly_solve='force')[0];s

th == pi*z1698

(z1698 is an arbitrary integer constant)

Easy access to the constant:To obtain nicer output:

k=s.rhs().variables()[0];k
var('k')
assume(k,'integer')
z=s.rhs().variables()[0]
th==s.rhs().subs(z==k)
 z1698
th == pi*k

x==cos(s.rhs().subs(z==k)).full_simplify()

x == (-1)^k

Second equation is x=cos(th)

assume(k,'integer')
cos(pi*k).full_simplify()

(-1)^z1698