# Problem with Solve Function: It gives wrong solution!

I tried to run the codes

\$Assumptions = {a, b, c, d, q} \[Element] Reals
a = Sqrt[1 - c^2 Sin[q]^2];
d = -Sqrt[1 - b^2 Csc[q]^2];
Solve[-a b - c d Sin[q]^2 == 0, b]


and the output is

{{b -> -c Sin[q]^2}, {b -> c Sin[q]^2}}


Only one of the "solutions" is the right answer, the second one. Why did it include the first one, the wrong solution? How do I make it only give the correct one?

• It seems to me you are making assumptions about your variables that you know, but have not given to Mathematica (everything is assumed to be complex-valued unless indicated otherwise). Mathematica is not a mind reader. Oct 13, 2018 at 13:02
• @J.M. I just added the assumption for all variables to be real, {a,b,c,d,q} and it still give the same output. Am I missing something? Oct 13, 2018 at 13:11
• What does Solve[b Sqrt[1 - c^2 Sin[q]^2] - Sqrt[1 - b^2 Csc[q]^2] c Sin[q]^2 == 0, b, Reals] give for you? Oct 13, 2018 at 13:15
• @J.M. It gives two solutions with ConditionalExpression. It's a bit messy. Oct 13, 2018 at 13:20
• @Bao - I get {{b -> ConditionalExpression[c Sin[q]^2, c < 0 && -1 < c Sin[q] < 1]}, {b -> ConditionalExpression[c Sin[q]^2, c > 0 && -1 < c Sin[q] < 1]}}. You probably need to Clear your variables or start with a fresh kernel. Oct 13, 2018 at 15:06