Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An interesting rational integral in Mathematica

77 views
Skip to first unread message

Sam Blake

unread,
Jan 12, 2024, 9:47:35 PMJan 12
to
Some of you may find this result interesting...

In[1047]:= $Version

Out[1047]= "13.2.0 for Mac OS X x86 (64-bit) (November 18, 2022)"

In[1048]:= Integrate[(2 - Sqrt[7] x^2 + 3 x^4)/(2 + Sqrt[7] x^2 - x^4)^2, x]

Out[1048]= 1/60 (30 x AppellF1[1/2, 2, 2, 3/2, (2 x^2)/(Sqrt[7] + Sqrt[15]), (2 x^2)/(Sqrt[7] - Sqrt[15])] -
5 Sqrt[7] x^3 AppellF1[3/2, 2, 2, 5/2, (2 x^2)/(Sqrt[7] + Sqrt[15]), (2 x^2)/(Sqrt[7] - Sqrt[15])] +
9 x^5 AppellF1[5/2, 2, 2, 7/2, (2 x^2)/(Sqrt[7] + Sqrt[15]), (2 x^2)/(Sqrt[7] - Sqrt[15])])

Cheers,

Sam

Sam Blake

unread,
Jan 12, 2024, 9:56:38 PMJan 12
to
... and here's an example where Rubi outperforms both Mathematica and my implementation of Mack's linear Hermite reduction (as given in Symbolic Integration I by Manuel Bronstein)

In[1151]:= (2 - 9 x^4 + 2 Sqrt[2] x^4 - 12 x^6 - 3 x^8)/(Sqrt[2] - 3 x^2 - x^4)^3;
HermiteReduce[%, x]
Integrate[%%, x]
Int[%%%, x]

Out[1152]= {-((37549921350591017222596 (102743992 x +
72655641 Sqrt[2] x))/((-8 + 9 Sqrt[2]) (-113 +
72 Sqrt[2])^4 (2200 + 1593 Sqrt[2])^2 (-32544 +
23137 Sqrt[2]) (3352883803641 +
2370846461804 Sqrt[2]) (-3186 - 2200 Sqrt[2] + 6600 x^2 +
4779 Sqrt[2] x^2 + 2200 x^4 + 1593 Sqrt[2] x^4))), 0}

Out[1153]= -(1/(
105 (-2 + 3 Sqrt[2] x^2 + Sqrt[2] x^4)^3))(Sqrt[2] - 3 x^2 -
x^4)^3 (210 x AppellF1[1/2, 3, 3, 3/2, (
2 x^2)/(-3 + Sqrt[9 + 4 Sqrt[2]]), -((2 x^2)/(
3 + Sqrt[9 + 4 Sqrt[2]]))] +
21 (-9 + 2 Sqrt[2]) x^5 AppellF1[5/2, 3, 3, 7/2, (
2 x^2)/(-3 + Sqrt[9 + 4 Sqrt[2]]), -((2 x^2)/(
3 + Sqrt[9 + 4 Sqrt[2]]))] -
5 (36 x^7 AppellF1[7/2, 3, 3, 9/2, (
2 x^2)/(-3 + Sqrt[9 + 4 Sqrt[2]]), -((2 x^2)/(
3 + Sqrt[9 + 4 Sqrt[2]]))] +
7 x^9 AppellF1[9/2, 3, 3, 11/2, (
2 x^2)/(-3 + Sqrt[9 + 4 Sqrt[2]]), -((2 x^2)/(
3 + Sqrt[9 + 4 Sqrt[2]]))]))

Out[1154]= x/(Sqrt[2] - 3 x^2 - x^4)




Sam Blake

unread,
Jan 13, 2024, 1:28:24 AMJan 13
to
For fairness, Rubi makes a mess of this one

In[1578]:= Int[(-2 - 2*Sqrt[3]*x - 3*x^2 + 4*Sqrt[3]*x^3 + 7*x^4 + 6*Sqrt[3]*x^5 + 10*x^6 + 2*Sqrt[3]*x^7 + 6*x^8 + x^10)/(1 + 3*x^2 + Sqrt[3]*x^3 + 3*x^4 + x^6)^2, x]

Out[1578]= -((3*3^(1/6) + 4*Sqrt[3] -
5*3^(5/6) + (3 - 4*3^(2/3))*
x)/(3*(3 - 4*3^(2/3))*(1 + 3^(1/6)*x + x^2))) -
(3^(1/3)*(6*I - 3*(-1)^(2/3)*3^(1/6) + 2*Sqrt[3] +
5*3^(5/6) + (-1)^(1/3)*(3 + 3^(2/3)*(2 + 2*I*Sqrt[3]))*x))/
((1 + (-1)^(1/3))^4*(4 - (-1)^(2/3)*3^(1/3))*(1 - (-1)^(1/
3)*3^(1/6)*x + x^2)) -
(2*(-1)^(1/3)*(3*(-1)^(2/3)*3^(1/6) + 4*Sqrt[3] +
5*(-1)^(1/3)*3^(5/6) + (3 - 4*(-3)^(2/3))*x))/
(3*3^(2/3)*(8 + 3^(1/3) + I*3^(5/6))*(1 + (-1)^(2/3)*3^(1/6)*x +
x^2)) +
(2*ArcTan[((-1)^(1/3)*3^(1/6) - 2*x)/
Sqrt[4 - (-1)^(2/3)*3^(1/3)]])/(3*
Sqrt[(1/2)*(8 + 3^(1/3) - I*3^(5/6))]) -
(2*ArcTan[((-1)^(2/3)*3^(1/6) + 2*x)/Sqrt[4 + (-3)^(1/3)]])/(3*
Sqrt[(1/2)*(8 + 3^(1/3) + I*3^(5/6))]) +
(2*I*ArcTanh[(3^(1/6)*(I - Sqrt[3]) - 4*I*x)/
Sqrt[2*(8 + 3^(1/3) - I*3^(5/6))]])/
(3*Sqrt[(1/2)*(8 + 3^(1/3) - I*3^(5/6))]) +
(2*I*ArcTanh[(3^(1/6)*(I + Sqrt[3]) - 4*I*x)/
Sqrt[2*(8 + 3^(1/3) + I*3^(5/6))]])/
(3*Sqrt[(1/2)*(8 + 3^(1/3) + I*3^(5/6))])

nob...@nowhere.invalid

unread,
Jan 13, 2024, 4:28:58 AMJan 13
to

Sam Blake schrieb:
Acording to Derive 6.10, the antiderivative is simply:

INT((2 - SQRT(7)*x^2 + 3*x^4)/(2 + SQRT(7)*x^2 - x^4)^2, x)

- x/(x^4 - SQRT(7)*x^2 - 2)

Martin.

nob...@nowhere.invalid

unread,
Jan 13, 2024, 4:29:03 AMJan 13
to

Sam Blake schrieb:
... with the same result being obtained by Derive 6.10:

INT((2 - 9*x^4 + 2*SQRT(2)*x^4 - 12*x^6 - 3*x^8)
/(SQRT(2) - 3*x^2 - x^4)^3, x)

- x/(x^4 + 3*x^2 - SQRT(2))

Martin.

nob...@nowhere.invalid

unread,
Jan 13, 2024, 4:29:08 AMJan 13
to

Sam Blake schrieb:
Derive 6.10 handles this in one step by one rule:

" INT(F'(x)/F(x)^n,x) -> -1/((n-1)*F(x)^(n-1)) "

Perhaps Rubi should be taught this rule as well?

Martin.

Sam Blake

unread,
Jan 13, 2024, 4:51:02 AMJan 13
to
Here's a similar example where Hermite reduction should return the integral without any logarithmic terms:

In[1793]:= (x^3 (2 + x^2))/(-2 + Sqrt[3] + (-2 + Sqrt[3]) x^2 - x^4)^2;
Integrate[%, x]
D[%, x] - %% // Simplify

Out[1794]= (((-2 - I) + Sqrt[3] - 2 x^2) ((1 + 2 I) - I Sqrt[3] +
2 I x^2) (x^4 (-2 I + ((2 - I) + Sqrt[3]) x^2) +
2 (-52 +
30 Sqrt[3] + ((-78 - 7 I) + (45 + 4 I) Sqrt[
3]) x^2 + ((-40 - 7 I) + (23 + 4 I) Sqrt[
3]) x^4 + ((-7 - 2 I) + (4 + I) Sqrt[3]) x^6) Log[(
2 (-2 + Sqrt[3]) + ((-2 - I) + Sqrt[3]) x^2)/(
2 (-2 + Sqrt[3]) + ((-2 + I) + Sqrt[3]) x^2)] +
2 (-52 +
30 Sqrt[3] + ((-78 - 7 I) + (45 + 4 I) Sqrt[
3]) x^2 + ((-40 - 7 I) + (23 + 4 I) Sqrt[
3]) x^4 + ((-7 - 2 I) + (4 + I) Sqrt[3]) x^6) Log[(
2 (-2 + Sqrt[3]) + ((-2 + I) + Sqrt[3]) x^2)/(
2 (-2 + Sqrt[3]) + ((-2 - I) + Sqrt[3]) x^2)]))/(8 (2 (-2 +
Sqrt[3]) + ((-2 - I) + Sqrt[3]) x^2) (-2 + Sqrt[
3] + (-2 + Sqrt[3]) x^2 - x^4)^2)

Out[1795]= 0

Sam Blake

unread,
Jan 13, 2024, 4:52:05 AMJan 13
to
On Saturday, January 13, 2024 at 8:29:08 PM UTC+11, nob...@nowhere.invalid wrote:
Rubi gets the general form

In[1796]:= Int[f'[x]/f[x]^n, x]

Out[1796]= f[x]^(1 - n)/(1 - n)

Sam
0 new messages