Hot answers tagged

11

There appears to be a bug, not in Integrate or in BesselK, but in the vertical-axis Ticks of LogLogPlot. Consider the simple case, LogLogPlot[Exp[x], {x, 10^-10, 1}, PlotRange -> All] as it should be. However, LogLogPlot[Exp[x], {x, 10^-10, 1}, WorkingPrecision -> 50, PlotRange -> All] In fact, any value of WorkingPrecision except ...


11

region = ImplicitRegion[ 0 < z < 4 - x*y && 0 <= x <= 2 && 0 <= y <= 1, {x, y, z}]; RegionPlot3D[region, BoxRatios -> {1, 1, 1}, Axes -> True] Volume[region] (* 7 *) RegionMeasure[region] (* 7 *) Integrate[1, {x, 0, 2}, {y, 0, 1}, {z, 0, 4 - x*y}] (* 7 *) Integrate[1, Element[{x, y, z}, ...


10

You need to delay the evaluation of the right-hand side of ScalarCurvature: ScalarCurvature[fun_, xx_, yy_] := scalar /. Derivative[i_, j_][f][x, y] :> D[fun, {xx, i}, {yy, j}] Then it works, although there is a sign difference to your formula: ScalarCurvature[x^2 - y^2, x, y] -(8/(1 + 4 x^2 + 4 y^2)^2)


9

You can take Michael Trott's code and modify it a bit to easily plot these surfaces Import["http://www.mathematicaguidebooks.org/V6/downloads/\ RiemannSurfacePlot3D.m"] rsurf[func_] := Grid[{{RiemannSurfacePlot3D[w == func, Re[w], {z, w}, ImageSize -> 400, Coloring -> Hue[Rescale[ArcTan[1.4 Im[w]], {-Pi/2, Pi/2}]], PlotPoints ...


9

It seems that the analytic result is correct, but the precision is lost when converting it to a number. For example, if we use a higher precision, we get consistent results between numerical and analytical integration: f[a_, b_] = Integrate[x^2 Exp[-a x^2 - b x^4], {x, -∞, ∞}, Assumptions -> {a > 0, b > 0}] g[a_, b_] := NIntegrate[x^2 Exp[-a ...


9

I believe that s = ArcTan[Sqrt[-4 E^(I a)]] N[Limit[s, a -> 0]] (* 4.71239 + 0.549306 I *) is a bug in Limit. Plotting the function s Plot[Evaluate[ReIm[s]], {a, -1, 1}] indicates that s assumes the value above nowhere in the vicinity of a == 0. (The same is true in the complex plane.) Furthermore, Limit[s, a -> 0] (* π + I ArcTanh[2] *) ...


8

The culprit, as suspected by xslittlegrass, is indeed numerical instability; in particular, this is because of the perverse combination of modified Bessel functions exhibited in the result returned by Mathematica. Using a recurrence identity satisfied by the modified Bessel function of the first kind, we can simplify the expression returned, like so: ...


7

Since there are three constants and all of them are crucial in the computation we should somehow restrict possible values of the constants. One can see that the integral is quite different in three distinct cases b < 0, b == 0 and b > 0: TraditionalForm[ int[A_, b_, r_] = Piecewise[{Integrate[(1 - (1/(1 + A x^(-b)))) x, {x, 0, r}, ...


7

Area As described on this page, the area enclosed by a polar curve is given by $$A = \int_\alpha^\beta \frac{r(\theta)^2}{2} \mathrm{d}\theta$$ In your case this is, Integrate[Sin[2 θ]^2/2, {θ, 0, π}] N@% (* π/4 *) (* 0.785398 *) You can get this same answer using Region functionality by first making a RegionPlot, converting it to a MeshRegion and ...


6

Some insight can be gained by plotting Sqrt[Exp[I*t]^2 - 1] in the complex plane. Plot3D[Evaluate[ReIm[Sqrt[Exp[I*t]^2 - 1] /. t -> tr + I ti]], {tr, 0, Pi}, {ti, -1, 1}, AxesLabel -> {tr, ti, f}] Branch points occur at t == n Pi, n an integer, with branch cuts extending from the branch points to t == n Pi + I ∞. Visibly, there also are ...


5

You need to be consistent with the order of the variables defining the region: region = ImplicitRegion[{(y - 1/2) - (x + t) > 0, x - y > 0}, {{x, -1, 1}, {t, -1, 1}, {y, -1, 1}}] Integrate[(y - 1/2) - (x + t), Element[{x, t, y}, region]] (* 5/128 *) Check: Integrate[1, Element[{x, t, y}, region]] (* 11/48 *) ...


5

Using Green's theorem (using in this case: 1/2{-y,x}): c[t_] := {Sin[2 t] Cos[t], Sin[2 t] Sin[t]} Integrate[1/2 ({-1, 1} c[t][[{2, 1}]]).c'[t], {t, 0 , Pi}] yields $\pi/4$. Arc length: arclength = Integrate[Sqrt[c'[t].c'[t]], {t, 0, Pi}] yields:4 EllipticE[3/4] (4.84422)


5

Plot3D[{4 - y, 4 - x^2, 0}, {x, -2, 2}, {y, 0, 4.1}, PlotStyle -> {{Blue, Opacity[0.7]}, {Yellow, Opacity[0.4]}, {Green, Opacity[0.4]}}, AxesLabel -> Automatic, Mesh -> None, RegionFunction -> Function[{x, y, z}, 0 <= z <= Min[4 - x^2, (4 - y)]]] ParametricPlot3D: ParametricPlot3D[{{x, y, ConditionalExpression[4 - x^2, 4 - x^2 ...


5

Identities from MathematicalFunctionData can be useful when Mathematica can't seem to rewrite things in a form we want. whit[k_, m_, z_] = Activate[MathematicalFunctionData[ WhittakerW, "AlternativeRepresentations"][[4]][k, m, z][[1, 2]]] int = FullSimplify[whit[0, a, x] whit[1, b, x]] Integrate[int/x, x] (* large output of HypergeometricPFQs *) ...


4

As it turns out, although Mathematica is unable to deal with the integral as it stands, using the Kelvin functions yields an answer equivalent to the one returned by Maple. In particular, Integrate[(y/x) (KelvinBer[1, x]^2 + KelvinBei[1, x]^2), {y, 0, r}, {x, 0, y}] 1/32 r^4 HypergeometricPFQ[{1/2}, {3/2, 3/2, 2, 2}, r^4/64] where I used one of the ...


4

Preliminary post For k/z = 1 there is a closed form result: I[1,1,a]=((4 + a^2) BesselK[0, a] + a (4 BesselK[1, a] + a BesselK[2, a]))/(2 a^3) The derivation and the extension to k/z != 1 requires some manual interaction to help Mathematica which we will show in the following. Solution Summary As the integral to be calculated is returned unevaluated ...


4

Here's a way with ParametricRegion: With[{r = Sin[2θ]}, Area[ParametricRegion[{t r Cos[θ], t r Sin[θ]}, {{t, 0, 1}, {θ, 0, π}}]] ] π/4 Edit Looks like Area has a built in syntax for parameterized surfaces: With[{r = Sin[2θ]}, Area[{t r Cos[θ], t r Sin[θ]}, {t, 0, 1}, {θ, 0, π}] ] π/4 Edit 2 Or we can explicitly tell Area to use polar ...


4

Following up on @J.M.'s observations in the comments, differentiate $$m(t)=m(0)-\frac{T(t)-T_0}{Q_S}$$ to get $$\frac{dm}{dt}=-\frac{T'(t)}{Q_S}$$ Combine with $$\frac{dm}{dt}=4 \, T(t)^{3}+T(t)^{2}$$ to get a differential equation in T[t]: $$ T'(t)=-\text{Qs} \left(4 \, T(t)^3+T(t)^2\right)$$ Use DSolve with initial value T[0] == t0: DSolve[{T'[t] ...


3

Here is a simple answer Define k[n] as a listable function : SetAttributes[k, Listable] k[n_] := \!\( \*SubsuperscriptBox[\(\[Integral]\), \(3\), \(10\)]\( \*FractionBox[\(1 + Cos[f\ \((1 + 2\ n\ )\)\ \[Pi]]\), \(1 + Cos[f\ \[Pi]]\)] \[DifferentialD]f\)\) then define a list compose of integer of the desired Length --- say 10 nn = Range[10] ask ...


3

It is definitely a bug. And it can be formuated even more sharply. $Version (* Out[156]= "10.1.0 for Microsoft Windows (64-bit) (March 24, 2015)" *) Define f[n_, a_] := (1 + (-1)^n/n^a)^n If a>0 the limit exists and is equal to unity. If a == 0 we have the problem of the OP, where one might say that "two alternative limits exist". This is ...


3

I have found my mistake. It was on the initial condition if we take $$\phi(zi)=0$$ and $$\phi'(zi)=0$$ the both methods will give the exact same solution.


3

For k/z = 1, and integrating by parts: ClearAll["Global`*"] Iv[t_] := Exp[-a*t]*t^2; u[t_] := ArcTanh[Sqrt[(t^2 - 1)/t^2]]; v = Integrate[Iv[t], t]; Du = Simplify@D[u[t], t]; Int == u[t]*v - Integrate[Du*v, t] HoldForm[Integrate[Exp[-a*t]*t^2*ArcTanh[Sqrt[(t^2 - 1)/t^2]], {t, 1, Infinity}] == Limit[-((E^(-a t) (2 + 2 a t + a^2 t^2) ArcTanh[Sqrt[(-1 + ...


3

This is your definition: m = 1; u[x_, t_] = (t^\[Alpha]*x*(2*t^2 + (1 + \[Alpha])*(2 + \[Alpha])))/ Gamma[3 + \[Alpha]]; Your code makes 3.19 seconds on Mma10.4.1 DUt = FullSimplify[(1/Gamma[m - \[Alpha]])*Integrate[(t - \[Tau])^(m - \[Alpha] - 1)*D[u[x, \[Tau]], {\[Tau], m}], {\[Tau], 0, t}], Assumptions -> {m - 1 < \[Alpha] < m, t ...


3

Mathematica can't this integral to solve,but we can convert WhittakerW function to BesselI function.I'm use Maple to convert. $$W_{0,a}(x)=\frac{1}{2} \sqrt{\pi } \sqrt{x} \csc (\pi (a+1)) \left(I_a\left(\frac{x}{2}\right)-I_{-a}\left(\frac{x}{2}\right)\right)$$ $$W_{1,b}(x)=\frac{1}{2} \sqrt{\pi } \sqrt{x} \csc (\pi b) \left(-\frac{1}{2} x ...


3

I suspect that you may have accidental defined some parameters such as Γ and ω0 earlier, because they don't appear in the Out[64] line in your image. To clear all definitions, it is sometimes helpful to simply quit the kernel. You can find this option under the "Evaluation" menu. You also don't need the Evaluate[] line. You can simply call n[ω, ω0, Γ]. The ...


2

If you look at the documentation for Series Then you can see that Series[f,{x,Subscript[x, 0],n}] generates a power series expansion for f about the point x=Subscript[x, 0] to order (x-Subscript[x, 0])^n So if you want more terms, then simply change n to something else. Like 5, for example. In[6]:= Series[(1 - Cos[x])/x, {x, 0, 5}] ...


2

You will probably only be able to do this numerically. The function being integrated is expr = Exp[x]/x*(ExpIntegralE[1, x])^2; LogPlot[expr, {x, 10^-5, 1}, AxesLabel -> {"x", "expr"}] Using numeric integration data = Table[{a, NIntegrate[expr, {x, a, Infinity}]}, {a, 10.^Range[-5, 0, .2]}]; ListLogPlot[data, Joined -> True, PlotRange ...


2

I think what you mean is Assuming[a<0 && b\[Element]Reals && c==3, FullSimplify[Integrate[f[a,b,c,d], {d,e,f}]]] if you have different assumptions for different variables, or with the same assumption for a bunch of variables: Assuming[{a, b, c}>0 && a>b, FullSimplify[Integrate[f[a,b,c,d], {d,e,f}]]] so use the ...


1

THIS IS AN EXTENDED COMMENT RATHER THAN AN ANSWER. $Version (* "10.4.1 for Mac OS X x86 (64-bit) (April 11, 2016)" *) fRe[x_, σ_] = 1/(Sqrt[2 π] σ) Exp[-(x^2/(2 σ^2))]; Integrate[fRe[x, σ]/(x - X), {x, -∞, ∞}, PrincipalValue -> True, Assumptions -> σ > 0] (* ConditionalExpression[ -((Sqrt[2]*DawsonF[X/(Sqrt[2]*σ)])/σ), Re[X] > 0 ...


1

First note that with the way you defined f2, the error generated at the time of definition notwithstanding, f2 still works properly. The scope & context of your problem is not yet clear to me, but if it was me, I would make the code more general by making it more mathematical. Mathematica can usually handle efficiently most problems that can be ...



Only top voted, non community-wiki answers of a minimum length are eligible