       a bug in Solve

• To: mathgroup at smc.vnet.net
• Subject: [mg30892] a bug in Solve
• From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
• Date: Sun, 23 Sep 2001 02:16:32 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```It seems to me that I have come across a rather devious bug in Solve
which causes it to fail to solve systems of trigonometric equations
which in fact it ought to be (or "is") able to solve.

Here is an example:

Consider the system of equations:

eqs = {Cos[x] == -Sqrt[(2/85)*(19 + Sqrt)],
Sin[x] == (1/4)*(-Sqrt[(2/85)*(19 + Sqrt)] +
Sqrt[(42/85)*(19 + Sqrt)]),
Cos[y] == (1/21)*(7 + 3*Sqrt),
Sin[y] == (1/84)*(77*Sqrt[(2/85)*(19 + Sqrt)] -
13*Sqrt[(42/85)*(19 + Sqrt)]),
Cos[z] == (1/4)*(Sqrt[(2/85)*(19 + Sqrt)] -
Sqrt[(42/85)*(19 + Sqrt)]),
Sin[z] == -Sqrt[(2/85)*(19 + Sqrt)]}

In:=
Solve[eqs, {x, y, z}]

From In:=
Solve::ifun:Inverse functions are being used by Solve, so some solutions
may \
not be found.
Out=
{}

However, if we break up the system into three systems of equations in a
single variable Mathematica solves them correctly:

eqs1 = Partition[eqs, 2];

In:=

From In:=
Solve::ifun:Inverse functions are being used by Solve, so some solutions
may \
not be found.

From In:=
Solve::ifun:Inverse functions are being used by Solve, so some solutions
may \
not be found.

From In:=
Solve::ifun:Inverse functions are being used by Solve, so some solutions
may \
not be found.

From In:=
General::stop:Further output of Solve::ifun will be suppressed during
this \
calculation.

Out=
{{{x -> ArcCos[-Sqrt[(2/85)*(19 + Sqrt)]]}},
{{y -> ArcCos[(1/21)*(7 + 3*Sqrt)]}},
{{z -> -ArcCos[(1/340)*(Sqrt[170*(19 + Sqrt)] -
Sqrt[3570*(19 + Sqrt)])]}}}

Finally, let me explain how I came across this. Consider the matrix:

In:=
Z = {{1/3 + Sqrt[3/7], -(1/3) + 2/Sqrt, -(1/3) + 1/Sqrt},
{-(1/3) + 1/Sqrt, 1/3 + Sqrt[3/7], 1/3 - 2/Sqrt},
{-(1/3) + 2/Sqrt, 1/3 - 1/Sqrt, 1/3 + Sqrt[3/7]}};

It is easy to check that it belongs to SO(3)

In:=
Z.Transpose[Z]//Simplify

Out=
{{1,0,0},{0,1,0},{0,0,1}}

In:=
Det[Z]

Out=
1

<< Geometry`Rotations`

Since Z is in SO(3) we should be able to find the Euler angles of Z but
using Solve produces:

In:=

From In:=
Solve::ifun: Inverse functions are being used by Solve, so some
solutions may \
not be found.

Out=
{}

However,

In:=
Cos[b],Cos[c]}]

Out=
Cos[a] == -Sqrt[(2/85)*(19 + Sqrt)] &&
Cos[b] == (1/21)*(7 + 3*Sqrt) &&
Cos[c] == (1/4)*(Sqrt[(2/85)*(19 + Sqrt)] -
Sqrt[(42/85)*(19 + Sqrt)]) &&
Sin[a] == (1/4)*(-Sqrt[(2/85)*(19 + Sqrt)] +
Sqrt[(42/85)*(19 + Sqrt)]) &&
Sin[b] == (1/84)*(77*Sqrt[(2/85)*(19 + Sqrt)] -
13*Sqrt[(42/85)*(19 + Sqrt)]) &&
Sin[c] == -Sqrt[(2/85)*(19 + Sqrt)] ||
Cos[a] == Sqrt[(2/85)*(19 + Sqrt)] &&
Cos[b] == (1/21)*(7 + 3*Sqrt) &&
Cos[c] == (1/4)*(-Sqrt[(2/85)*(19 + Sqrt)] +
Sqrt[(42/85)*(19 + Sqrt)]) &&
Sin[a] == (1/4)*(Sqrt[(2/85)*(19 + Sqrt)] -
Sqrt[(42/85)*(19 + Sqrt)]) &&
Sin[b] == (1/84)*(-77*Sqrt[(2/85)*(19 + Sqrt)] +
13*Sqrt[(42/85)*(19 + Sqrt)]) &&
Sin[c] == Sqrt[(2/85)*(19 + Sqrt)]

This seems to suggest that the reason why Mathematica can't make the
final step and return a solution for a,b and c is probably  related to
the problem I begun with.

Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/

```

• Prev by Date: Re: RGBColor [?,?,?]
• Next by Date: Re: Problem with Interval Calculations?
• Previous by thread: Mathematica notebook saving bug ?
• Next by thread: Open Write?