Ask Your Question
0

Simplifying a simple rational function

asked 2015-11-11 12:21:58 -0500

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
4

answered 2015-11-11 13:35:52 -0500

B r u n o gravatar image

updated 2015-11-11 13:38:10 -0500

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 12:21:58 -0500

Seen: 290 times

Last updated: Nov 11 '15