Ask Your Question

# Sage doesn't simplify a fraction if it's multiplied by 2

Hello, for some reason sage doesn't simplify a trigonometric expression:

sage: ( 2 * (1-cos(x)) / sqrt(1-cos(x)) ).simplify_full()
-2*(cos(x) - 1)/sqrt(-cos(x) + 1)


while I'd expect sqrt(1-cos(x)).

I also tried a nice simplify_chain_real function (thanks eric_g for the hint) but I've got the same result:

sage: from sage.manifolds.utilities import simplify_chain_real
sage: simplify_chain_real( 2 * (1-cos(x)) / sqrt(1-cos(x)) )
-2*(cos(x) - 1)/sqrt(-cos(x) + 1)


The weird thing is that it works without the 2* part:

sage: ( (1-cos(x)) / sqrt(1-cos(x)) ).simplify_full()
sqrt(-cos(x) + 1)


And even replacing - with + makes it working:

sage: ( 2*(1+cos(x))/sqrt(1+cos(x)) ).simplify_full()
2*sqrt(cos(x) + 1)


I mean, obviously, it can do that kind of simplification. But I can't make it simplify the 2*(1-cos(x))/sqrt(1-cos(x)) expression. What do I miss?

edit retag close merge delete

## 1 Answer

Sort by ยป oldest newest most voted

Probable maxima idiosyncrasy :

sage: E=2*(1-cos(x))/sqrt(1-cos(x))
sage: E.simplify_full()
-2*(cos(x) - 1)/sqrt(-cos(x) + 1)
sage: (E/2).simplify_full()*2
2*sqrt(-cos(x) + 1)
sage: import sympy
sage: sympy.sympify(E).simplify()._sage_()
2*sqrt(-cos(x) + 1)

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2018-12-03 04:22:20 +0200

Seen: 387 times

Last updated: Dec 03 '18