       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:=
f[x_] := (E^(I x) - E^(-I x))/(2 I)

Then the eqaution becomes:

In:=
Expand[f[x]^2 + f[x] - 1] == 0

Out=
-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:=
Expand[-4 E^(2 I x) (f[x]^2 + f[x] - 1) ] == 0

Out=
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:=
soln = Solve[y^4 + 2 I y^3 + 2 y^2 - 2 I y + 1 == 0]

Out=
-I   I           Sqrt[-2 - 2 Sqrt]
{{y -> -- - - Sqrt - --------------------},
2    2                    2

-I   I           Sqrt[-2 - 2 Sqrt]
{y -> -- - - Sqrt + --------------------},
2    2                    2

-I   I           Sqrt[-2 + 2 Sqrt]
{y -> -- + - Sqrt - --------------------},
2    2                    2

-I   I           Sqrt[-2 + 2 Sqrt]
{y -> -- + - Sqrt + --------------------}}
2    2                    2

The principal real solutions are now easily picked out:

In:=
ans = Chop[N[-I Log[y] /. soln]]

Out=
{-1.5708 - 1.06128 I, -1.5708 + 1.06128 I, 2.47535,

0.666239}
A check on the results:
In:=
Sin[x]^2 + Sin[x] - 1 /. {{x->ans[]},{x->ans[]}}

Out=
-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:=
ans[]-8Pi//N
ans[] + 12Pi//N
Sin[x]^2 + Sin[x] - 1 /. {{x->ans[]-8Pi},
{x->ans[]}}

Out=
-22.6574

Out=
38.3654

Out=
-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
---------------------------------------------

```

• Prev by Date: Re: Re: How to apply EdgeForm to ParametricPlot3D?
• Next by Date: Re: Base 10 to Base 2 conversion error ?
• Previous by thread: Re: Simple problem for math wiz
• Next by thread: Re: Simple problem for math wiz