1

I am new to using calc. Is it possible that the evaluation of ((x-1)/(x+1))+((x+1)/(x-1))=> returns ((x-1)/(x+1))+((x+1)/(x-1))=>(2 x^2 + 2) / (x^2 - 1)

  • Looking at the Simplifying Formulas chapter of the Calc manual, I didn't find anything that would do that. – NickD Jun 26 '19 at 19:19
  • I think it should be possible since nrat can produce the output. – gigiair Jun 27 '19 at 7:13
  • Indeed - I didn't find nrat because I didn't look at the right place - of course, after @Tobias pointed it out, my hindsight increased to 20/20 :-). – NickD Jun 27 '19 at 13:26
3

Original question:

Is it possible that the evaluation of ((x-1)/(x+1))+((x+1)/(x-1))=> returns ((x-1)/(x+1))+((x+1)/(x-1))=>(2 x^2 + 2) / (x^2 - 1)

The calc function nrat transforms its expression argument to a rational expression.

You can try nrat(((x-1)/(x+1))+((x+1)/(x-1))) with
M-: (calc-eval "nrat(((x-1)/(x+1))+((x+1)/(x-1)))")

The result is:

(2*x^2 + 2) / (x^2 - 1)

If you prefer to work with the Calc stack you can put ((x-1)/(x+1))+((x+1)/(x-1)) on the stack with the help of algebraic input '. Afterwards type a for Algebraic simplifications and n for Normalize rational expression.

| improve this answer | |
  • Nice! I missed that. – NickD Jun 27 '19 at 4:43
  • I know that, but that doesnt answer my question. I want to have an output like 2:3+3:4=> : \evalto \frac{2}{3} + \frac{3}{4} \to \frac{17}{12} in LaTeX mode. – gigiair Jun 27 '19 at 6:32
  • But that is NOT what you asked. – NickD Jun 27 '19 at 13:28
  • Sorry, but I do not speak English fluently. The workaround I found is to evaluate (for example) $ ((x - 1) / (x + 1)) + ((x + 1) / (x - 1)) = nrat (((x - 1) / (x + 1)) + ((x + 1) / (x - 1))) $ which returns $ frac {x - 1} {x + 1} + \ frac {x + 1} {x - 1} = \ frac {2 x ^ 2 + 2} {x ^ 2 - 1} $ in a LaTeX document with embedded calc. I think it can exist better solution. – gigiair Jun 30 '19 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.