Plot integral expression

Trying to plot in Mathematica with an integral as the iterator

Plot[x, {Integrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], x], 0, 10^7}] 

But get the error that it the integral can’t be used as an iterator. On the other hand if I try

Plot[Integrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], x], {x, 0, 10^7}] 

I get the ‘invalid integration variable or limit’ error.

NIntegrate does not evaluate this finite integral composed of divergent parts

I would like to numerically evaluate the following integral:

$ $ I = \int_{-\infty}^\infty d\tau_3 \int_{-\infty}^\infty d\tau_4 \frac{1}{1+\tau_3^2} \left\lbrace \frac{2}{1+\tau_4^2} \log (\tau_3 – \tau_4)^2 + \left(\frac{1}{1+\tau_3^2} + \frac{1}{1+\tau_4^2} \right) \phi(\tau_3,\tau_4) \right\rbrace \tag{1}$ $

with $ \phi(r,s)$ a complicated function as defined in the code below. Note that the first term with the log is divergent, but that this divergence is canceled by another divergence present in the 2nd term with the $ \phi$ -function. When I try to evaluate the integral, NIntegrate stays unevaluated. Why is that, and what is the numerical value of this integral?

Here is the code I used so far:

S[\[Tau]3_, \[Tau]4_] := (\[Tau]3 - \[Tau]4)^2/(1 + \[Tau]3^2); a[\[Tau]3_, \[Tau]4_] := 1/4 Sqrt[4*R[\[Tau]3, \[Tau]4]*S[\[Tau]3, \[Tau]4] - (1 - R[\[Tau]3, \[Tau]4] - S[\[Tau]3, \[Tau]4])^2] ;  F[\[Tau]3_, \[Tau]4_] := I Sqrt[-((1 - R[\[Tau]3, \[Tau]4] - S[\[Tau]3, \[Tau]4] - 4 I*a[\[Tau]3, \[Tau]4])/(1 - R[\[Tau]3, \[Tau]4] - S[\[Tau]3, \[Tau]4] + 4 I*a[\[Tau]3, \[Tau]4]))]; phi[\[Tau]3_, \[Tau]4_] := 1/a[\[Tau]3, \[Tau]4] Im[PolyLog[2, F[\[Tau]3, \[Tau]4]*Sqrt[R[\[Tau]3, \[Tau]4]/S[\[Tau]3, \[Tau]4]]] + Log[Sqrt[R[\[Tau]3, \[Tau]4]/S[\[Tau]3, \[Tau]4]]] Log[1 - F[\[Tau]3, \[Tau]4]*Sqrt[R[\[Tau]3, \[Tau]4]/S[\[Tau]3, \[Tau]4]]]]; NIntegrate[1/(1^2 + \[Tau]3^2) (2/(1^2 + \[Tau]4^2)Log[(\[Tau]3 - \[Tau]4)^2] + (1/(1^2 + \[Tau]3^2) + 1/(1^2 + \[Tau]4^2)) phi[\[Tau]3, \[Tau]4]), {\[Tau]3, -\[Infinity], \[Infinity]}, {\[Tau]4, -\[Infinity], \[Infinity]}] 

How to use Trapezoidal Rule for approximating a definite integral from 0 to 30*60 5*v(t)\ dt

velocitydata = {200., 20.895780994409773, 10.986275727656292, 7.662410953506851, 5.998125878448737, 4.999000299900035, 4.332731606838267, 3.8567493313695387, 3.4997265945392857, 3.2220233380309256, 2.9998500112490625, 2.818065371605392, 2.666574078896326, 2.538386439381941, 2.428509477589222, 2.3332814832098125, 2.249956055974918, 2.176432934011989, 2.1110785329900605, 2.0526031497377395, 1.9999750004687404, 1.9523588169189425, 1.9090711873829898, 1.8695475468930842, 1.8333174191886965, 1.7999856001727976, 1.7692176833495532, 1.7407288016266662, 1.714274781445695, 1.6896451269910564, 1.6666574074845673, 1.645152730757279, 1.6249920654878016, 1.6060532320957523, 1.5882284246323966, 1.5714221574736715, 1.5555495542185434, 1.540534914053686, 1.526310504474162, 1.512815539733553, 1.4999953125219725, 1.4878004527119568, 1.4761862919948983, 1.4651123171705347, 1.4545416979860029, 1.4444408779281612, 1.4347792183895953, 1.4255286882592237, 1.4166635923132485, 1.408160332863668, 1.3999972000084, 1.3921541865573845, 1.3846128243129732, 1.3773560388842774, 1.3703680206329807, 1.3636341096975493, 1.3571406933360788, 1.350875114074985, 1.3448255873594115, 1.3389811275780437, 1.3333314814853396, 1.3278670681722977, 1.3225789248464297, 1.317458657775475, 1.3124983978300822, 1.3076907601301937, 1.3030288073598948, 1.2985060163674613, 1.2941162477124264, 1.2898537178607008, 1.285712973762941, 1.2816888695812, 1.2777765453550067, 1.2739714074208954, 1.27026911041953, 1.266665540742242, 1.2631568012844059, 1.259739197386856, 1.2564092238587217, 1.253163552985859, 1.2499990234386442, 1.2469126300014062, 1.2439015140533525, 1.240962954737622, 1.2380943607611097, 1.2352932627731243, 1.2325573062757642, 1.2298842450232272, 1.2272719348711656, 1.2247183280406884, 1.222221467764759, 1.2197794832875768, 1.2173905851900841, 1.2150530610170482, 1.2127652711832684, 1.2105256451383326, 1.2083326777710777, 1.2061849260364514, 1.204081005788894, 1.2020195888076308, 1.19999940000045, 1.1980192147735902, 1.1960778565563392, 1.1941741944698308, 1.192307141130332, 1.1904756505780585, 1.1886787163232235, 1.1869153695016552, 1.1851846771328776, 1.1834857404740797, 1.181817693463864, 1.180179701250117, 1.1785709587967457, 1.1769906895643907, 1.1754381442605732, 1.1739125996550557, 1.172413357456473, 1.170939743246574, 1.1694911054686528, 1.1680668144669837, 1.166666261574285, 1.1652888582444303, 1.1639340352278151, 1.162601241786949, 1.1612899449500012, 1.1599996288001782, 1.1587297937989383, 1.1574799561411815, 1.1562496471406645, 1.155038412644, 1.1538458124717037, 1.15267141988484, 1.1515148210759136, 1.150375614682726, 1.1492534113239998, 1.1481478331556445, 1.1470585134465943, 1.1459850961732263, 1.14492723563141, 1.1438845960653052, 1.142856851312065, 1.1418436844616617, 1.1408447875310836, 1.1398598611522026, 1.1388886142726473, 1.137930763869054, 1.1369860346721006, 1.1360541589027657, 1.1351348760192783, 1.1342279324742568, 1.1333330814815654, 1.1324500827924304, 1.1315787024803974, 1.1307187127347191, 1.1298698916617953, 1.1290320230942965, 1.1282048964076306, 1.1273883063434234, 1.1265820528397013, 1.1257859408674835, 1.1249997802735017, 1.1242233856287802, 1.1234565760828248, 1.1226991752231794, 1.1219510109401198, 1.1212119152962696, 1.120481724400925, 1.1197602782888993, 1.1190474208036916, 1.1183429994848042, 1.1176468654590366, 1.1169588733355942, 1.116278881104856, 1.1156067500406535, 1.114942344605917, 1.1142855323615606, 1.1136361838784714, 1.112994172652481, 1.1123593750222056, 1.1117316700896378, 1.1111109396433867`};

Integral $\int_{d_1}^{d_2} \int_{-L/2}^{L/2} \int_{-L/2}^{L/2} \frac{1}{(x^2+y^2+z^2)^3} dx dy dz$

I’m trying to integrate the following integral in the Mathematica, but it seems it doesn’t return an analytical closed form, neither numbers when I give values for both $ d_{1,2}$ and $ L$ .

$ \int_{d_1}^{d_2} \int_{-L/2}^{L/2} \int_{-L/2}^{L/2} \frac{1}{(x^2+y^2+z^2)^3} dx dy dz$

Is there any trick that might be useful for this case?

Error Solving Integral

I would like to solve this integral.

$ \int_{-\infty}^{p_{1}}\int_{-\infty}^{p_{2}}\frac{xz}{2\Pi\sqrt{1-p^{2}}}\exp^{{\frac{-1}{2(1-p^{2})}(x^{2}-2pxz+z^{2})}}dxdz$ \

For it I did the following change:

$ z=px+\sqrt{1-p^{2}}y$ \

Then, we can symplified in the expression:

$ (x^{2}-2pxz+z^{2})=x^{2}-2px(px+\sqrt{1-p^{2}}y)+(px+\sqrt{1-p^{2}}y)^2=$

$ x^{2}-2p^{2}x^{2}-2px\sqrt{1-p^{2}}y+p^2x^2+2px\sqrt{1-p^{2}}y+(1-p^2)y^2=$

$ x^2-p^2x^2+(1-p^2)y=$

$ (1-p^2)(x^2+y^2)$ \

By the other hand

$ y=\frac{z-px}{\sqrt{1-p^{2}}}$ \

Then

$ dy=\frac{1}{\sqrt{1-p^{2}}}dz$

$ \sqrt{1-p^{2}} dy = dz$ \

Replaced for the limit $ p_{2}$

$ y=\frac{p_{2}-px}{\sqrt{1-p^{2}}}$ \

In $ -\infty$ the limit is $ -\infty$ \

Then we subtitute in the integral:

$ \int_{-\infty}^{p_{1}}\int_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}\frac{xy\sqrt{1-p^{2}}}{2\Pi\sqrt{1-p^{2}}}\exp^{{\frac{-1}{2(1-p^{2})}(1-p^2)(x^2+y^2)}}dxdy$

$ \int_{-\infty}^{p_{1}}\int_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}\frac{xy\sqrt{1-p^{2}}}{2\Pi\sqrt{1-p^{2}}}\exp^{{\frac{-1}{2}(x^2+y^2)}}dxdy$

$ \int_{-\infty}^{p_{1}}\int_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}\frac{xy\sqrt{1-p^{2}}}{2\Pi\sqrt{1-p^{2}}}\exp^{{\frac{-x^2}{2}}}\exp^\frac{-y^2}{2}dxdy$

$ \int_{-\infty}^{p_{1}}\int_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}\frac{xy}{2\Pi}\exp^{{\frac{-x^2}{2}}}\exp^\frac{-y^2}{2}dxdy$

$ \int_{-\infty}^{p_{1}} \frac{x}{2\Pi}\exp^{{\frac{-x^2}{2}}} \int_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}y\exp^\frac{-y^2}{2}dxdy$ \

Then, the primitive of $ y \exp^\frac{-y^2}{2}$ is $ -\exp^{\frac{-y^2}{2}}$ \

Then we can obtain the result in the fist integral: \

$ \int_{-\infty}^{p_{1}} \frac{x}{2\Pi}\exp^{{\frac{-x^2}{2}}}dx -\exp^{\frac{-y^2}{2}} |_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}$ \

Then:

$ -\exp^{\frac{-y^2}{2}} |_{-\infty}^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}$

Is equal to: \

$ \exp^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}} – 0 = \exp^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}}$ \

Then appended this result to the integral, we have: \

$ \int_{-\infty}^{p_{1}} \frac{x}{2\Pi}\exp^{{\frac{-x^2}{2}}} \exp^{\frac{p_{2}-px}{\sqrt{1-p^{2}}}} dx$ \

$ \int_{-\infty}^{p_{1}} \frac{x}{2\Pi}\exp^{\frac{-x^2}{2} +\frac{p_{2}-px}{\sqrt{1-p^{2}}}} dx$ \

$ \int_{-\infty}^{p_{1}} \frac{x}{2\Pi}\exp^{\frac{-x^2}{2} -\frac{px}{\sqrt{1-p^{2}}}} \exp^{\frac{p_{2}}{\sqrt{1-p^{2}}}}dx$ \

$ \frac{\exp^{\frac{p_{2}}{\sqrt{1-p^{2}}}}}{2\Pi}\int_{-\infty}^{p_{1}} x \exp^{\frac{-x^2}{2} -\frac{px}{\sqrt{1-p^{2}}}} dx$

But, when I test this equation vs the first (numerical integration) the result is different. Where is the mistake?

Thx.

The replacement function is an integral and the double integral yields a different answer than the normal double integral

I am fairly new to Mathematica. I have a quick inquiry. The code is simple and just 3 lines. Trying to do a replacement rule as follows

ruletrr = intsl[exp_] :> Integrate[exp, {u, u, 1}] intsl[Integrate[a[u],{u,0,u}]]/.ruletrr 

So basically I want replace the expression inside the square brackets after ‘intsl’ with integrating the expression from u to 1. The expression inside the square bracket is in fact an integral as well. The integrand is a function of u. However, after the second line, the answer is as follows

(1 - u)*Integrate[a[u], {u, 0, u}] 

The answer means that Mathematica takes the expression inside the square bracker as a constant and not a function of u. Kindly copy the preceding line to see the integration symbol as I can’t do it here.

The problem is the first two line is equivalent to the following code line

Integrate[a[u], {u, u, 1}, {u, 0, u}] 

The answers are different. Can someone let me know where is the mistake here or why is the integral evaluated.

The entire code input is as follows as a summary

ruletrr = intsl[exp_] :> Integrate[exp,{u,u,1}] intsl[Integrate[a[u],{u,0,u}]]/.ruletrr Integrate[a[u], {u, u, 1}, {u, 0, u}] 

The first two lines are equivalent to the third line but the answers are different

Thanks in advance,

Ehab Emad

How can I calculate the exponential integral?

(I’m not sure this is the right forum.)

I’m writing a program that uses the prime-counting function. Right now, I’m using x/log(x), but I want to switch to something more accurate. A better approximation is the logarithmic integral function (actually, its Eulerian variant), which can be computed from the exponential integral. Now how can I compute the exponential integral? I’m on a macOS Intel system using Swift, so I can use the various advanced floating-point functions provided by Apple’s system libraries if needed to help.

Complicated Integral output with Unfamiliar Regularized Hypergeometric Function

I need the solution for following integral and it has output in MATHEMATICA as:

FullSimplify[  Integrate[x^(m - 1) Exp[-a x] Gamma[m, b/x], {x, 0, \[Infinity]},    Assumptions -> m > 1/2 && a > 0 && b > 0]] 

enter image description here

I really do not know the definition of the last Regularized Hypergeometric Function which has some numbers as superscripts.

Further, does anyone know how we can prove this analytically? Because there is very less integral formulas related to Regularized Hypergeometric Function.

Further, I found this output somehow numerically unstable for some large $ m$ .