MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to solve a simple Trig cofunction?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50552] Re: [mg50500] How to solve a simple Trig cofunction?
  • From: Andrzej Kozlowski <andrzej at akikoz.net>
  • Date: Thu, 9 Sep 2004 05:19:46 -0400 (EDT)
  • References: <45208C0E-0192-11D9-8737-000A95BB3776@mac.com> <DA976E8C-0193-11D9-8C24-000A95B4967A@akikoz.net> <560CD99A-0211-11D9-B9C5-000A95BB3776@mac.com>
  • Sender: owner-wri-mathgroup at wolfram.com

You are quite right. I should have been more careful.

What I should have done was:

N[(x /. {ToRules[Reduce[{Cos[x + 4*Pi/180] == Sin[3*x + 2*Pi/180],
        0 < x < Pi}, x]]})*(180/Pi)]

But this is now taking very much longer, I have been waiting for quite 
a long time and Mathematica has not managed it yet. As I have not 
enough patience (and it may never be able to do it exactly) I have 
decided to switch to a numerical approach:

<< NumericalMath`IntervalRoots`


(Mean /@ (List @@ (IntervalBisection[Cos[x + 4*Pi/
       180] - Sin[3*x + 2*Pi/180], x, Interval[{0., N[Pi]}], .01,
            MaxRecursion -> 10])))*180/Pi

{20.918, 46.0547, 110.918}

This seems to agree with what you expected.

Andrzej


On 9 Sep 2004, at 12:35, Brian Feeny wrote:

>
> Andrzej,
>
> I think the differences I am seeing in the solutions (21 vs. 26) is 
> because doing something like:
>
> N[Cos[x + 4] /.x -> 21*Degree]
>
> is not the same thing as:
>
> N[Cos[x Degree + 4 Degree] /. x -> 21]
>
>
> My originally problem:
>
> Cos[x+4] = Sin[3x+2]
>
> The problem I think, is that with the way your examples and some 
> others are being done, the part being added,
> such as "4", is not in Degree's.  Probably because I didn't explain my 
> problem well.  I do appreciate you and others
> taking the time to show me excellent ways to solve these problems in 
> Mathematica.
>
> Brian
>
>
>
> On Sep 8, 2004, at 7:37 AM, Andrzej Kozlowski wrote:
>
>> *This message was transferred with a trial version of CommuniGate(tm) 
>> Pro*
>> Well, Mathematica does not agree with you:
>>
>>
>> N[Cos[x + 4] /. x -> 21*Degree]
>>
>>
>> -0.3390151318887568
>>
>>
>> N[Sin[3*x + 2] /. x -> 21*Degree]
>>
>>
>> 0.042022846832621065
>>
>> which is way off, while
>>
>> In[58]:=
>> N[Cos[x + 4] /. x -> 26.56*Degree]
>>
>>
>> -0.24626970814204074
>>
>>
>> N[Sin[3*x + 2] /. x -> 26.56*Degree]
>>
>>
>> -0.24651797391493188
>>
>> which is much closer. Perhaps you had a different equation in mind?
>>
>> Andrzej
>>
>>
>>
>> On 8 Sep 2004, at 21:26, Brian Feeny wrote:
>>
>>>
>>> On Sep 8, 2004, at 7:06 AM, Andrzej Kozlowski wrote:
>>>
>>>> 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:
>>>>
>>>>
>>>
>>>
>>> Thanks for replying.  The correct numerical answer is 21degrees 
>>> however, I wonder why the numerical
>>> answers below are 5 degrees too much?
>>>
>>> You have given me alot to think about in ways to use Mathematica and 
>>> I will read in the manual further to try
>>> to make sense of it, thanks.
>>>
>>> Brian
>>>
>>>
>>>
>>>
>>>
>>>> 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/
>>>>
>>


  • Prev by Date: Re: plot thousands(?) of trajectories in single graph.
  • Next by Date: Re: Random replacement
  • Previous by thread: Re: Re: How to solve a simple Trig cofunction?
  • Next by thread: Re: How to solve a simple Trig cofunction?