Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Compute the indefinite integral of an algebraic function in terms of elementary functions
ResourceFunction["IntegrateAlgebraic"][f,x] gives the indefinite integral , using heuristics for computing elementary solutions to pseudoelliptic and pseudohyperelliptic integrals. 
"DegreeBound"  8  degree bound for solving polynomial systems of equations for some Abelian integrals 
"Elementary"  True  whether the solution should be only composed of elementary functions 
"Expansion"  False  whether to expand the integrand and integrate termbyterm 
"SingleStepTimeConstraint"  0.25  time constraint in seconds used by some computationallyintensive routines 
"SubstitutionSize"  "Small"  the number of terms in the Laurent polynomial substitution 
VerifySolutions  True  whether numeric and symbolic checks are performed on the solution 
This is a wellknown pseudoelliptic integral:
In[1]:= 

Out[1]= 

Some integrals are expressed as a rational function of x and the radicals in the integrand:
In[2]:= 

Out[2]= 

Other integrals can be expressed in terms of Log, ArcTan and ArcTanh:
In[3]:= 

Out[3]= 

The following is an Abelian integral:
In[4]:= 

Out[4]= 

IntegrateAlgebraic can integrate all integrands in regardless of their size or complexity:
In[5]:= 

Out[5]= 

IntegrateAlgebraic can integrate all integrands in :
In[6]:= 

Out[6]= 

IntegrateAlgebraic can integrate all integrands in :
In[7]:= 

Out[7]= 

IntegrateAlgebraic can integrate all integrands in , as these are converted to rational functions via Euler’s substitution:
In[8]:= 

Out[8]= 

For the following integral, IntegrateAlgebraic uses the substitution to reduce the integral to :
In[9]:= 

Out[9]= 

For the following integral, IntegrateAlgebraic uses the substitution to reduce the integral to :
In[10]:= 

Out[10]= 

For the following integral, IntegrateAlgebraic uses the substitution to reduce the integral to :
In[11]:= 

Out[11]= 

Some integrals will introduce algebraic numbers that are not present in the integrand:
In[12]:= 

Out[12]= 

IntegrateAlgebraic works with radicals other than square roots:
In[13]:= 

Out[13]= 

Some integrals will be expressed in terms of RootSum expressions:
In[14]:= 

Out[14]= 

IntegrateAlgebraic can often work with parameters in the integrand:
In[15]:= 

Out[15]= 

IntegrateAlgebraic has a limited ability to integrate nested radicals:
In[16]:= 

Out[16]= 

IntegrateAlgebraic can succeed on some integrals where the RischBronsteinTrager algorithm struggles:
In[17]:= 

Out[17]= 

IntegrateAlgebraic can handle many otherwise difficult integrals involving parameters:
In[18]:= 

Out[18]= 

IntegrateAlgebraic can handle many integrals when the radicand is a rational function:
In[19]:= 

Out[19]= 

In[20]:= 

Out[20]= 

The option "Expansion" → True specifies if the integrals is expanded and integrated termbyterm after exhausting all other possible methods. By default "Expansion" is False, as this method may require many time consuming recursive calls to IntegrateAlgebraic:
In[21]:= 

Out[21]= 

In[22]:= 

Out[22]= 

With "Expansion" → True, IntegrateAlgebraic may return partial results:
In[23]:= 

Out[23]= 

The default for "DegreeBound" is 8:
In[24]:= 

Out[24]= 

Increasing the degree bound can solve some large Abelian integrals:
In[25]:= 

Out[25]= 

In[26]:= 

Out[26]= 

"Elementary" specifies if the solution should be composed of elementary functions only. By default "Elementary" is True:
In[27]:= 

Out[27]= 

The option "SingleStepTimeConstraint" specifies the time in seconds that IntegrateAlgebraic spends in various computationallyintensive routines. The default for "SingleStepTimeConstraint" is 0.25. Increasing this time constraint may solve some integrals that otherwise return unevaluated:
In[28]:= 

Out[28]= 

In[29]:= 

Out[29]= 

The option "SubstitutionSize" determines the number of rational substitutions tried within IntegrateAlgebraic. By default "SubstitutionSize" is "Small". Other settings are "Medium" and "Large". By default, the Laurent polynomial substitution code considers a polynomial with 3 terms only:
In[30]:= 

Out[30]= 

With "SubstitutionSize"→"Medium", we use a Laurent polynomial substitution with 4 terms:
In[31]:= 

Out[31]= 

VerifySolutions numerically verifies the solution obtained by IntegrateAlgebraic. By default this is False. Verifying the solution will increase the runtime of IntegrateAlgebraic:
Out[31]= 

Out[31]= 

If the integral is continuous, then the definite integral can be computed using Newton–Leibniz:
In[32]:= 

Out[32]= 

In[33]:= 

Out[33]= 

In[34]:= 

Out[34]= 

IntegrateAlgebraic uses SolveAlways to determine if a rational substitution can simplify a radical. Consider the integral and a candidate substitution of the form . The following computation shows that we can reduce to , where :
In[35]:= 

Out[35]= 

In[36]:= 

Out[36]= 

In[37]:= 

Out[37]= 

In[38]:= 

Out[38]= 

In[39]:= 

Out[39]= 

Once the candidate substitution is known, GroebnerBasis and Solve may be used to simplify the integral. For example, use the substitution to evaluate the integral :
In[40]:= 

Out[40]= 

In[41]:= 

Out[41]= 

In[42]:= 

Out[42]= 

This is essentially how IntegrateAlgebraic has computed the integral, except additional postprocessing is done to express the integral in terms of the radicals in the integrand (which makes the solution valid for all x):
In[43]:= 

Out[43]= 

IntegrateAlgebraic will often return an answer in terms of elementary functions when Integrate will return an answer in terms of special functions:
In[44]:= 

Out[44]= 

In[45]:= 

Out[45]= 

Some integrals will take longer than others:
In[46]:= 

Out[46]= 

In[47]:= 

Out[47]= 

Trager’s Hermite reduction will always find the rational (algebraic) part of the integral, whereas the methods used by IntegrateAlgebraic will sometimes fail:
In[48]:= 

Out[48]= 

In[49]:= 

Out[49]= 

IntegrateAlgebraic will fail to compute some algebraic integrals which possess elementary solutions:
In[50]:= 

Out[50]= 

In[51]:= 

Out[51]= 

In[52]:= 

Out[52]= 

In[53]:= 

Out[53]= 

This work is licensed under a Creative Commons Attribution 4.0 International License