Is there a way to ask Mathematica to avoid expressing answers in terms
of certain functions. For example, I can stand Sec, Csc, Sech, and Csch
and would rather see Sec^-1, etc.
Thanks!
If you're just trying to avoid hyperbolic functions, you could use
TrigToExp, e.g.:
TrigToExp[Sech[x]] // InputForm
2/(E^(-x) + E^x)
[For purposes of text messages in this newsgroup, I used InputForm there
just in order to produce a 1-dimensional output instead of an actual
2-dimensional built-up (compound) fraction.]
Similary:
TrigToExp[ArcSech[x]]
Log[Sqrt[-1 + x^(-1)]*Sqrt[1 + x^(-1)] + x^(-1)]
--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
MakeBoxes[Csc[x_], form : (StandardForm | TraditionalForm)] :=
InterpretationBox[#1, #2] & @@ {MakeBoxes[HoldForm[1/Sin[x]]],
Csc[x]}
1/Sin[x]
% // FullForm
Use
MakeBoxes[Csc[x_], form : (StandardForm | TraditionalForm)] =.
to clear the definition.
Frankly, I wouldn't do that kind of formatting because it is too special and
is hiding what Mathematica is actually working on and may not give the
intended result with more complicated expressions.
Clearly, you are trying to use Mathematica in a way that gives clearer
results in a textbook form. This is a good idea. If you gave some specific
examples you might obtain better answers.
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/
I'm with you on this one: always hated Sec and Csc (and never
understood the backward naming of these functions -- why isn't Sec =
1/Sin and Csc = 1/Cos?)
So, I'd like the various Simplifiy and XxxToYyy functions in Mathematica to
always give precedence to Sin and Cos by default, and avoid using Sec
and Csc whenever possible, even if this produces some "1 overs" in the
output expression.
But I suspect trying to implement this at this point would require more
complexity than it would be worth.
>> From: Sam Takoy [mailto:sam....@yahoo.com]
>>
>> Hi,
>>
>> Is there a way to ask Mathematica to avoid expressing answers in terms
>> of certain functions. For example, I [can't?] stand Sec, Csc, Sech, and Csch
>> and would rather see Sec^-1, etc.
>
> I'm with you on this one: always hated Sec and Csc (and never
> understood the backward naming of these functions -- why isn't Sec ==
> 1/Sin and Csc == 1/Cos?)
Have you never noticed this:
1+ Tan[x]^2====Sec[x]^2
1+Cot[x]^2====Csc[x]^2
?
Andrzej Kozlowski
Your description is a bit confused, but I take it you would like to see
an expression output in terms of Sin rather than Csc, but the normal
evaluation process defeats you:
In[1]:= 1/Sin[x]
Out[1]= Csc[x]
One answer to this, is to make a replacement that uses your own function
- say sin[x] for which Mathematica knows nothing. So for example:
In[2]:= Csc[x]^3 /. Csc[z_] -> 1/sin[z]
Out[2]= 1/sin[x]^3
If you need to re-input such expressions, you can use another
transformation to replace sin with Sin.
BTW, if you do a lot of this sort of manipulation, it can be convenient
to collect several rules in one variable:
displayNicely={ Csc[z_] -> 1/sin[z],Sec[z_]->1/cos[z]}
Then you can just append /.displayNicely to any calculation to obtain
this effect!
David Bailey
There is a good geometric reason that sec is an appropriate name for the
reciprocal of cos rather than of sin. Draw the unit circle, center at
the origin O. Mark off a central angle of theta from the positive
x-axis, and let P be the corresponding point on the circle. Draw the
vertical line L through the point (1,0). Extend the ray OP until it
intersects L at a point Q. Then the length of OQ is sec (theta). That
line segment OQ cuts across the circle.
[See, e.g., http://en.wikipedia.org/wiki/Trigonometric_functions. (I
thought I remembered also some Wolfram Demonstration of this, but I
cannot locate it now.)]
Furthermore, in the usual list of the 6 trig functions
sin
cos
tan
cot
sec
csc
there is a symmetry of pairs around the middle: cot = 1/tan, sec =
1/cos, csc = 1/sin.
Finally, what's wrong with sec and csc? Mathematical expressions are
often simpler when expressed in terms of them, since this avoids
(explicit) use of fractions for the functions.
On 7/19/2010 2:10 AM, AES wrote:
>> From: Sam Takoy [mailto:sam....@yahoo.com]
>>
>> Hi,
>>
>> Is there a way to ask Mathematica to avoid expressing answers in terms
>> of certain functions. For example, I [can't?] stand Sec, Csc, Sech, and Csch
>> and would rather see Sec^-1, etc.
>
> I'm with you on this one: always hated Sec and Csc (and never
> understood the backward naming of these functions -- why isn't Sec =
> 1/Sin and Csc = 1/Cos?)
>
> So, I'd like the various Simplifiy and XxxToYyy functions in Mathematica to
> always give precedence to Sin and Cos by default, and avoid using Sec
> and Csc whenever possible, even if this produces some "1 overs" in the
> output expression.
>
> But I suspect trying to implement this at this point would require more
> complexity than it would be worth.
>
--