Ask Your Question
2

How to simplify fractions?

asked 2017-04-06 17:30:33 +0100

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
1

answered 2017-04-06 18:49:16 +0100

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 13:53:34 +0100

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 17:30:33 +0100

Seen: 1,762 times

Last updated: Apr 19 '17