Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How would you solve a problem like "write csc(x) in terms of sec(x)" in Mathematica? The best I can get is "True."

http://math.stackexchange.com/questions/167935/write-cscx-in-terms-of-secx

I'm asking in order to better understanding of Mathematica, and as a way to verify I'm solving my trig identities correctly. It's been a while since I've done identities, and I'm trying to brush off the cobwebs before its too late. I was told that I'll need this skill later on in Calculus.

share|improve this question
1  
Would these help? 1 2 3 4 :) –  drN Oct 10 '12 at 19:07
add comment

1 Answer 1

up vote 4 down vote accepted

Just playing tricks:

Cases[Join @@ Solve[{csc == 1/sin, sec == 1/cos, cos cos + sin sin == 1}, {csc, sin, cos}], 
      HoldPattern[csc -> _]]
 (*
  ->{csc -> -(sec/Sqrt[-1 + sec^2]), csc -> sec/Sqrt[-1 + sec^2]}
 *)

Edit

More generally (by using @J.M's suggestion below):

trigExpress[expr_, inTerms_] :=
 Module[
  {set = {sin, cos, tan, sec, csc},
   rels = {csc sin == 1, cos^2 + sin^2 == 1, 1 == cos sec, tan == sin/cos}},
  oneInTermsOf[one_, of_] := Solve[rels, {one}, Complement[set, {one, of}]];
  allIntermsOf[of_] :=       Flatten[oneInTermsOf[#, of] & /@ Complement[set, {of}]];
  Expand@FullSimplify[expr /. allIntermsOf[inTerms]]
  ]

so:

trigExpress[(sin + cos)/tan, sec]
(*
-> 1/sec - 1/(sec Sqrt[-1 + sec^2])
*)
share|improve this answer
1  
Slightly more compact: Solve[{Csc Sin == 1, Cos^2 + Sin^2 == 1, 1 == Cos Sec}, Csc, {Cos, Sin}] –  J. M. Oct 11 '12 at 0:59
    
@J.M. Thanks. Updated with a little more general thing using yours –  belisarius Oct 11 '12 at 13:43
    
Hmmm ... probably one should take in account the negative radicals to get the expressions for all quadrants. –  belisarius Oct 11 '12 at 13:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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