Ask Your Question
2

Simplify expressions with more variables related to each other?

asked 2016-11-12 16:21:32 +0100

Thrash gravatar image

updated 2016-11-12 16:32:22 +0100

Is it possible to simplify expressions with more variables such like

(x^3 + 2x + 1)/y where y^2 = x^3 + x +1?

Using the relation between x and y the expression then becomes

(x^3 + x + 1 + x)/y = (y^2 + x)/y = y + x/y

Is it possible in Sage? Is Sage able to check in which form the expression (only in x, only in y, mixing) is the simplest?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-12 17:46:20 +0100

tmonteil gravatar image

It is doable as follows. Assuming that y^2 = x^3 + x +1 is like working in a quotient polynomial ring modulo the ideal generated by -y^2 + x^3 + x +1. To be able to make polynomial divisions, you just have to extend your quotient polynomial ring into its fraction field:

sage: R = PolynomialRing(QQ,'x,y') ; R
Multivariate Polynomial Ring in x, y over Rational Field
sage: R.inject_variables()
Defining x, y
sage: I = R.ideal([-y^2 + x^3 + x +1]) ; I
Ideal (x^3 - y^2 + x + 1) of Multivariate Polynomial Ring in x, y over Rational Field
sage: Q = R.quotient(I) ; Q
Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^3 - y^2 + x + 1)
sage: F = Q.fraction_field() ; F
Fraction Field of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^3 - y^2 + x + 1)
sage: F((x^3 + 2*x + 1)/y)
(ybar^2 + xbar)/ybar
edit flag offensive delete link more

Comments

Thanks!

What if I have a relation, for example between x, y and an additional k, and I want that output of the simplified expression to be the simplest with respect to x and y as above (because I consider k just a parameter)? In other words: For example, is a parameter-dependent ideal

sage: I = R.ideal([-y^2 + x^3 + k*x +1])

be possible if R stays the same as defined originally? Or do I have to match anything in order to get what I want?

Thrash gravatar imageThrash ( 2016-11-12 20:16:29 +0100 )edit

I guess it depends on what you want. For example, if you add k as an undeterminate in the polynomial ring R, you will get:

sage: F((x^3 + 2*x + 1)/y)
(ybar^2 - xbar*kbar + 2*xbar)/ybar

If you want to try for some small integer values of k, you can just make a loop.

tmonteil gravatar imagetmonteil ( 2016-11-12 21:50:23 +0100 )edit

I also thought about just putting additional parameters/variables into the polynomial ring. It seems to work, thanks! The simplifications I tried exemplarily are usable.

Is there a way to substitute xbar by x (visually) and so on?

Thrash gravatar imageThrash ( 2016-11-12 22:32:53 +0100 )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

1 follower

Stats

Asked: 2016-11-12 16:12:07 +0100

Seen: 423 times

Last updated: Nov 12 '16