# Tag Info

22

Taking a limit depends on the path used to approach that limit. Consider the function in the question: f[x_, y_] := Piecewise[{{x y / (x^2 + y^2), x != 0 && y != 0}}, 0]; base = Plot3D[f[x, y], {x, -1, 1}, {y, -1, 1}, MeshStyle->Opacity[0.2], PlotStyle->Opacity[0.5]] (A plot of its graph, saved here as base, appears in subsequent figures.) ...

19

We define the function f and multiple constraint functions g1, g2: f[x_, y_, z_] := x y + y z g1[x_, y_] := x^2 + y^2 - 2 g2[x_, z_] := x^2 + z^2 - 2 then, in order to find necessary conditions for constrained extrema we introduce the Lagrange function h with Lagrange multipliers λ1 and λ2: h[x_, y_, z_, λ1_, λ2_] := f[x, y, z] - λ1 g1[x, y] - λ2 g2[x, ...

17

The integrand has two singular points: Solve[ 4z^2 + 4z + 3 == 0, z] {{z -> 1/2 (-1 - I Sqrt[2])}, {z -> 1/2 (-1 + I Sqrt[2])}} At infinity it becomes zero: Limit[ 1/Sqrt[ 4 z^2 + 4 z + 2], z -> ComplexInfinity] 0 All these points are the branch points, thus we should define appropriately integration contours in order to avoid possible ...

16

It is Kampé de Fériet function, introduced in Joseph Kampé de Fériet, "La fonction hypergéométrique.", Mémorial des sciences mathématiques, Paris, Gauthier-Villars. Its definition is given on Notations page: and, in an alternative form, in Wikipedia: $${}^{p+q}f_{r+s}\left( \begin{matrix} a_1,\cdots,a_p\colon b_1,b_1{}';\cdots;b_q,b_q{}'; \\ ... 14 In general Mathematica cannot compute symbolically infinite sums over primes because of the lack of appropriate mathematical tools. However there are infinite products over primes which are basically well understood on the mathematical level. One famous example is the Euler formula for the Riemann zeta function, one of the most beautiful (and mysterious ... 14 For this function: f[z_] := (1 - E^z + z)/(z^3 (z - 1)^2) there are no branch cuts in the complex plane therefore we simply use Cauchy integral theorem and the related formula of the complex residue, i.e. we sum up residues of the function f in the circle \mid z \mid =2. Let's denote$$int = \oint_{\mid z \mid =2}\frac{1-e^z+z}{z^3 (z-1)^2}dz$$Now ... 13 You can get a parametric representation for your curve : eqn = 1/x + 3/4 (((y - 1/Sqrt[3])/x)^2 + 1) Exp[ArcTan[(y - 1/Sqrt[3])/x] - Pi/6] ; aux = First@Solve[(eqn /. {y -> 1/Sqrt[3] + t x}) == 0, x] (* {x -> -((4 E^(\[Pi]/6 - ArcTan[t]))/(3 (1 + t^2)))} *) solx = aux[[1, 2]] (* -((4 E^(\[Pi]/6 - ArcTan[t]))/(3 (1 + t^2))) *) soly = 1/Sqrt[3] + t ... 13 This is standard cancellation error (please Google for it). See below for more details. Take a look at the exact result first: result = Integrate[x^50*Sin[x], {x, 0, 1}] (* ==> 16432804687774250383441481995831940788236063969597816674967907249 Cos[1] + 50 (-608281864034267560872252163321295376887552831379210240000000000 + ... 12 I know two approaches to this: In[1]:= FullSimplify[SeriesCoefficient[ArcTan[y], {y, x, n}] n!, Element[n, Integers] && n > 0] Out[1]= 1/2 I ((-I - x)^n - (I - x)^n) (1 + x^2)^-n Gamma[n] and In[2]:= FullSimplify[InverseFourierTransform[(-I k)^n FourierTransform[ ArcTan[x], x, k] , k, x], Element[n, Integers] && n > 0] ... 12 If you want to calculate this integral with Mathematica use beautiful (and very powerful!)\; Cauchy Integral Formula implying an adequate theorem of Complex Residue. Thus we have$$\int_{\left | z \right |=1}\frac{dz}{z}= 2\pi i\; Res_{z_{0}=0} f$$where f(z)=\frac{1}{z}. We can find the residue at z_0=0 of f(z) in Mathematica with Residue: ... 12 It's not a bug, it's a feature Exact integration returns 1/Sqrt[2 Pi] Integrate[(1 + Sqrt[x])^2 Exp[I k x], {x, -Infinity, Infinity}, Assumptions -> {k \[Element] Reals}] Integrate::idiv: "Integral of E^(I\k\x)\ (1+[Sqrt]x)^2 does not converge on {-Infinity,Infinity}." However we can multiply by Exp[-b Abs[x]] and then put b -> 0 ... 12 Artes' guess seems basically right. Here is a way to reach the correct result. First, the antiderivative returned by Mathematica: i0 = FullSimplify[ Integrate[Sqrt[(2 t)^2 + (4 - 3 t^2)^2], t], t > 0] (* (2 (Sqrt[16 - 2 I (-5 I + Sqrt[11]) t^2] Sqrt[8 + I (5 I + Sqrt[11]) t^2] ( 5 (-5 I + Sqrt[11]) EllipticE[ArcSin[1/2 t Root[9 - 5 ... 12 Here's the exact answer: i1 = Integrate[x^n Exp[-(x - a)^2], {x, 0, Infinity}, Assumptions -> n > 0] /. n -> 1/2 (* 1/2 E^-a^2 (Gamma[3/4] Hypergeometric1F1[3/4, 1/2, a^2] + 1/2 a Gamma[1/4] Hypergeometric1F1[5/4, 3/2, a^2]) *) i1 /. a -> 0.3 (* 0.907605 *) 11 You are using the same dummy variable for all integrals. Extended answer Modify your code slightly and note that all integrals use the same dummy: BallVolume[dimension_, radius_] := If[dimension == 0, 2*radius, Assuming[radius > 0, testIntegrate[ BallVolume[dimension - 1, Sqrt[radius^2 - x^2]], {x, -radius, radius}]]]; ... 11 If X = (X_1, ..., X_n) denotes a n-variate multivariate Normal random variable N(\mu, \Sigma), then the moment generating function is given by:$$ M(t)=E\left[e^{t'X}\right] = exp\left({t'\mu + \frac12 t' \Sigma t}\right)$$The mgf can then be used to derive the raw moments you seek. For instance, in say a bivariate setting, the product raw moment ... 11 Plot3D[{5 (x^2 + y^2), 6 - 7 x^2 - y^2}, {x, -1, 1}, {y, -1, 1}, RegionFunction -> Function[{x, y}, 5 (x^2 + y^2) < 6 - 7 x^2 - y^2]] Integrate[(6 - 7 x^2 - y^2 - 5 (x^2 + y^2)) UnitStep[(6 - 7 x^2 - y^2 - 5 (x^2 + y^2))], {x, -10, 10}, {y, -10, 10}] (3 π)/Sqrt[2] Edit Since working with the UnitStep function (rather ... 10 First, you can try to apply the FunctionExpand command to the DifferenceRoot object. If it is able to find a closed form of the sequence, then the Limit might be able to find an exact symbolic limit. To find a numerical approximation, you can use the SequenceLimit command. In general, it does not guarantee to give the correct result, but if your sequence ... 10 Shooting method with Manipulate One pragmatic approach of getting a solution for your boundary value problem is just guessing efficiently (which is what most numerical BVP codes do anyway...). A nice way of doing this in Mathematica after setting up our ordinary differential equation ode=1/\[Eta] D[\[Eta] ... 10 Borwein integrals As Eckhard wrote in comments B[n] is the n-th Borwein integral. (The letter B was not accidental :) ) This funny properties of Borwein integrals is related to the Fourier transform of Sinc function FourierTransform[Sinc[x], x, k] 1/2 Sqrt[Pi/2] (Sign[1 - k] + Sign[1 + k]) Plot[%, {k, -2, 2}, Filling -> 0] which is the box ... 10 If we define f[x] e.g. like this: f[x_] := Abs[x] the following returns interesting points: Reduce[ Limit[(f[x + h] - f[x])/h, h -> 0, Assumptions -> x ∈ Reals, Direction -> -1] != Limit[(f[x + h] - f[x])/h, h -> 0, Assumptions -> x ∈ Reals, Direction -> 1], x] x == 0 Let's try another function defined with Piecewise, ... 10 In this particular case Mathematica for some reason considers b[i] as a constant. Compare: Integrate[Exp[Sum[-((cw λ - b)^2/(2 σ^2)), {i, 1, n}]], {cw, 0, 1}] (Sqrt[π/2] σ (Erf[(b Sqrt[n])/(Sqrt[2] σ)]-Erf[(Sqrt[n] (b-λ))/(Sqrt[2] σ)]))/(Sqrt[n] λ) A possible workaround consists in the manually expanding the sum Integrate[Exp[(-n cw^2 λ^2 + 2 cw λ ... 10 Short story$$ \vartheta(x) = \arg \left[(\operatorname{Bi}x+i \operatorname{Ai}x)e^{-\frac{2}{3} i (-x)^{3/2}}\right]+\frac{2}{3} \operatorname{Re}\left[(-x)^{3/2}\right] $$Update: I see that you want use only real functions, so you can expand this as$$ \vartheta(x) = \begin{cases} \arctan\frac{\cos \left(\frac{2}{3} (-x)^{3/2}\right) ...

10

Pairs is unordered and index in each pair is also unordered. Let us choose the order: In each pair the first index is less then the second. Pairs is sorted in ascending order by the first index. If the first indexes is equal then sort by the second. Examples in the question have the right order. Let we have powers $(0,\ldots,0,r_i,r_{i+1},\ldots,r_n)$. ...

10

From NSum: You should realize that with sufficiently pathological summands, the algorithms used by NSum can give wrong answers. In most cases, you can test the answer by looking at its sensitivity to changes in the setting of options for NSum. For instance: NSum[((-1)^n)/(n - (-1)^n), {n, 1, Infinity}, NSumTerms -> 100000] (* 0.693149 - ...

10

The answer is no because of fundamental mathematical limitations which origin in the set theory regarding countability (see e.g. Cantor's theorem) - functions over a given set are more numerous than its (power) cardinality. Neither Mathematica nor any other system can integrate every function in even much more restricted class, namely Riemann integrable ...

9

Edit: Updated to handle an arbitrary number of variables. Here's a fairly naive way, trusting in Mathematica's power. Find the maximum and minimum of f in a square of "radius" d about the point being approached. If the maximum and minimum approach the same value as d tends to 0, then by the "squeeze" theorem, the value is the limit. One caveat: Maximize ...

9

It appears that you can work around this problem by using ExpToTrig to rewrite your expression. That is, this produces a result that seems to check out: f[a_, b_] := Exp[I*(a*x^3 + b*x^2)]; result = Integrate[ExpToTrig[f[a, b]], {x, -Infinity, Infinity}, Assumptions -> {a > 0, b \[Element] Reals}] Evaluating this returns: (2 E^((2 I b^3)/(27 ...

9

Your definition of entropy is incorrect. It's $E(-\ln(P(x)))$, with $E$ the expectation operator and $P$ the probability mass function of the random variable $x$. I believe you may have been mixing up a few things. The formal definition of the expectation is $E(x)=\int{x P(x)dx}$. I assume that you had this in mind and you further confused your random ...

9

Try not to supply machine numbers to integrals over infinite domains. They can cause errors that build up to the extent you have seen. Either compute the symbolic integral with exact numbers (and then convert it to a numeric value) L = 2; sn = 1; a = 10^(sn/10); b = 10^(sn/10); c = a/100; result = 2*Sqrt[1/Pi]*Integrate[(1/(E^z*Sqrt[z]))*(1 - (a/(a + ...

9

Just to contribute to the debate, here is some more evidence that supports the proposition that numerical error is the issue. If we run the integral through various permutations of the ways of making exact and approximate calculations, the pattern I think suggests that numerical error is the reason the OP's integral is so far off. (* the integrand and ...

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