Ask Your Question
0

How to simplify fractions?

asked 2017-04-06 10:30:33 -0500

ablmf gravatar image

I have the following expression $$ \frac{\left(-1\right)^{n} - 2 n - 1}{4 {\left(2 n + 1\right)}} $$ It clearly equals $$ \frac{\left(-1\right)^{n}}{4 {\left(2 n + 1\right)}} -\frac 1 4. $$

Is there anyway to make sage show this?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2017-04-06 11:49:16 -0500

ndomes gravatar image

expand the expression and then simplify partially (like transforming by hand)

var('n')
expr = ((-1)^n - 2*n -1) / (4*(2*n + 1))
show(expr)
expr2 = expr.expand()
show(expr2)
expr2.op[0] + sum(expr2.op[1:]).simplify_full()
edit flag offensive delete link more
0

answered 2017-04-19 06:53:34 -0500

Use bool() like so

,var n
f1=((-1)^n-2*n-1)/4/(2*n+1)
f2=(-1)^n/4/(2*n+1)-1/4
show(f1==f2)
bool(f1==f2)
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: 2017-04-06 10:30:33 -0500

Seen: 60 times

Last updated: Apr 19