1
$\begingroup$

In 14.0 on Windows 10 I solve a trig equation $$2 \cos ^{-1}(\sin (\pi x))=\pi \cos \left(\sin ^{-1}(x+1)\right) $$

by

Reduce[2 ArcCos[Sin[Pi *x]] == Pi *Cos[ArcSin[x + 1]], x, Reals]

False Reduce::fexp: Warning: Reduce used FunctionExpand to transform the system. Since FunctionExpand transformation rules are only generically correct, the solution set might have been altered

The same issue with Solve and FindInstance. That result is not correct: for example, x==-1 is a solution. Taking into account the function domain of the LHS minus the RHS, I succeed by

Reduce[2 ArcCos[Sin[Pi *x]] == Pi *Cos[ArcSin[x + 1]] && 
FunctionDomain[2 ArcCos[Sin[Pi *x]] - Pi *Cos[ArcSin[x + 1]],x], x, Reals]

x == -(9/5) || x == -1

Is there another way to solve it?

$\endgroup$
10
  • $\begingroup$ Concerning numeric solutions, NSolve[2 ArcCos[Sin[Pi *x]] == Pi *Cos[ArcSin[x + 1]], x, Reals] reports {} and "NSolve::fexp: Warning: NSolve used FunctionExpand to transform the system. Since FunctionExpand transformation rules are only generically correct, the solution set might have been altered." and NMinimize[(2 ArcCos[Sin[Pi*x]] - Pi*Cos[ArcSin[x + 1]])^2, x] returns the input together with a warning "NMinimize::nrnum: The function value -19.6116-28.3921 I is not a real number at {x} = {0.934341}". $\endgroup$
    – user64494
    Commented Mar 5 at 19:01
  • 1
    $\begingroup$ @The down-voter: What is incorrect in the question? To downvote without a comment is not a good practice. $\endgroup$
    – user64494
    Commented Mar 5 at 19:46
  • $\begingroup$ BTW, I don't see how to solve this equation by hand. $\endgroup$
    – user64494
    Commented Mar 5 at 20:17
  • 2
    $\begingroup$ [CASE:5119902] is submitted by me: "Thank you for contacting Wolfram Technical Support. I will pass this report along to the developers in charge of this functionality". $\endgroup$
    – user64494
    Commented Mar 5 at 20:21
  • 1
    $\begingroup$ A bit disappointing that Reduce[2 ArcCos[Sin[Pi*x]] == Pi*Cos[ArcSin[x + 1]] && Pi*Cos[ArcSin[x + 1]] \[Element] Reals, x, Reals] works and the original fails. I suppose everyone know, or should be made aware, that the methods available for problems over bounded domains are different and sometimes more robust. For instance, this seemingly trivial change yields the solution: Reduce[2 ArcCos[Sin[Pi*x]] == Pi*Cos[ArcSin[x + 1]] && (-100 < x < 100 || Abs[x] >= 100), x, Reals] $\endgroup$
    – Goofy
    Commented Mar 10 at 15:36

3 Answers 3

11
$\begingroup$
$Version

(* "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)" *)

Clear["Global`*"];

eqn = 2  ArcCos[Sin[Pi*x]] == Pi*Cos[ArcSin[x + 1]];

Plot the equation

ContourPlot[eqn, {x, -Pi, Pi}, {y, -10, 10}]

enter image description here

From the plot, restrict the domain:

sol1 = Solve[{eqn, -2 < x < 0}, x, NegativeReals]

(* {{x -> -(9/5)}, {x -> -1}} *)

eqn /. sol1

(* {True, True} *)

Or,

sol2 = NSolve[{eqn, -2 < x < 0}, x] // Rationalize

(* {{x -> -(9/5)}, {x -> -1}} *)

Or,

sol3 = FindRoot[eqn, {x, #}] & /@ {-0.9, -1.7} // Rationalize

(* {{x -> -1}, {x -> -(9/5)}} *)

Or,

sol4 = FindInstance[{eqn, -2 < x < 0}, x, 2]

(* {{x -> -(9/5)}, {x -> -1}} *)

EDIT: Another graphical approach:

plt = Plot[Evaluate[List @@ eqn], {x, -3, 1},
  MeshFunctions -> Function[{x, y}, Evaluate[Subtract @@ eqn]],
  Mesh -> {{0.}},
  MeshStyle -> Directive[PointSize[0.02], Red],
  PlotLegends -> Placed["Expressions", {.375, .8}]]

enter image description here

sol5 = {x -> #} & /@ 
   Graphics`Mesh`FindIntersections[plt // DiscretizeGraphics][[All, 1]] // 
  Rationalize[#, 10^-5] &

(* {{x -> -(9/5)}, {x -> -1}} *)
$\endgroup$
4
  • $\begingroup$ In fact , you find FunctionDomain[2 ArcCos[Sin[Pi *x]] - Pi *Cos[ArcSin[x + 1]] over the reals (which is exactly x>=-2&&x<=0), making use of a plot ("From the plot, restrict the domain"). This is my answer in other formulas. Because of this reason I can neither up vote nor accept it. $\endgroup$
    – user64494
    Commented Mar 5 at 20:04
  • $\begingroup$ -1. I'd like to add that Solve[{eqn, -2 < x < 0}, x] produces "Solve::incs: Warning: Solve was unable to prove that the solution set found is complete. {{x -> -(9/5)}, {x -> -1}}". Your NegativeReals stands to disguise it. $\endgroup$
    – user64494
    Commented Mar 5 at 20:26
  • $\begingroup$ Use Solve[{eqn, -2 < x < 0}, x, Complexes] As shown in the documentation, "Solve[expr && vars [Element] Reals, vars, Complexes] solves for real values of variables, but function values are allowed to be complex." In this specific case a tighter constraint than vars \[Element] Reals is used. $\endgroup$
    – Bob Hanlon
    Commented Mar 5 at 20:44
  • $\begingroup$ Solve[{eqn, -2 < x < 0}, x,Reals] works in the end, taking a dozen of minutes. $\endgroup$
    – user64494
    Commented Mar 5 at 20:50
1
$\begingroup$

When solving the equation under consideration, complex numbers appear (say, ArcCos[2]). To overcome that circumstance, we can rewrite the equation as Re[]^2+Im[]^2 == 0,then

FindInstance[Re[(2  ArcCos[Sin[Pi*x]] - Pi*Cos[ArcSin[x + 1]])]^2 + 
Im[(2  ArcCos[Sin[Pi*x]] - Pi*Cos[ArcSin[x + 1]])]^2 ==  0, x, Reals, 3]

FindInstance::fwsol: Warning: FindInstance found only 2 instance(s), but it was not able to prove 3 instances do not exist.{{x -> -1}, {x -> -(9/5)}}

works,

$\endgroup$
1
  • $\begingroup$ FindInstance[ Re[(2 ArcCos[Sin[Pi*x]] - Pi*Cos[ArcSin[x + 1]])] == 0, x, Reals, 3] performs {{x -> 453/2}, {x -> 137/2}, {x -> -(695/2)}}. $\endgroup$
    – user64494
    Commented Mar 6 at 18:35
1
$\begingroup$

These are all complex solutions. There might be more if we take ArcSin and ArcCos as multivalued functions.

sol = {9/5 - (2 I Sqrt[11])/5, 
   1/5 - (2 I)/5, -1, -3 - (2 I)/Sqrt[5], -(23/5) - (2 I Sqrt[19])/5, 
   9/5 + (2 I Sqrt[11])/5, 
   1/5 + (2 I)/5, -(9/5), -3 + (2 I)/Sqrt[5], -(23/5) + (
    2 I Sqrt[19])/5};

With[{x = a + I b}, 
 ContourPlot[{Re[2 ArcCos[Sin[Pi*x]] - Pi*Cos[ArcSin[x + 1]]] == 0, 
   Im[2 ArcCos[Sin[Pi*x]] - Pi*Cos[ArcSin[x + 1]]] == 0}, {a, -10, 
   10}, {b, -4, 4}, PlotPoints -> 100, Epilog -> Point@(ReIm /@ sol)]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.