Skip to content

Commit

Permalink
add compare sp.Integral and UnevaluatableIntegral
Browse files Browse the repository at this point in the history
  • Loading branch information
shenvitor committed Feb 6, 2024
1 parent df35f6c commit a726ce6
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions docs/usage/sympy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,150 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"There are numerous functions whose integrals cannot be expressed in terms of known special functions and for which no closed-form solutions have been identified yet. Here are a few examples:\n",
"\n",
"1. **Integral Involving Complex Exponential and Polynomials:**\n",
" $$ \\int e^{x + e^{-x}} dx $$\n",
" This integral combines an exponential function with a nested exponential term, leading to a complexity that resists simplification in terms of known functions.\n",
"\n",
"2. **Integral of a Rational Function Times an Exponential:**\n",
" $$ \\int \\frac{e^x}{x^2 + 1} dx $$\n",
" This integral involves the exponential function and a non-trivial rational function, which together do not yield to standard integration techniques.\n",
"\n",
"3. **Integral of an Exponential of a Trigonometric Function:**\n",
" $$ \\int e^{\\sin x} dx $$\n",
" The combination of an exponential function and a sinusoidal function is another case where known methods of integration in terms of elementary or special functions fail.\n",
"\n",
"4. **Product of a Polynomial and a Trigonometric Function:**\n",
" $$ \\int x^4 \\sin(x^2) dx $$\n",
" This integral combines a polynomial with a trigonometric function in a non-standard way, making it resistant to analytical methods.\n",
"\n",
"5. **Integral of a Logarithmic Function Inside an Exponential:**\n",
" $$ \\int e^{\\ln(x)/x} dx $$\n",
" The combination of a logarithmic function inside an exponential function, as seen here, creates a complex relationship not easily resolved by known functions.\n",
"\n",
"In the context of hadron physics and high-energy physics, encountering such challenging integrals is not uncommon. They can arise in theoretical models, complex scattering problems, or in the analysis of experimental data. In such cases, physicists often resort to numerical integration, computational approximations, or the development of new special functions or methods tailored to the problem at hand. These integrals, while not solvable in a traditional sense, can still provide significant insights into the behaviors and properties of the systems being studied."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Some example test to compare ``sp.Integral`` and ``UnevaluatableIntegral``"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UnevaluatableIntegral(sp.exp(-(x**4)), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sp.Integral(sp.exp(-(x**4)), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UnevaluatableIntegral(sp.sin(x) / x, (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sp.Integral(sp.sin(x) / x, (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UnevaluatableIntegral(sp.exp(x + sp.exp(-x)), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sp.Integral(sp.exp(x + sp.exp(-x)), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UnevaluatableIntegral(sp.exp(sp.log(x) / x), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sp.Integral(sp.exp(sp.log(x) / x), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UnevaluatableIntegral(sp.exp(sp.sin(x)), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sp.Integral(sp.exp(sp.sin(x)), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"UnevaluatableIntegral(sp.exp(x) / (x**2 + 1), (x, a, b)).doit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sp.Integral(sp.exp(x) / (x**2 + 1), (x, a, b)).doit()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit a726ce6

Please sign in to comment.