       Re: equation question

• To: mathgroup at smc.vnet.net
• Subject: [mg69966] Re: equation question
• From: bghiggins at ucdavis.edu
• Date: Thu, 28 Sep 2006 06:16:14 -0400 (EDT)
• References: <efdk51\$qg\$1@smc.vnet.net>

```Demitris,

One way is to use ContourPLot. First, let us determine the required
equations defined in the complex plane

First we express the equations in terms of x=a + I*ß. Here is the
result for Sin[x]-2

f1 = ComplexExpand[Sin[x] - 2 /. x -> a + I*ß]

-2 + Cosh[ß]*Sin[a] + I*Cos[a]*Sinh[ß]

Here is the result for Sin[x^2]-2

f2 = ComplexExpand[Sin[x^2] /. x -> a + I*ß] - 2

-2 + Cosh[2*a*ß]*Sin[a^2 - ß^2] +
I*Cos[a^2 - ß^2]*Sinh[2*a*ß]

Now we use ContourPlot to display the real part and the imaginary part
of the level set equal to 0 as follows

Block[{\$DisplayFunction = Identity}, Plt1 = ContourPlot [Re[f1], {a,
-2,
10}, {ß, -2,
2}, Contours -> {0}, ContourShading -> False, ContourStyle -> Blue,

PlotPoints -> 100]; Plt2 =
ContourPlot [Im[f1], {a, -2, 10}, {ß, -2, 2}, Contours -> {0},

ContourShading -> False, ContourStyle -> Red, PlotPoints ->
100];]
Show[Plt1, Plt2]

Block[{\$DisplayFunction = Identity}, Plt1 = ContourPlot [Re[f2], {a,
-2,
10}, {ß, -2,
2}, Contours -> {0}, ContourShading -> False, ContourStyle -> Blue,

PlotPoints -> 100]; Plt2 =
ContourPlot [Im[f2], {a, -2, 10}, {ß, -2, 2}, Contours -> {0},

ContourShading -> False, ContourStyle -> Red, PlotPoints ->
100];]
Show[Plt1, Plt2]

The above plots show the complex roots (the intersection of the two
level set curves) in the range

-2<a<10 ,    -2<ß<2

If you want then to extract approximate values of these roots from the
graphic object which you can feed to FindRootyou can use the method
suggested by Stan Wagon in his book Mathematica in Action (see p 289).

In short you can automate the location of all complex roots in the
desired range.

Hope this helps,

Cheers,

Brian

dimmechan at yahoo.com wrote:
> Hello.
>
> Consider the following simple examples of FindRoot application.
>
> FindRoot[Sin[x] == 2, {x, I}]
> {x -> 1.5707963267948966 + 1.3169578969248168*I}
>
> FindRoot[Sin[x^2] == 2, {x, I + 1}]
> {x -> 1.3454777060580754 + 0.4894016047219337*I}
>
> FindRoot[Sin[x^2] == 2, {x, 3*I + 2}]
> {x -> 0.3004695589886017 + 2.1914997002654357*I}
>
> Is it possible for FindRoot (or in general in another way) to search
> for solutions
> in the complex plane in an particular domain e.g. searching in the
> domain that
> is made by the lines Re[x]=a1, Re[x]=a2 and Im[x]=b1, Im[b]=b2 ?
>
> I really appreciate any assistance.
>
> Regards
> Dimitris

```

• Prev by Date: RE: Re: Copying cell contents?
• Next by Date: Re: Executing function in mathematica function problem
• Previous by thread: Re: equation question
• Next by thread: Program to calculate division of continued fractions