HP Forums

Full Version: Integral crash
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
∫(sec(x), x = 0 .. pi/6) = gd-1(pi/6) = asinh(tan(pi/6)) ≈ 0.549306

However, when I try to "fold" it, XCas crashes.

XCas> 2*cos(pi/12)* ∫(cos(pi/12-x) / (cos(x)*cos(pi/6-x)), x = 0 .. pi/12)

Tested on XCas 1.9.0-22 (win32)      → CRASH

Interestingly, XCas 1.5.0-63 (win32) (old version), does not have problem with this.

I wonder if latest HP Prime, with code based from XCas, will fail too ...
I tried the original formula as well as the "folded" formula with the physical calculator (G1 and G2, both version 2.1.14603 from Dec. 2021) and all worked quite well. If you put a decimal point after each number you immediately get the result 0.549306, if you do not, you get a strange expression but if you evaluate it you get the same result.
So there seems to be no problem with the physical calculators and the software version from Dec. 2021.
Thanks rawi,

That narrowed down the bug from Dec 2021 to Sep 2022 (latest XCas 1.9.0-22)

while we are at it, there is an annoying bug, which old XCas 1.5.0 does not have.

XCas> plot([sin(x), cos(x)], x = 0 .. 2*pi, color=[blue, red])
XCas> plot([sin(x), cos(x)], x = 0 .. 2*pi, legend=["sin", "cos"])

1st plot, both curves are drawn in blue
2nd plot, both curves have legend ["sin"

To make the curves match color/legend, we have to put both in.

XCas> plot([sin(x), cos(x)], x = 0 .. 2*pi, color=[blue,red], legend=["sin", "cos"])
1.9.0-31 is the latest version, and the integral is correct there.
I'll have a look at plot ASAP. I made changes so that plot can guess a parametric plot as argument, this might be the reason. If you run plotfunc instead that should work.
Hi, parisse

I downloaded XCas 1.9.0-31 (mingw), it work! Thanks!
XCas 32-bits version is still 1.9.0-22 though (when will it catch up 64-bits versions?)

Bonus, result is a lot less messy than expected

XCas> 2*cos(pi/12)* ∫(cos(pi/12-x) / (cos(x)*cos(pi/6-x)), x = 0 .. pi/12)

\(\displaystyle -
\frac{\left(\sqrt{2}+\sqrt{6}\right) \left(-\sqrt{2} \ln \left(\frac{\sqrt{2}}{2}\right)+\sqrt{2} \ln \left(\frac{\sqrt{6}}{2}\right)+\sqrt{6} \ln \left(\frac{\sqrt{2}}{2}\right)-\sqrt{6} \ln \left(\frac{\sqrt{6}}{2}\right)\right)}
{4}\)

XCas> simplify(ans())      → (-ln(2)+ln(6))/2
XCas> simplify(ans())      → ln(3)/2

Also, plotfunc for plot fixed the color/legend issues.
What is the difference between the two?
Latest XCas version 1.9.0-31, changed string default color.
It went from "Hello, world" to "Hello, world"

I tried cfg color menu, but there does not seems to a way to switch it back.
XCas 1.9.0.31 (mingw), if I run anything, say 1 Enter

Ctrl-Q (to quit), Enter, escape, Enter, escape

I get this repeated message, and the system hang.

*** bug in PARI/GP (Segmentation Fault), please report ***
Indeed, this will be fixed in 1.9.0-37.
(BTW, you should probably create an account on Xcas forum to report that kind of bugs)
Reference URL's