# Tag Info

12

You have the vector field $$\vec{v} = (x-y)^2 \hat{\imath} + (x-z)(y-z) \hat{\jmath} + (x + 3y - 2z) \hat{k}.$$ You wish to integrate it over the closed curve $L$ defined by the intersection of $x^2 + y^2 + z^2 = 1$ and $x + y + z = 1$. By Stokes' theorem, this will be equal to the surface integral over $S$ of $\vec{\nabla} \times \vec{v}$, where $S$ is ...

9

The enclosed region is rgn = ImplicitRegion[ -2 Sqrt[x] < y < 2 Sqrt[x] && y > 2 x - 4, {x, y}]; The area is Area[rgn] (* 9 *) or RegionMeasure[rgn] (* 9 *) Which agree with your integral Integrate[y/2 + 2 - y^2/4, {y, -2, 4}] (* 9 *) pts = Solve[{y^2 == 4 x, y == 2 x - 4}, {x, y}] {{x -> 1, y -> -2}, {x -> 4, y -> ...

9

Another approach, taking for granted convergence at infinity, is to find values of c that annihilate all terms of the series expansion of the integrand at r == 0 of the form a*r^-n: Series[(Exp[-r] (1 + f[r, c]))^2*4 π r^2, {r, 0, -1}] SolveAlways[Normal@% == 0, r]

8

You overwrite $Assumptions several times, so it does not contain all the information that you meant to provide. Also Simplify can help where Integrate gave up the simplification. Try this:$Assumptions = m != n && m \[Element] Integers && n \[Element] Integers Simplify@Integrate[Sin[m x]*Sin[n x], {x, 0, \[Pi]}]

7

The integral over the subregion does not converge: Integrate[ (m^2 - 2 x^2 + y^2 + z^2)/(m^2 + x^2 + y^2 + z^2)^(5/2), {y, -Infinity, Infinity}, {z, -Infinity, Infinity}, {x, -Sqrt[1 + y^2 + z^2], Sqrt[1 + y^2 + z^2]}, Assumptions -> m > 0 && {x, y, z} \[Element] Reals] (* Infinity *) The triple integral does not equal the iterated ...

7

Using @Michael's suggestion brings the timing down about an order of magnitude. There are 120 components after using LogicalExpand: components = List @@ LogicalExpand[ Reduce[1 > y > 0 && First @ reg1, {r[1], r[2], r[3], r[4]}] /. _Equal -> False ]; //AbsoluteTiming Length[components] {6.53425, Null} 120 Computing integral over ...

7

A "basic" way to get the numerocal value is to use NDSolve to parametrize the curve. For an arc-length parametrization we first get the total length. reg = ImplicitRegion[{x + y + z == 1, x^2 + y^2 + z^2 == 1}, {x, y, z}]; len = RegionMeasure[reg, 1] (* Out[180]= 2 Sqrt[2/3] \[Pi] *) We also require a point on the curve. Since the "obvious" ones (e.g....

6

As mentioned in referenced help page you need to construct a special grid: Subscript[Der, i_][yyy_] := Module[{xx}, xx = Length[yyy]; NDSolveFiniteDifferenceDerivative[Derivative[i], N[yyy], DifferenceOrder -> "Pseudospectral"]@"DifferentiationMatrix" // Normal // DeveloperToPackedArray // SparseArray]; xi = -1.; xf = 1; xgrid[yy_] := xi + (...

6

Sure! There's a few different ways you could handle it in MMA, but using regions is one way. First we can define a region: r = ImplicitRegion[y^2 - 4 x <= 0 && 2 x - y <= 4, {x, y}]; RegionPlot[r] This looks correct to me. Since we've created a region, we can also do something quite neat: Area[r] outputs 9. This is the exact same value you ...

5

The integral is indeed equal to $$\iiint (f_x+f_y+f_z)=4\pi$$ where $f_i=\partial_i(p_i/(p^2+m^2)^{3/2})$. This is easy to prove using spherical symmetry and e.g. the Gauss theorem (the integral is basically the residue at infinity, and so independent of $m$). The integral is perfectly convergent; indeed, it is easy to see that $(f_x+f_y+f_z)\sim 1/r^5$: ...

5

Several remarks: The timing is correctly calculated. Note that Num and Den are defined using Set (instead of SetDelayed), and so by the time the compiler executes N[Num/Den], these objects have already been calculated. Thus, Timing[N[Num/Den]] only measures the how long it takes to compute an integer division -- essentially zero, as it shows. If you want ...

5

That means you 're looking for Integrate[{P,Q,R}.k'[t],t] along a contour which is defined by the two conditions? reg = ImplicitRegion[x + y + z == 1 && x^2 + y^2 + z^2 == 1, {x, y, z}] Knowing the contour k[t] (circle ) n = #/Sqrt[#.#] &[{1, 1, 1}] \[Rho] = Norm[{1, 0, 0} - 1/3 {1, 1, 1} ] e1 = #/Sqrt[#.#] &[{1, 0, 0} - 1/3 {1, 1, 1} ] e2 ...

4

As I briefly describe here, you can define your own geometry from the metric tensor (expressed as a matrix) and do various computations with it. I'm going to assume the minus sign is an error and you meant to put in a Riemannian metric. Despite the name, this function works with Lorentizan metrics so you could put the minus sign as an overall factor for $dx^... 4 This appears to be a case where you genuinely cannot change the order of integration. I think it's a Mathematics problem not a Mathematica problem. Define relevant assumptions$Assumptions = {px^2 > 0, py^2 > 0, pz^2 > 0}; Evaluate and simplify the integrand expr = D[px (px^2 + py^2 + pz^2 + m^2)^(-3/2), px] /. m -> 1 // FullSimplify (* (1 ...

4

Probably, extended comment. This integral is of the form: Integrate[Exp[-2 r] r^n,{n, 0, Infinity}] = ConditionalExpression[2^(-1 - n) Gamma[1 + n], Re[n] > -1]. Now let's look at our integral: Collect[ExpandAll[(Exp[-r] (1 + f[r, c]))^2*4 π r^2], r] Cases[%, num_ r^n_/;n<0 :> num] We can solve this for c: Solve[# == 0, c] & /@ % // ...

4

I use the code from my answer on Solving partial differential equation involving Hilbert transform We put $\mu =0,\sigma^2 =1/2$,L=Infinity,n[0,x]==Cos[x] n = Sum[f[m][t] Exp[I m x], {m, -Infinity, Infinity}] Then the integral is calculated as Integrate[ Exp[-s^2] Exp[I m s]/Sqrt[Pi], {s, -Infinity, Infinity}] (*Out[]= E^(-(m^2/4))*) Now we can make ...

4

If all you want to do is integrate the function, one piece at a time, you can try: n = 25; (* number of chunks *) pBF = FunctionInterpolation[ Piecewise[{{9890/3, 500 <= z <= 800}}], {z, 0, 1300}, InterpolationOrder -> 1 ]; data = Table[Integrate[pBF[z], {z, (i - 1) 1300/n, i 1300/n}], {i, n}]; Total[data] ListPlot[ Accumulate[data] ] (* ...

3

If the number of points and the number of grid points are not too large, then the brute force method works fine. (* Generate a unique set of points on an m x m grid *) m = 10; n = 10; SeedRandom[12345]; x = RandomInteger[{1, m}, {10 n, 2}]; x = DeleteDuplicates[x][[1 ;; n]]; (* Look for 3 points along non-vertical lines *) points = ConstantArray[0, n]; si ...

3

This is not a full answer; you don't provide a full enough description of your code for any deep analysis. Because you instructed Mathematica to evaluate the 1st argument you passed to Integrate before it was given to that function, that evaluation was done and you see it in your output. Next, I presume, Integrate ran for some time, finally deciding it ...

3

As long as this system is the Lorenz attractor, you have a changed sign in the first equation, so it blows up. Now it is fixed. s = Quiet @ NDSolve[{X'[t] == -10 (X[t] - Y[t]), Y'[t] == X[t] (28 - Z[t]) - Y[t], Z'[t] == X[t] Y[t] - (8/3) Z[t], X[0] == Y[0] == Z[0] == 1/100}, {X[t], Y[t], Z[t]}, {t, 0, 10}] ParametricPlot3D[Evaluate[{X[t], Y[t], Z[t]} /. s],...

3

Once we have the equilibrium points as equs = {sigma (X - Y), X (rho - Z) - Y, X Y - beta Z} sols = Solve[equs == 0, {X, Y, Z}] you can calculate the associated jacobian to each equilibrium point as Js = Grad[equs, {X, Y, Z}] /. sols and the corresponding characteristic polynomials as Table[CharacteristicPolynomial[Js[[k]], lambda], {k, 1, Length[Js]}] ...

3

An alternative to @Jens' solution is to add the phase to the argument of the Log instead, and then remove the associated rotation in the output of the Log: logbranch[σ_] := With[{phase = I (σ + Pi)}, Function[Log[# Exp[-phase]] + phase] ] I used a slightly different definition so that you just replace Log with logbranch[ϕ] instead of replacing Log[z] ...

3

This is an elaboration of Bob Hanlon's comment. The average value of a function of two variables over a given domain is the integral of the function divided by the area of the domain. The calculation goes like so: Given f[x_, y_] := Sqrt[1 + .25 y^2 ((2.5 + 1.5 Cos[Pi/3 x] - 2.75)^2 + y^2 (2.4 + 1.1 Sin[Pi/3 x] - 3.75)^2)] domain = Rectangle[...

3

The Limit depends on how you approach {0, 0} so it is Indeterminate. However, you can imply (or specify) a direction of approach which gives 0 as the limit. \$Version (* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *) Looking at the real part of the function Plot3D[Re[Cosh[1/Sqrt[y]] Sinh[x/Sqrt[y]] - y Cosh[x/Sqrt[y]]], {x, -1, 1}, {y, -1, 1}, ...

3

The integral doesn't seem to have any closed form solution. You can get an approximation to it by building an interpolating function and integrating it. Like so: Clear[f, pts, ff, int] f[τ_][u_] := Exp[Csch[(u - τ)]^2]; ff[τ_, x_, dx_] := Interpolation[Table[{u, f[τ][u]}, {u, 0, x, dx}]]; int[x_, dx_][τ_] := Function[u, Integrate[ff[τ, x, dx][uu], {uu, 0, ...

2

Clear["Global*"] f[x_, y_] := Sqrt[1 + .25 y^2 ((2.5 + 1.5 Cos[Pi/3 t] - 2.75)^2 + (2.4 + 1.1 Sin[Pi/3 t] - 3.75)^2)] /. z_Real :> Rationalize[z] // Simplify; The average of f[x, y] is dependent on t avg[t_] = Integrate[f[x, y], {x, 0, 5}, {y, 0, 5}]/25 (* (32 ArcSinh[ 1/4 Sqrt[723/2 - 75 Cos[(π t)/3] + 52 Cos[(2 π t)/3] - ...

2

In under 5 seconds on my old laptop; you are using numerics in FindRoot, so use numerics everywhere: f[a_, yc_, sc_?NumericQ] := { (NIntegrate[ y Boole[y Cos[a] > x Sin[a]], {y, -200 + yc, yc}, {x, 3/4 (100 + y - yc), 3/4 (100 - y + yc)}] + 1920 π (3 yc - 395)) sc + 20 10^3 yc, (NIntegrate[x y Boole[y Cos[a] > x Sin[a]], {y, -200 + yc, yc}, {x, ...

2

HoldForm[PolyGamma[1, 1 + x] == Sum[1/(1 + k + x)^2, {k, 0, Infinity}]] // TeXForm $$\psi ^{(1)}(1+x)=\sum _{k=0}^{\infty } \frac{1}{(1+k+x)^2}$$ Then: INT = Integrate[1/(1 + k + x)^2, {x, 0, Infinity}] (* ConditionalExpression[1/(1 + k), Im[k] != 0 || Re[k] >= -1] *) INT[[1]] (* 1/(1 + k) *) Sum[INT[[1]], {k, 0, Infinity}, Regularization -> "...

2

GeneralUtilitiesBenchmarkPlot will fit data (by design, timings) to a number of models. Here's a hack to show that 1/error ~ yy^2 is the best model of the ones it tests. der[i_][yyy_] := Module[{xx}, xx = Length[yyy]; NDSolveFiniteDifferenceDerivative[Derivative[i], N[yyy], DifferenceOrder -> 2]@"DifferentiationMatrix" // Normal // ...

2

xi = -1.; xf = 1; xgrid[yy_] := Range[xi, xf, (xf - xi)/yy] Subscript[Der, i_][yyy_] := Module[{xx}, xx = Length[yyy]; NDSolveFiniteDifferenceDerivative[Derivative[i], N[yyy], DifferenceOrder -> 2]@"DifferentiationMatrix" // Normal // Developer`ToPackedArray // SparseArray]; Der1[yy_] := Subscript[Der, 1][xgrid[yy]] numerical[yy_] := Der1[yy]....

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