Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.7K Views
|
11 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Comparison of Different Integration Results from FriCAS and Wolfram Language

Posted 2 years ago
POSTED BY: Hongyi Zhao
11 Replies

It is straightforward to verify that both are correct antiderivatives.

integrand = (4*x-1)/Sqrt[x^4 - 2*x^3 + 3*x^2 + 2*x + 1];
primWL = -Log[-2*x + 5*x^2 - 3*x^3 + x^4 + (-2 + 2*x - x^2)*
    Sqrt[1 + 2*x + 3*x^2 - 2*x^3 + x^4]];
primFC = Log[(x^2 - 2*x + 2)*Sqrt[x^4 - 2*x^3 + 3*x^2 + 2*x + 1] + x^4 -
    3*x^3 + 5*x^2 - 2*x];  

In[8]:= Simplify[D[primWL,x]-integrand]

(* Out[8]= 0 *)

In[9]:= Simplify[D[primFC,x]-integrand]

(* Out[9]= 0 *)

As for why they differ, it will amount to differences in paths taken in the respective codes.

POSTED BY: Daniel Lichtblau
Posted 2 years ago

Only FriCAS one plots.

POSTED BY: ZAQU zaqu
Posted 2 years ago

Can Wolfram calculate the indefinite integral of: integrate (((-4x-8)log(x)+(-2x^2-4x))/(3xexp(2*log(x)+x)^2-x), x)

When I enter it, it gives me a definite integral result: NIntegrate[(-4 x - 2 x^2 + (-8 - 4 x) Log[x])/(-x + 3 E^(2 x) x^5), {x, 1, Infinity}]

Thanks

POSTED BY: Gene Connor

It does not calculate the indefinite integral, but it does not turn it into a numeric definite integral either:

Integrate[((-4 x - 8) Log[x] + (-2 x^2 - 4 x))/(
 3 x  Exp[2*log[x] + x]^2 - x), x]
POSTED BY: Gianluca Gorni
Posted 2 years ago

Why doesn't Mathematica calculate the indefinite integral? Is it outside the abilities of the software? If so, can you guess why? Thanks

POSTED BY: Gene Connor

It is out of the capabilities of the software, because another free online tool can find a primitive, which is easily checked:

f[x_] = (x + 2 Log[x])^2 + 1/2  (Log[3] Log[-1 + 3  E^(2 x)  x^4] +
      PolyLog[2, 1 - 3  E^(2 x)  x^4]);
f'[x] - ((-4  x - 8)  Log[x] + (-2  x^2 - 4  x))/(
     3  x   Exp[2*Log[x] + x]^2 - x) //
  PowerExpand // Simplify
POSTED BY: Gianluca Gorni
Posted 2 years ago

"As you can see, these two results are different in form, although they are supposed to be equivalent."

FriCAS one is more correct, and it is not surprising, as it has almost complete Risch- Davenport-Trager-Bronstein-Miller algorithm. It even has the mistakes Davenport did (see paper that corrects Davenport https://www.intlpress.com/site/pub/pages/journals/items/acta/content/vols/0225/0002/a002/) fixed.

Indeed, if you do Plot

only

Plot[-Log[(x^2 - 2 x + 2) Sqrt[x^4 - 2 x^3 + 3 x^2 + 2 x + 1] + x^4 - 3 x^3 + 5 x^2 - 2 x], {x, -10, 10}]

plots. The other does not Plot because it is complex (and not just that it has some complex numbers inside, those can be plotted sometimes).

That was already discussed on stack.

POSTED BY: ZAQU zaqu
Posted 2 years ago

Indeed, if you do Plot

only

Plot[-Log[(x^2 - 2 x + 2) Sqrt[x^4 - 2 x^3 + 3 x^2 + 2 x + 1] + x^4 - 3 x^3 + 5 x^2 - 2 x], {x, -10, 10}]

plots. The other does not Plot because it is complex (and not just that it has some complex numbers inside, those can be plotted sometimes).

You should say:

only

Plot[Log[(x^2 - 2 x + 2) Sqrt[x^4 - 2 x^3 + 3 x^2 + 2 x + 1] + x^4 - 
3 x^3 + 5 x^2 - 2 x], {x, -10, 10}]

plots.

In fact, as for the result given by Wolfram, while running plot, I noticed that an image of a similar shape flashed and then disappeared.

POSTED BY: Hongyi Zhao
Posted 2 years ago

FriCAS claims to have this feature: integration (most complete implementation of the Risch algorithm), what about wolfram?

POSTED BY: Hongyi Zhao
Posted 2 years ago
POSTED BY: Bill Nelson

That claimed difference is correct. This can be seen by noting that the product of the log arguments in the respective results (which are algebraic conjugates), once expanded, is -4. Since one factor is positive the law of logarithms applies (log(a*b)=log(a)+log(b)). So -log(b) is equivalent to log(a) as an antiderivative, and the difference is log(-4) (or its negative, depending on which is subtracted from the other).

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard