# Error (NSolve::ifun) when using NSolve, I need help interpreting the error

I wrote the following code to observe how the solutions to the equation $(e^{i a})^2 = e^{i b}$ varied as $b$ varied between 0 and $2\pi$

Manipulate[NSolve[(E^(I a))^2 == E^(I b), a], {b, 0, 2 \[Pi]}]


However, the following error appears: How would I use Reduce to solve the above equation? I thought reduce was a way to fold up a list with a binary operator.

• Off[Solve::ifun]; Manipulate[ Solve[(E^(I a))^2 == E^(I b), a], {b, 0, 2 [Pi]}] – Dr. belisarius May 20 '12 at 1:50
• Could do: nSolve[b_?NumericQ] := Quiet[a /. NSolve[(E^(I a))^2 == E^(I b), a]] Manipulate[nSolve[b], {b, 0, 2 [Pi]}] – Daniel Lichtblau Jun 26 '12 at 23:19

The "reduce" that you're thinking of is called Fold in Mathematica. Here, Reduce is a function to solve equations/inequalities.

The error message that you get for NSolve is the same as Solve::ifun, which you often get when there are an infinite number of solutions. A simple example that gives you this warning and is easy to relate to is:

Solve[Sin[k π] == 0, k]
(* Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.

{{k -> 0}} *)


Of course, $k=0\$ is not the only solution, and the correct solution is $k\in \mathbb{Z}$. If you take the advice given in the warning and use Reduce, you get the full set:

Reduce[Sin[k Pi] == 0, k]
(* C ∈ Integers && (k == 2 C || k == (π + 2 π C)/π) *)

• That helps a lot, thank you. I wouldn't think that an equation with only one free variable would have more than one solution, but since Solve and NSolve are using inverse functions, that must mean that it is using the many-valued complex logarithm right? If so, this makes a lot more sense. – tlehman May 20 '12 at 16:24
Off[Solve::ifun];
Manipulate[
Show[{Graphics[{White, Circle[{0, 0}, 1.5], Black, Circle[], PointSize[Large],
Red,
Text[b, 1.2 {Cos@b, Sin@b}],
Point[{Cos@b, Sin@b}],
Blue,
Text[#, 1.2 {Cos@#, Sin@#}],
Point[{Cos@#, Sin@#}]}]} & /@
(a /. Solve[(E^(I a))^2 == E^(I b), a])],
{b, 0, 2 Pi}] 