Re: How to solve a simple Trig cofunction?

*To*: mathgroup at smc.vnet.net*Subject*: [mg50514] Re: [mg50500] How to solve a simple Trig cofunction?*From*: Andrzej Kozlowski <andrzej at akikoz.net>*Date*: Thu, 9 Sep 2004 05:17:26 -0400 (EDT)*References*: <200409080914.FAA08518@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

On 8 Sep 2004, at 18:14, Brian Feeny wrote: > *This message was transferred with a trial version of CommuniGate(tm) > Pro* > Lets say I have: > > cos[X+4] = sin[3X+2] > > What would be the proper way to solve the above, for X, in > Mathematica, with the answer in degrees? > > I did this, but something tells me their has to be a better way: > > NSolve[Cos[X Degree +4 Degree] = Sin[3 X Degree+2 Degree], X] > > I mean, I wish i didn't have to enter "Degree"so many times, perhaps > their is a simple way to just tell it the whole thing is in Degree. > > Additionally, is their a way to constrain the above to 90 > X > 0? I > tried doing like: > > NSolve[Cos[X Degree +4 Degree] = Sin[3 X Degree+2 Degree], X /; 90 >> X>0] > > but that obviously is not the right way since that doesn't work. > Appreciate all the help. > > Brian > > I have no idea what a "Trig cofunction" is ;-) Mathematica can solve this exactly (so there is no need to use numerical methods, and in any case NSolve would be the wrong solver to use since it does not deal with trig equations) This gives the exact answer in radians: Reduce[{Cos[x + 4] == Sin[3*x + 2], 0 < x < Pi}, x] x == 1 - 2*ArcTan[1 - Sqrt[2]] || x == (1/2)*(-3 + 2*Pi - 2*ArcTan[1 - Sqrt[2]]) || x == (1/2)*(-3 + 2*Pi - 2*ArcTan[1 + Sqrt[2]]) If you prefer an answer in degrees you get do this: (x /. {ToRules[Reduce[{Cos[x + 4] == Sin[3*x + 2], 0 < x < Pi}, x]]})*(180/Pi) {(180*(1 - 2*ArcTan[1 - Sqrt[2]]))/Pi, (90*(-3 + 2*Pi - 2*ArcTan[1 - Sqrt[2]]))/Pi, (90*(-3 + 2*Pi - 2*ArcTan[1 + Sqrt[2]]))/Pi} And if you prefer a numerical answer you can just apply N: N[%] {102.296,116.556,26.5563} Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/~andrzej/ http://www.mimuw.edu.pl/~akoz/

**References**:**How to solve a simple Trig cofunction?***From:*bfeeny@mac.com (Brian Feeny)