Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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]}}
share|improve this answer
    
still don't follow , that second conditional can never be true. (Did you use his $Assumptions?) –  george2079 Dec 6 '13 at 14:49
    
@george2079 Try this Solve[p[[2]] == -q[[2]] && p[[1]] == q[[1]] && b > 0 && y1 \[Element] Reals && \[Epsilon] > 0, y1, MaxExtraConditions -> All] –  belisarius Dec 6 '13 at 15:12
    
@belisarius: So basically Solve, by default, does not take into account the value of $Assumptions? –  Dror Dec 7 '13 at 19:17
    
@Dror I believe the symbols that Solve[ ] uses as "variables" are not being seen from the outside. They are localized by a Block[ ] construct –  belisarius Dec 7 '13 at 19:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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