Ask Your Question

Jeremie's profile - activity

2023-03-19 15:30:03 +0200 received badge  Notable Question (source)
2023-03-19 15:30:03 +0200 received badge  Popular Question (source)
2014-02-20 22:49:58 +0200 asked a question Determine rationality of an expression?

I am trying to determine whether an expression is rational or not - and if it rational, to get the numerator and denominator.

To give you some context, I first use "solve" to get a [ x == ..., y == ... ] solution, and then I compute log(solution[x])/log(solution[y]). In some cases, this expression is a rational. I would like to be able to determine when it is a rational.

Of course it is rational in some very predictable cases - i.e., when the two logarithms are commensurate, and there are ways of checking this on the value of solution[x] and solution[y] themselves. But I am hoping that sage can do this for me.

I tried to do Rational((log(...)/log(...)).n()) or (log(...)/log(...)).n() in QQ, but of course that does not work, as .n() converts the expression to some arbitrary precision float. Doing (log(...)/log(...)) in QQ always returns False even, for instance, for the case (log(100)/log(10)) = 2.

How can I do this?

2014-01-16 22:00:20 +0200 received badge  Supporter (source)