Re: Re: Simple problem for math wiz
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1745] Re: [mg1708] Re: Simple problem for math wiz
- From: brucec (Bruce Carpenter)
- Date: Mon, 24 Jul 1995 00:44:07 -0400
In article <DBKwIr.2qv at wri.com>, nomail at me.net (REVEAL) wrote: > Anyone here know how to find the solution set to: sin^2x+sinx-1=0 ? the >trick, that is? > (limited to trig & algebra) > If you write Sin[x] in terms of its complex exponential: In[1]:= f[x_] := (E^(I x) - E^(-I x))/(2 I) Then the eqaution becomes: In[2]:= Expand[f[x]^2 + f[x] - 1] == 0 Out[2]= -2 I x 2 I x 1 I -I x I I x E E -(-) + - E - - E - ------- - ------ == 0 2 2 2 4 4 Multiply through by -4 E^(2 I x), (which is never zero): In[3]:= Expand[-4 E^(2 I x) (f[x]^2 + f[x] - 1) ] == 0 Out[3]= I x 2 I x 3 I x 4 I x 1 - 2 I E + 2 E + 2 I E + E == 0 This yields a quartic equation in powers of E^(I x), which can be solved exactly: In[4]:= soln = Solve[y^4 + 2 I y^3 + 2 y^2 - 2 I y + 1 == 0] Out[4]= -I I Sqrt[-2 - 2 Sqrt[5]] {{y -> -- - - Sqrt[5] - --------------------}, 2 2 2 -I I Sqrt[-2 - 2 Sqrt[5]] {y -> -- - - Sqrt[5] + --------------------}, 2 2 2 -I I Sqrt[-2 + 2 Sqrt[5]] {y -> -- + - Sqrt[5] - --------------------}, 2 2 2 -I I Sqrt[-2 + 2 Sqrt[5]] {y -> -- + - Sqrt[5] + --------------------}} 2 2 2 The principal real solutions are now easily picked out: In[5]:= ans = Chop[N[-I Log[y] /. soln]] Out[5]= {-1.5708 - 1.06128 I, -1.5708 + 1.06128 I, 2.47535, 0.666239} A check on the results: In[6]:= Sin[x]^2 + Sin[x] - 1 /. {{x->ans[[3]]},{x->ans[[4]]}} Out[6]= -16 -16 {-1.11022 10 , 1.11022 10 } Of course you get infinitely many solutions because the Log is actually infinitely valued--just take any solution + 2 k Pi for k an integer. Eg, In[7]:= ans[[3]]-8Pi//N ans[[4]] + 12Pi//N Sin[x]^2 + Sin[x] - 1 /. {{x->ans[[3]]-8Pi}, {x->ans[[4]]}} Out[7]= -22.6574 Out[8]= 38.3654 Out[9]= -16 -16 {-1.11022 10 , 1.11022 10 } Is this what you meant by being limited to trig and algebra? Cheers, --------------------------------------------- Bruce Carpenter Wolfram Research, Inc. 100 Trade Center Drive, Champaign, IL 61820 email: brucec at wri.com ---------------------------------------------