# Mathematica Sec and Csc

How can I prevent Mathematica from using the "old fashioned" functions "Sec" and "Csc"?

In Germany these functions are "old fashioned" as they are not taught anymore at school.

• Those functions are no more "old fashioned" than logarithms and cotangents.
– Siminore
Commented Jul 2, 2012 at 9:12
• @Nunoxic: I don't know about the "old fashioned" bit, but I perhaps Klaus (like myself) would simply prefer seeing expressions like "$\frac{x + y}{\sin x \cos y}$" rather than "$(x+y)\csc x \sec y$".
– Day Late Don
Commented Jul 2, 2012 at 9:17
• @Siminore Your statement is not true. At least here in Germany, nowadays nobody will use Sec or Csc.
– user1642
Commented Jul 2, 2012 at 10:17
• @Siminore: Csc, Sec are hardly much used in any parts of the world, at any level of school, not only in Germany. In Italy and Switzerland they are not used at all (they where mentioned once in the entire curriculum up to a M.Sc. at the Swiss Federal Institute of Technology, and they where not even taught in the USA when I was there), and hardly anyone uses them in the technics / physics. The reason being: they mostly worsen the readability of complex formula... Even though I know how to handle them, I hate them!! Commented Dec 1, 2016 at 1:48
• I want to add my voice to those who do not like Ccs and sec. Whenever I see them I have in my mind convert them to normal sin/cos. I wish Mathematica does not use them either. Commented Apr 7, 2017 at 4:21

This is similar to my Log question and similar methods can be used.

$PrePrint = # /. { Csc[z_] :> 1 / Defer@Sin[z], Sec[z_] :> 1 / Defer@Cos[z] } &;  Example: (x + y) Csc[x] Sec[y]  (x + y)/(Cos[y] Sin[x])  • why not close then? – rm -rf Commented Jul 2, 2012 at 13:42 • @R.M well I meant similar in the generic sense. I see this as a closely related but at present different question, and someone may post an answer that goes much deeper than my simple one. Perhaps if that doesn't happen this question can be merged with mine and become a second example. Commented Jul 2, 2012 at 14:07 • This was useful. Some, like me, will want to extend this to Cot, as follows. $PrePrint = # /. { Csc[z_] :> 1 / Defer@Sin[z], Sec[z_] :> 1 / Defer@Cos[z], Cot[z_] :> Defer@Cos[z] / Defer@Sin[z] } &; Commented Mar 10, 2015 at 3:10

Using the neat trick Chip showed in this answer:

SetSystemOptions["SimplificationOptions" -> "AutosimplifyTrigs" -> False];

TrigFactor[(x + y) Csc[x] Sec[y]]
(x + y)/(Cos[y] Sin[x])

TrigFactor[Sec[t]^2]
1/Cos[t]^2

• The AutosimplifyTrigs option is ignored by Simplify and FullSimplify, which still return Csc, Cot, Sec. Instead, Mr. Wizard solution works in that case too. Commented May 25, 2022 at 12:41

According to this MathGroup post, it's possible to get rid of the superfluous Csc and Sec by doing the following:

Unprotect[Csc, Sec];
Format[Csc[x_]] := HoldForm[1/Sin[x]];
Format[Sec[x_]] := HoldForm[1/Cos[x]];
Protect[Csc, Sec];


That old solution at least gives you the following:

Csc[t]


$\frac{1}{\sin(t)}$

Sec[t]


$\frac{1}{\cos(t)}$

but it still won't be able to print out

$\frac{1}{\cos^2(t)}$

if you type in Sec[t]^2. Instead you get

$\left(\frac{1}{\cos(t)}\right)^2$

But maybe that's OK for your taste. If not, then Mr. Wizard's solution is better because it does put the square in the denominator.

• +1, this method is only one that worked for me actually since I was using print[] to print an expression with Csc. For example, Print[Csc[x]] and only this method will print 1/Sin[x] Commented Apr 7, 2017 at 4:19