New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve misses solution with 1/ln(x) #11047

Open
trxrunner opened this Issue Apr 24, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@trxrunner

trxrunner commented Apr 24, 2016

>>> solve(1/ln(x),x)
[] #should be [0]

>>> solveset(1/ln(x),x)
EmptySet() #should be {0}

>>> 1/ln(0)
0
@wxgeo

This comment has been minimized.

Contributor

wxgeo commented Apr 30, 2016

It's not a proper solution unless domain is extended complex (by that, I mean Complex Field U {zoo}), since ln(0) does not exist if ln is defined as a C -> C function.

And if we include 0 in this case, what should return something like that :
In [15]: solve((x**2+2*x+1)*2/(x(x+1)),x)
Out[15]: []

In [16]: solveset((x**2+2*x+1)*2/(x(x+1)),x)
Out[16]: ∅

Should -1 be a solution ? Then we have to start calculating limits...

@wxgeo

This comment has been minimized.

Contributor

wxgeo commented Apr 30, 2016

Note that Wolfram Alpha doesn't return any solution either

solve(1/ln(x))
(no solutions exist)

@Shekharrajak

This comment has been minimized.

Member

Shekharrajak commented Apr 30, 2016

wolframalpha shows no solution .
But your argument is correct.Because ln(0) is zoo negative infinity.

@wxgeo

This comment has been minimized.

Contributor

wxgeo commented Apr 30, 2016

In fact, zoo is not negative infinity, it's complex infinity.

In [5]: ln(0.00000000000000000001j).evalf()
Out[5]: -46.0517018598809 + 1.5707963267949⋅ⅈ

If z -> 0, re(ln(z)) -> -oo, but it's imaginary part im(ln(z)) don't necessary converge.

Shekharrajak added a commit to Shekharrajak/sympy that referenced this issue May 1, 2016

@Shekharrajak

This comment has been minimized.

Member

Shekharrajak commented May 1, 2016

@wxgeo Thanks for pointing out the problem.
ln(0) should be S.NegativeInfinity .
From the current branch

In [ ]: ln(0) == S.NegativeInfinity
Out[ ]: False

I have added one testcase in this branch : #11008

@trxrunner

This comment has been minimized.

trxrunner commented May 10, 2016

Solve also misses it with 1/tan(x).

solve(1/tan(x),x)
[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment