1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – Nasser
    Commented Apr 24, 2020 at 4:56
  • $\begingroup$ @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]. $\endgroup$
    – Real Noob
    Commented Apr 24, 2020 at 4:59

3 Answers 3

0
$\begingroup$

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.

$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – Real Noob
    Commented Apr 24, 2020 at 5:14
  • $\begingroup$ 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. :). $\endgroup$
    – Real Noob
    Commented Apr 24, 2020 at 5:19
  • $\begingroup$ @RealNoob let me see. $\endgroup$
    – Nasser
    Commented Apr 24, 2020 at 5:19
  • $\begingroup$ Thanks. I tried using Eliminate but it only works with equations and not expressions. :) $\endgroup$
    – Real Noob
    Commented Apr 24, 2020 at 5:20
1
$\begingroup$

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?

$\endgroup$
1
$\begingroup$

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!

$\endgroup$

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