Re: How to solve a simple Trig cofunction?

• To: mathgroup at smc.vnet.net
• Subject: [mg50530] Re: [mg50500] How to solve a simple Trig cofunction?
• From: "David Park" <djmp at earthlink.net>
• Date: Thu, 9 Sep 2004 05:18:01 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```Brian,

It's often best to work with radians, but since your input is simply stated
in degrees we'll stick with degrees. You can click in the Degree symbol from
the Input Palette to save some typing.

With a problem like this, it's often useful to make a plot first to see what
is going on.

Plot[{Cos[x ° + 4°], Sin[3x ° + 2°]}, {x, -180, 180},
Frame -> True,
ImageSize -> 450];

Then NSolve gets the solutions right off. (But you have to use "==" not "="
in the equation.)

NSolve[Cos[x ° + 4°] == Sin[3x ° + 2°], x]
{{x -> -159.}, {x -> -134.}, {x -> -69.}, {x -> 21.}, {x -> 46.}, {x ->
111.}}

You can ignore the error message in this case since the solutions correspond
to the plot.

If you use Ted Ersek's RootSearch package from MathSource you can easily
obtain the roots over a wider range.

Needs["Enhancements`RootSearch`"]

RootSearch[Cos[x ° + 4°] == Sin[3x ° + 2°], {x, -360, 360}]
{{x -> -339.}, {x -> -314.}, {x -> -249.}, {x -> -159.}, {x -> -134.},
{x -> -69.}, {x -> 21.}, {x -> 46.}, {x -> 111.},
{x -> 201.}, {x -> 226.}, {x -> 291.}}

David Park

From: Brian Feeny [mailto:bfeeny at mac.com]
To: mathgroup at smc.vnet.net

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

```

• Prev by Date: Re: How to solve a simple Trig cofunction?
• Next by Date: Re: sorry, but more q's on random numbers
• Previous by thread: Re: How to solve a simple Trig cofunction?
• Next by thread: Re: How to solve a simple Trig cofunction?