simplify

34 views
Skip to first unread message

Ingo Dahn

unread,
Dec 29, 2016, 4:48:00 AM12/29/16
to sage-support
Hi,
I am not sure what simplify does. For example

q=(x^2+4*x+4)/(x+2)^2
simplify(q)

doesn't do any simplification, while
factor(q) yields 1.

According to tab completion SageCell doesn't seem to support any other form of simplify. Is there any strategy to combine Sage commands in order to simplify rational function expressions?
Ingo

Dima Pasechnik

unread,
Dec 29, 2016, 8:19:30 AM12/29/16
to sage-support
For rational functions you'd rather want to work with polynomials, not (symbolic) functions.
sage: R.<x>=QQ[]
sage: q=(x^2+4*x+4)/(x+2)^2
sage: q
1
sage: q=(x^2+4*x+4)/(x+2)^3
sage: q
1/(x + 2)
sage: q.parent()
Fraction Field of Univariate Polynomial Ring in x over Rational Field

Michael Orlitzky

unread,
Dec 29, 2016, 10:22:39 AM12/29/16
to sage-s...@googlegroups.com
On 12/29/2016 04:48 AM, Ingo Dahn wrote:
>
> According to tab completion SageCell doesn't seem to support any other form
> of *simplify*. Is there any strategy to combine Sage commands in order to
> simplify rational function expressions?

Plain "simplify" won't do much on its own. I guess it's only a top-level
function (as opposed to a method) because users of Mathematica and
friends will expect it to be there. But the good stuff can be found as
methods on the expression object:

sage: q=(x^2+4*x+4)/(x+2)^2
sage: q.simplify_full()
1

Reply all
Reply to author
Forward
0 new messages