2
$\begingroup$

I'm afraid the following is rather localized questions, but I don't know how to simplify and generalize it. I have the following two points (in the real plane):

p = {Sqrt[b y1^2 + 4 ϵ], y1}
q = {(3 b y1^2 + 12 ϵ + Sqrt[5] y1 Sqrt[b (b y1^2 + 4 ϵ)])/(2 Sqrt[b y1^2 + 4 ϵ]), 
     (3 b y1 + Sqrt[5] Sqrt[b (b y1^2 + 4 ϵ)])/(2 b)}

In particular, I have also the following assumptions:

$Assumptions = b > 0 && y1 ∈ Reals && ϵ > 0;

Then I try to solve the following:

Solve[p[[2]] == -q[[2]] && p[[1]] == q[[1]], y1]

and obtain the answer

{{y1 -> -(Sqrt[ϵ]/Sqrt[b])}, {y1 -> Sqrt[ϵ]/Sqrt[b]}}

However, one can easily test that the second answer is wrong:

In: {p, q} /. % // Simplify

returns: $\left\{\left\{\left\{\sqrt{5} \sqrt{\epsilon },-\sqrt{\frac{\epsilon }{b}}\right\},\left\{\sqrt{5} \sqrt{\epsilon },\sqrt{\frac{\epsilon }{b}}\right\}\right\},\left\{\left\{\sqrt{5} \sqrt{\epsilon },\sqrt{\frac{\epsilon }{b}}\right\},\left\{2 \sqrt{5} \sqrt{\epsilon },\frac{4 \epsilon }{\sqrt{b \epsilon }}\right\}\right\}\right\}$

What am I missing?

$\endgroup$
0

1 Answer 1

3
$\begingroup$

You can understand what is happening by comparing:

s = Solve[p[[2]] == -q[[2]] && p[[1]] == q[[1]], y1]
(*
{{y1 -> -(Sqrt[ϵ]/Sqrt[b])}, {y1 -> Sqrt[ϵ]/Sqrt[b]}}
*)

with:

s = Solve[p[[2]] == -q[[2]] && p[[1]] == q[[1]], y1, Reals]
(*    
{{y1 -> ConditionalExpression[-Sqrt[(ϵ/b)], ϵ > 0 && b > 0]}}
*)

or:

s = Solve[p[[2]] == -q[[2]] && p[[1]] == q[[1]], y1, MaxExtraConditions -> All]

Solve::useq: The answer found by Solve contains equational condition(s) {0==Sqrt[5] Sqrt[b] Sqrt[ϵ]-Sqrt[5] Sqrt[b ϵ],0==-Sqrt[5] Sqrt[b] Sqrt[ϵ]-Sqrt[5] Sqrt[b ϵ]}. A likely reason for this is that the solution set depends on branch cuts of Mathematica functions. >>

{{y1 -> ConditionalExpression[-(Sqrt[ϵ]/Sqrt[b]), b != 0 && -Sqrt[5] Sqrt[b] Sqrt[ϵ] + Sqrt[5] Sqrt[b ϵ] == 0 && ϵ != 0]}, 
 {y1 -> ConditionalExpression[Sqrt[ϵ]/Sqrt[b], b != 0 && Sqrt[5] Sqrt[b] Sqrt[ϵ] + Sqrt[5] Sqrt[b ϵ] == 0 && ϵ != 0]}}
$\endgroup$
4
  • $\begingroup$ still don't follow , that second conditional can never be true. (Did you use his $Assumptions?) $\endgroup$
    – george2079
    Dec 6, 2013 at 14:49
  • $\begingroup$ @george2079 Try this Solve[p[[2]] == -q[[2]] && p[[1]] == q[[1]] && b > 0 && y1 \[Element] Reals && \[Epsilon] > 0, y1, MaxExtraConditions -> All] $\endgroup$ Dec 6, 2013 at 15:12
  • $\begingroup$ @belisarius: So basically Solve, by default, does not take into account the value of $Assumptions? $\endgroup$
    – Dror
    Dec 7, 2013 at 19:17
  • $\begingroup$ @Dror I believe the symbols that Solve[ ] uses as "variables" are not being seen from the outside. They are localized by a Block[ ] construct $\endgroup$ Dec 7, 2013 at 19:29

Your Answer

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

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