1

I want to simplify the following Trigonometric expression so that it no longer contains Tan[a] and Cot[a]. How can I do that?

FullSimplify[Tan[a]/(1 - Cot[a]) + Cot[a]/(1 - Tan[a])] will give me 1 + Cot[a] + Tan[a]. I want to get rid of Cot[a] and Tan[a] in the final expression.

Thanks.

Real Noob
  • 219
  • 1
  • 5
  • I must be missing something. How do get rid of these? Let Tan[a]=x, then the final expression is 1+1/x+x. What do you mean by get rid of x in this? Only when x=I or x=-I where I is sqrt(-1) will you get rid of x. But Tan[x] can never be complex. – Nasser Apr 24 '20 at 04:56
  • @Nasser Is there any way to force Mathematica to write 1 + Cot[a] + Tan[a] in form or Sec[a] and Csc[a]? That would eliminate Cot[a] and Tan[a]. – Real Noob Apr 24 '20 at 04:59

3 Answers3

1

You can reduce to Sin and Cos with ComplexExpand, if you want to pay the price, to have twice the variable in argument.

Tan[a] // ComplexExpand

(*    Sin[2 a]/(1 + Cos[2 a])   *)

Tan[a]/(1 - Cot[a]) + Cot[a]/(1 - Tan[a]) // ComplexExpand

(*   Sin[2 a]/((1 + Cos[2 a]) (1 + Sin[2 a]/(-1 + Cos[2 a]))) - 
     Sin[2 a]/((-1 + Cos[2 a]) (1 - Sin[2 a]/(1 + Cos[2 a])))   *)

Then simplify to single argument with TrigExpand. But is this realy satisfying?

Akku14
  • 17,287
  • 14
  • 32
1

You have already got several very good answers. Just for the sake of completeness let me give one more

g[e_] := 10*Count[e, _Tan || _Cot, Infinity];

FullSimplify[Tan[a]/(1 - Cot[a]) + Cot[a]/(1 - Tan[a]), 
 ComplexityFunction -> g]

(*  1/2 Csc[a] Sec[a] (2 + Sin[2 a])  *)

Have fun!

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96
0

Is there any way to force Mathematica to write 1 + Cot[a] + Tan[a] in form or Sec[a] and Csc[a]? That would eliminate Cot[a] and Tan[a]

Yes, if this is what you meant.

 ClearAll[a];
 Simplify[TrigReduce[Tan[a]/(1 - Cot[a]) + Cot[a]/(1 - Tan[a])]]

Mathematica graphics

The only other way to do in general is like this

ClearAll[a, x];
expr = Tan[a]/(1 - Cot[a]) + Cot[a]/(1 - Tan[a]);
expr /. {Tan[x__] :> HoldForm@(Sin[x]/Cos[x]), Cot[x__] :>  HoldForm@(Cos[x]/Sin[x])}

Mathematica graphics

This should work for any expression. But note that if you want to do anything with that expression, then you need to release the hold at that moment. Using ReleaseHold[...].

As I mentioned in comment, I do not know how this can be done in general. There might be a way to do it using special transformation rules passed to Simplify, since Simplify in general uses LeafCount to simply expressions.

I tried TransformationFunctions but could not make it work. I think this is because Mathematica will write Sin[x]/Cos[x] back to Tan[x] immediately. I am out of my bag of ticks.

Nasser
  • 143,286
  • 11
  • 154
  • 359
  • Thanks @Nasser. However, this approach will most probably not work on all expressions that involve Tan[a] and Cot[a]. I am looking for a general solution that will eliminate Tan[a] and Cot[a] in every expression that I pass to it. – Real Noob Apr 24 '20 at 05:14
  • I was hoping that Mathematica could somehow turn 1 + Tan[x] into something like (Sin[x] + Cos[x])/Cos[x]. As long as there is no Tan[x] and Cot[x]. I will be happy. :). – Real Noob Apr 24 '20 at 05:19
  • @RealNoob let me see. – Nasser Apr 24 '20 at 05:19
  • Thanks. I tried using Eliminate but it only works with equations and not expressions. :) – Real Noob Apr 24 '20 at 05:20