Ask Your Question
1

Simplifying a simple rational function

asked 2015-11-11 19:21:58 +0100

Erel Segal-Halevi gravatar image

The following code:

var('d,T')
simplify((d^(T + 1)-d)/d)

returns:

(d^(T + 1) - d)/d

Apparently, this should be simplified to:

d^T - 1

What am I doing wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2015-11-11 20:35:52 +0100

B r u n o gravatar image

updated 2015-11-11 20:38:10 +0100

For this expression, you can use simplify_rational() instead of simplify():

sage: var('d, T')
(d, T)
sage: f = (d^(T+1)-d)/d
sage: f.simplify_rational()
d^T - 1

Note that in this case you also have:

sage: f.expand()
d^T - 1

Note that in a more general case, the "most simplified" expression is obtained with the command simplify_full():

sage: f.simplify_full()
d^T - 1
edit flag offensive delete link more

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: 2015-11-11 19:21:58 +0100

Seen: 2,382 times

Last updated: Nov 11 '15