Integral result differ from Wolfram|Alpha

49 views
Skip to first unread message

Bùi Gia Nghĩa

unread,
Nov 13, 2023, 4:32:11 PM11/13/23
to sage-support
Hi!
I have used Sage Cell Server to integrate the function (ln(x)^2 - 1) / (x * ln(x)). It should resulted in (ln(x)^2) / 2 - |ln(ln(x))| + C, as noted by my textbook and Wolfram|Alpha, but instead resulted in 1/2*log(x)^2 - 1/2*log(log(x)^2). 
(I do notice that SageMath use log(a) to denote natural logarithm, so that's not the question here).
Anyone knows why it happen? I think that this is a bug from some system SageMath use to calculate this, but I am new to SageMath so have zero knowledge about the system.
Here is the exact code I input:
var("x")
f = (log(x)**2 - 1) / (x * log(x))
integral(f, x)

Thanks in advance!

John H Palmieri

unread,
Nov 13, 2023, 4:53:55 PM11/13/23
to sage-support
Isn't log(log(x)^2) = 2 * log(log(x))? Is this your concern, or is it the absolute value?

Oscar Benjamin

unread,
Nov 13, 2023, 6:53:17 PM11/13/23
to sage-s...@googlegroups.com
On Mon, 13 Nov 2023 at 21:32, Bùi Gia Nghĩa <nghia...@gmail.com> wrote:
>
> Hi!
> I have used Sage Cell Server to integrate the function (ln(x)^2 - 1) / (x * ln(x)). It should resulted in (ln(x)^2) / 2 - |ln(ln(x))| + C, as noted by my textbook and Wolfram|Alpha, but instead resulted in 1/2*log(x)^2 - 1/2*log(log(x)^2).

Your textbook assumes that you are only interested in real
antiderivatives and so describes the antiderivative with abs that is
not complex-differentiable (i.e. not valid for non-real values of x).
The result from Sage is valid for e.g. x = 1+i whereas your textbook
result would be incorrect in that case.

--
Oscar

Bùi Gia Nghĩa

unread,
Nov 13, 2023, 6:53:18 PM11/13/23
to sage-s...@googlegroups.com
Oh that's why! Thank you because that is exactly the problem!

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/cdc2eaeb-3201-46e3-a37e-c90e747756c1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages