1

I'm working on a code to display(Print[]) the answers of some excercises for my students. Some of the answers have parts like 1/Cot(x). I want to prevent Mathematica to transform this expression into Tan(x).

I've tried (as a suggestion from another thread)

Simplify[1/Cot[y], Trig -> False]

But it doesn't work. I can't use Hold[] either because the expression is making reference to a previous calculation and I need to evaluate it. Any tips?? I have Mathematica 11.2 and pardon my english. Thanks!!

  • For some reason when I apply Style to Print it display it as I wanted but I don't understand why. If I have the code
    Print[1/Cot[y]]
    

    It doesn't work, it just display Tan[y] but If I have

    Print[1/Style[Cot[y], Hue[0.5]]]
    
    

    Then it does display 1/Cot[y]

    Not sure why this is the case

    – Alberto Sierraalta Jun 10 '21 at 00:04
  • do not think there is a way. You can do tricks like $PrePrint = # /. {1/Cot[z_] :> 1/Defer@Cot[z]} &; then 1/Cot[y] will remain as is, but then Tan[x] will now will become 1/Cot[x] as well, which is probably not what you want. – Nasser Jun 10 '21 at 00:35
  • Chip's answer in the linked question should do what you want. If it doesn't, edit your question to explain why and we can reopen. – J. M.'s missing motivation Jun 10 '21 at 01:22

0 Answers0