> I think the domain keyword should only be concerned with filtering 
solutions.

So it means that `solveset` should not check the solutions by plugging into 
the function, just check the domain of the solutions. Right?

 What should be the solution set for 
log(x - 3) + log(x + 3)

We have `sqrt(10), -sqrt(10)` as the real solutions. And as per the above 
statement, `solveset` should return both of these solutions.
But `solve` as well as WolframAlpha. considers only  `sqrt(10)`.

> So should solveset(domain=Reals) change the definition of sqrt to only be 
valid for positive numbers? 

I am not sure but interestingly WolframAplha says no solutions exists for 
the equation `sqrt(x + 1)/sqrt(x - 1) 
<http://www.wolframalpha.com/input/?i=solve(sqrt(x+%2B+1)%2Fsqrt(x+-+1),x)>
`.

On Monday, July 16, 2018 at 12:08:01 AM UTC+5:30, Aaron Meurer wrote:
>
> I would consider -1/2 to be valid in the real domain. -1/2 is a real 
> number and plugging it into the equation produces 0, so it's a 
> solution. 
>
> I think the domain keyword should only be concerned with filtering 
> solutions. If we also use it to change the meaning of functions in the 
> expression things start getting more difficult. 
>
> You can get the same problem with square roots. Consider 
> solveset(sqrt(x + 1)/sqrt(x - 1), domain=Reals). The solution ({-1}) 
> when plugged in, gives 0/(2*I), which involves complex numbers. So 
> should solveset(domain=Reals) change the definition of sqrt to only be 
> valid for positive numbers? 
>
> One of the reasons we default to complex numbers in SymPy is that it 
> simplifies things everywhere. We don't have to worry about an 
> algorithm doing something that isn't valid for a restricted "reals 
> only" function because it somehow goes through the complex plane. 
>
> Aaron Meurer 
>
> On Sun, Jul 15, 2018 at 11:19 AM, Yathartha Joshi <[email protected] 
> <javascript:>> wrote: 
> > Consider the following logarithmic equation: 
> > 
> > log(3*x) - log(1  - x) - log(4*x + 1) 
> > 
> > Wolfram alpha gives the result as `-1/2` and `1/2`, but mentions `-1/2` 
> is 
> > only valid when considering complex valued logarithm. 
> > 
> > So to solve this equation in the `Real` domain, should `-1/2` be 
> considered 
> > as a solution because substituting it in the equation will give log with 
> > negative argument and I suppose (I am not sure though) it should not be 
> > considered in the real domain 
> > 
> > When these solutions are checked using checksol() the result is `True` 
> for 
> > both the cases because the `I*pi` terms get canceled out. 
> > 
> > A brief background of this situation: 
> > 
> > I was implementing log solver for `_transolve` in #14792 and the idea is 
> to 
> > convert the equation into a single instance of `log` (using 
> `logcombine`) 
> > which can further be solved by passing it to `_solveset`, but result 
> > returned from `solveset` can have unwanted solutions (see this test). To 
> > remove such solutions `checksol()` can be used but it possesses a 
> problem as 
> > mentioned above, so I tried a different approach to remove these 
> solutions 
> > (see here) 
> > 
> > The problem is what should be done here, should such solutions be 
> > considered? If not is the approach used efficient enough to remove 
> > logarithmic singularities? 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sympy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > Visit this group at https://groups.google.com/group/sympy. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/sympy/c3915e4d-bb5d-443c-b38c-5f8aa2696478%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/080d86d5-233e-47b1-85b9-9f252ef25b08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to