1

I am currently working on a Maxima script that is supposed to calculate the definite integral from -1 to 1 of the absolute value of any given polynomial 'p'. In my case, I've chosen 'p' to be 'x^3-1/4', but it could be any other polynomial.

load("abs_integrate");
normaU(p):=integrate(abs(p),x,-1,1);
normaU(x^3-(1/4));

wxmaxima code

When I run the code, Maxima returns the integral expression integrate(abs(x^3-1/4),x,-1,1), but does not evaluate it.

What's troubling is that this issue only arises when the polynomial is of degree 3 or higher. For lower degree polynomials, the integration seems to work fine.

I couldn't find much information about the 'abs_integrate' package and how it works, which is why I'm turning to this community for help.

Can anyone explain why this might be happening and how I could go about solving this issue? Any insights or suggestions would be greatly appreciated!

Thank you in advance.

nehemuel
  • 61
  • 1
  • 5
  • This is an interesting problem, I think you'll have to separate the problem into some pieces in order to reach a solution. The hard part of this is determining the roots of the polynomial, and then determining whether any roots are on the interval (-1, 1). These are both hard, it turns out -- expressions for polynomial roots in terms of radicals (1/integer powers) are often very messy, even when they exist (and they don't exist, in general, for polynomials of degree greater than or equal to 5), and, perhaps surprisingly, – Robert Dodier Jun 09 '23 at 01:30
  • given an expression in radicals, finding the sign of (expression + 1) and (expression - 1) can be difficult. (If numerical approximations are sufficient, these steps are much simpler.) Anyway there is `solve` to find roots of a polynomial, and `sign` to help figure out if a root is on the interval (-1, 1). With these parts, you can put together the whole solution. The catch is that Maxima might fail to find the roots or sign for some examples. – Robert Dodier Jun 09 '23 at 01:33
  • I seem to recall that there is an identity involving the roots and derivative of a polynomial, but I can't find it now; maybe you can look for such an identity. You might take up the question on math.stackexchange.com -- I wouldn't be surprised if there are theorems related to this problem. – Robert Dodier Jun 09 '23 at 01:40

0 Answers0