integral bug in xCas or HP PRIME
07-30-2020, 08:14 PM
Post: #1
 robmio Junior Member Posts: 37 Joined: Jan 2020
integral bug in xCas or HP PRIME
Hello everyone. I encountered an error calculating this integral:

int(exp(-s*t)*t*ln(t),t):

xCas or HP PRIME:

Ei((-s)*t)/s^2-e^((-s)*t)*ln(t)/s^2-t*e^((-s)*t)*ln(t)/s

Correct result:

Ei((-s)*t)/s^2-e^((-s)*t)*ln(t)/s^2-t*e^((-s)*t)*ln(t)/s-e^((-s)*t)/s^2

Do you think it's an xCas bug or am I doing something wrong?
07-30-2020, 08:33 PM
Post: #2
 Albert Chan Senior Member Posts: 1,243 Joined: Jul 2018
RE: integral bug in xCas or HP PRIME
Hi, robmio

this look like XCas bug:

XCas> f := exp(-s*t)*t*ln(t)
XCas> simplify(diff(int(f,t),t) - f) → -exp(-s*t)/s

Difference should be 0
07-31-2020, 06:23 AM
Post: #3
 robmio Junior Member Posts: 37 Joined: Jan 2020
RE: integral bug in xCas or HP PRIME
Thanks for confirming, Albert Chan. However, apart from this type of bug (which leads to incorrect results in calculating the Laplace transform of functions such as: "t^n*ln(x)", with "n∈N" and "n >= 0"), another limit of xCas, which I hope will be overcome sooner or later, is the calculation of limits of the type: "lim (Ei(i*x), x, +infinity" --> Pi*i, in the context of inverse Laplace transforms.
What do you think about it?
07-31-2020, 11:14 AM
Post: #4
 Albert Chan Senior Member Posts: 1,243 Joined: Jul 2018
RE: integral bug in xCas or HP PRIME
Paradoxically, simple substitution x=s*t eliminated the bug

XCas> f := exp(-s*t)*t*ln(t)
XCas> g := subst(f, t=x/s) / s ﻿ ﻿ ﻿ // dt = dx/s ⇒ f dt = g dx
XCas> G := int(g, x) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ // G = (-exp(-x)+ln(x/s)*exp(-x)*(-x-1)+Ei(-x))/s^2
XCas> F := subst(G, x=t*s) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿// F = (-exp(-s*t)+ln(t)*exp(-s*t)*(-s*t-1)+Ei(-s*t))/s^2
XCas> simplify(diff(F,t) - f) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿// 0 ⇒ F = ∫ f dt
07-31-2020, 11:43 AM
Post: #5
 robmio Junior Member Posts: 37 Joined: Jan 2020
RE: integral bug in xCas or HP PRIME
Great tip!

Paradoxically the integral is calculated correctly also with "ibpdv(exp(-s*t)*t*ln(t),-exp (-s*t)/s,t)"

--> (-t)*exp((-s)*t)*ln(t)/s+int((exp((-s)*t)*ln(t)+exp((-s)*t))/s,t).

I hope the various bugs will be corrected with the next firmware.

Sincerely, Roberto.
07-31-2020, 02:42 PM
Post: #6
 Albert Chan Senior Member Posts: 1,243 Joined: Jul 2018
RE: integral bug in xCas or HP PRIME
(07-31-2020 11:43 AM)robmio Wrote:  Paradoxically the integral is calculated correctly also with "ibpdv(exp(-s*t)*t*ln(t),-exp (-s*t)/s,t)"

I did not know XCas had build-in integration by parts. Thanks !

d(uv) = u dv + v du ﻿ ﻿ ﻿ ﻿ → ∫u dv = uv - ∫v du

Note: ibpu()/ibpdv() result had the minus sign *inside* integral, ∫u dv = uv + ∫-v du

Instead of v = exp(-s*t), you can also let dv = exp(-s*t), and let CAS handle scaling.
Or, even better, let u = t*ln(t), and let CAS figure out v.

XCas> f := exp(-s*t)*t*ln(t)
XCas> m := ibpu(f, t*ln(t),t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ // [-t*ln(t)*exp(-s*t)/s , (exp(-s*t)+ln(t)*exp(-s*t))/s]
XCas> F := m[0] + int(m[1],t) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ // note the + sign
XCas> simplify(diff(F,t) - f) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿// 0
07-31-2020, 04:25 PM
Post: #7
 robmio Junior Member Posts: 37 Joined: Jan 2020
RE: integral bug in xCas or HP PRIME
Great tip! Indeed, the HP PRIME calculator is really valid, despite some bugs, which, I hope, will be eliminated with the next firmware...

Best regards, Roberto.
08-03-2020, 07:41 PM
Post: #8
 parisse Senior Member Posts: 1,136 Joined: Dec 2013
RE: integral bug in xCas or HP PRIME
This is indeed a bug in Xcas, now fixed, thank you!
08-04-2020, 12:05 PM
Post: #9
 robmio Junior Member Posts: 37 Joined: Jan 2020
RE: integral bug in xCas or HP PRIME

Cordially greeting, Roberto Mioni (robmio).
08-04-2020, 03:01 PM
Post: #10
 klesl Member Posts: 67 Joined: Mar 2016
RE: integral bug in xCas or HP PRIME
xcas is available here
https://www-fourier.ujf-grenoble.fr/~parisse/giac.html
08-04-2020, 06:46 PM
Post: #11
 parisse Senior Member Posts: 1,136 Joined: Dec 2013
RE: integral bug in xCas or HP PRIME
The bug is not yet fixed in the binaries. Probably end of next week for win64.
08-05-2020, 11:29 AM
Post: #12
 robmio Junior Member Posts: 37 Joined: Jan 2020
RE: integral bug in xCas or HP PRIME
Very well, thank you very much. Roberto Mioni (robmio).
08-07-2020, 01:47 PM
Post: #13
 compsystems Senior Member Posts: 1,276 Joined: Dec 2013
RE: integral bug in xCas or HP PRIME
I think that this year also the CAS of the hp-prime is updated to 1.6.x =)

https://tiplanet.org/forum/portal.php
08-08-2020, 08:21 AM
Post: #14
 robmio Junior Member Posts: 37 Joined: Jan 2020
RE: integral bug in xCas or HP PRIME
Great. We will look forward to it
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)