Hot answers tagged

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}, region]]...


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] *) ...


9

There is also a newer package, HolonomicFunctions, that has an implementation of Chyzak's generalization of Zeilberger's algorithm. To perform the desired task, use the following commands: smnd = Simplify[ G /. HoldPattern[HypergeometricPFQ[pl_List, ql_List, x_]] :> (Times @@ (Pochhammer[#, k] & /@ pl)) / (Times @@ (Pochhammer[#, k] & /@ ql)...


7

Rule-replacement with x^n_. :> Derivative[n,0][a][y,z] (as done in Kuba's answer) has two drawbacks: if your polynomial has a constant term, then it will not be replaced by the zero-th derivative a[y,z], and if your polynomial is not expanded the result is incorrect. Namely, (1+x)(2+x) becomes (1+a'[y,z])(2+a'[y,z]) rather than 2a[y,z]+3a'[y,z]+a''[y,z] (...


7

First of all you can simplify the integral by the substitution $t\mapsto t/\omega$, which just changes the value by a known factor. After this, the integrand is: (Cos[t]^2 Cos[α + t])/(-1 + A Cos[α + t])^2 Which is integrated to obtain int = Integrate[(Cos[t]^2 Cos[α + t])/(-1 + A Cos[α + t])^2, t]; Plotting the int for some values of A, omega, and ...


6

Everything you want in the question can be done by defining the derivative of the Norm: Derivative[1][Norm][z_] := z/Norm[z] D[Norm[x - y], {x}] (* ==> (x - y)/Norm[x - y] *) Simplify[D[Norm[x - y], {y}]] (* ==> (-x + y)/Norm[x - y] *) Here, the syntax I used for the derivatives is such that it would remain valid if x or y were replaced by vectors ...


6

One problem is that Exp[y] evaluates to Power[E, y], so that the integral does not match the (held) pattern with Exp. Another is that other functions sometimes evaluate to other forms, such as Sin: Sin[Sin[x] + Cos[x] - x] (* -Sin[x - Cos[x] - Sin[x]] *) Here is a fix that works on the example. I added a constant factor c_ to take care of the -1 ...


6

Since Mathematica 10 there's been ImplicitRegion. We define that region this way: IR = ImplicitRegion[-9 <= 6 x + 5 y <= 9 && -7 <= 3 x + 6 y <= 7, {x, y}]; then we can calculate this integral directly: Integrate[(18 x^2 + 51 x*y + 30 y^2)^2, {x, y} ∈ IR] 5292 This integral can be calculated without the newest version of the ...


5

If you provide those important Assumptions to Limit, it will correctly compute that the exponential goes to zero, as you already know: Limit[ -(((-1 + E^((t*α)/(-1 + α)))*x)/α), α -> 1, Direction -> 1, Assumptions -> t > 0 && Element[x, Reals] ] (* x *) This is explained in the documentation for Limit -> Examples -> Options -> ...


5

First we shall define 'the integration on a curve'. Traditionally, this is defined as integration of f.dl where dl is the length of a small part of the curve. So, using t as a medium, we can explicitly write out the curve's function on a complex plane, here let's assume it's z=2 Exp[I t]. Then we can use t, a real number, as the integration variable, which ...


4

This is a corrected version of poor quality post I originally posted. This is to classify the extreme values using Lagrange multiplier method. The bordered Hessian for 2D case with one constraint is calculated. Projections onto x-z and y-z plane are used just to show the minima and maxima (local and global for constraint): f[x_, y_] := x^3 - x*y + y^2 + 3 ...


4

{x, x^2, x^2 + x} /. x^n_. :> Derivative[n, 0][a][y, z]


4

Rather than define a function, you can define a replacement rule using Hold and RuleDelayed rule = Hold[Integrate[ Exp[p_. Cos[x_] + q_. Sin[x_]]* Sin[a_. Cos[x_] + b_. Sin[x_] - m_. x_], {x_, 0, 2 Pi}]] :> I*Pi*((b - p)^2 + (a + q)^2)^(-m/ 2)*(((p^2 - q^2 + a^2 - b^2) + I*(2*(p*q + a*b)))^(m/2)* BesselI[m, Sqrt[(p^2 +...


3

Michael E2 and Bob have solved the integral. Here is an alternative method which might be of interest as well. I have used the similar method already in How to solve this integration?. We solve the integral transforming it into a complex contour integral which, after a simple binomial expansion, can easily be soved by the Cauchy theorem. The remaining ...


3

How about adding some assumptions (I think the following is reasonable): res = Integrate[(x1 + x2 - 1)*(Boole[ x1 + x2 >= s && x1 >= t1 && x2 >= t2]), {x1, 0, 1}, {x2, 0, 1}]; FullSimplify[res, 0 < s < 1 && 0 < t1 <= t2 < 1] $$\begin{cases} \frac{1}{2} (\text{t1}-1) (\text{t2}-1) (\text{t1}+\text{...


3

We can simplify the derivation of coolwater appreciably by getting rid of the mixture of t and alpha. It turns out that in the present aproach the only jumps of the antiderivative occur at t = Pi which can be easily taken into account. Here we go: $Version (* Out[176]= "10.1.0 for Microsoft Windows (64-bit) (March 24, 2015)" *) In the first step we "...


3

Here is a way to do the manipulation. First I define a convenient way to set up vector fields, then I do the dot product and gradient. The main thing is that the application to the vector argument on the right is done element-wise, so that the natural Mathematica operation is Map (/@). To make the order of operations clearer, I also use two different ...


3

Comment Realize that there is a difference between your original nicely printed equations and the code that you have typed. The difference is in the numerator of the function to be integrated. In the nicely typed set of equations you have Δ in the numerator where as in the code you have typed you have Δ0. Original Code Which is correct? Original ...


3

You could try using numerical differentiation from the Numerical Calculus package: Clear[r, fun] Needs["NumericalCalculus`"] r = NDSolve[ {I k'[s] == 20 (s k[s] - (1 - s) (1 - k[s]) (1 + k[s])), k[0] == 1/2}, k, {s, 0, 1} ]; fun[s_] := Abs[(k /. r[[1]])[s]]; Plot[ {10 fun[t], ND[fun[s], s, t, Terms -> 20]}, {t, 0, 1}, PlotLegends -&...


3

This is a bug due to the use of slots (#1, #2, ...) internally in the implementations of Derivative and of Integrate. Focus first on Derivative. Derivative[1,0][Print] prints #1#2. This means that at least one branch of the code for Derivative involves calling Print[#1,#2]. In your case, Derivative[1,0][f] calls f[#1,#2]. Focus next on Integrate The ...


3

This post is cosmetic. It adds nothing to Artes excellent and instructive answer (which I have voted for). I post it to illustrate visualization of the region (a parallelogram in this instance) and use same change of variables as Artes. I think SliceContourPlot3D is also a a nice way to visualize. m = {{6, 5}, {3, 6}}; mi = Inverse[m]; mi3 = ArrayFlatten[{{...


2

For a closed curve you can parameterise it with the angular variable. First use $x=r cos(\theta),y=r sin(\theta)$ and then find $r=r(\theta)$ from the the curve. So you end up with $x=x(\theta),y=y(\theta)$. First you change your coordinates to polar. Make sure to choose the origin inside the region or else you will not get a [0,2Pi] limit for the angle. I ...


2

As requested, comment made into an answer. The problem was with the integration limits in the OP. The points on the circle satisfy (x-x0)^2 + (y-y0)^2 == R^2 so for a point x in the range [x0-R,x0+R] the limits on y are {y0 - Surd[R^2 - (x-x0)^2,2],y0 + Surd[R^2-(x-x0)^2,2]} I use Surd here because MMA may simplify more easily than with Sqrt, since ...


2

Here's a possible approach: Clear[a, b, c, s, int] a = 4 Cos[af/2]^2; b = 1 - 5 Cos[af/2]^2; c = Cos[af/2]^2; s = Sqrt[a*x^4 + b*x^2 + c]; int[par_?NumericQ] := With[{integrand = s /. af -> par}, NIntegrate[integrand, {x, 0, 1}]] Plot[int[af], {af, -2 Pi, 2 Pi}] Finding the maxima and minima using the int expression is also possible. Let's first ...


2

EDIT It can get more complicated. Look at a contour given by r[t_] := 1 + 2 Cos[t]; Original post The result of the integral for a (reasonable) closed contour is just 2 I times the area enclosed by the contour. Proof: the integral is $$\int \left(z^*+z\right) \, dz$$ Letting $$z=x+i y$$, $$dz=dx+i dy$$ the integral becomes $$\int 2 x (dx + i dy)=...


2

Alternatively, you could do a little complex number algebra for the purpose: kf = NDSolveValue[{I k'[s] == 20 (s k[s] - (1 - s) (1 - k[s]) (1 + k[s])), k[0] == 1/2}, k, {s, 0, 1}]; Plot[{10 Abs[kf[t]], Re[kf[t] Conjugate[kf'[t]]]/Abs[kf[t]]}, {t, 0, 1}, PlotLegends -> {"scaled function", "numerical derivative"}]


2

To some extent (and with some care) this can be done with FeynCalc. At least I used it several times when I needed to compute gradients and divergences of Cartesian vectors. The trick is to work with D-dimensional 4-vectors and take the limit $D \to 3$ at the end. Since FeynCalc doesn't distinguish between upper and lower indices, the results are the same as ...


1

Here is how to do the contour integral. Shown for some specific parameters. A = 1; B = -1/2; a = 1; f[z_] := (E^(-a z))/(A + B (Cosh[z])) Integrate[f[rz - I Pi], {rz, Infinity, 0}] + Integrate[f[z], {z, -I Pi, I Pi}] + Integrate[f[rz + I Pi], {rz, 0, Infinity}] // Simplify 4/3 I (-3 + 2 Sqrt[3]) Pi You will need to add appropriate assumptions to ...


1

I. A summary for the failing trial Residue can't calculate the residue of u directly. (It's hard to tell whether it's a bug or not, Residue never promises he will calculate every known residue, anyway.) SeriesCoefficient won't give desired answer in the following case: SeriesCoefficient[u, {s, 0, -1}] If it gave the desired answer, we would be able ...


1

Integrate[Sin[x]^3 (Cos[x])^3, x]; Plot[{-(3/64) Cos[2 x] + 1/192 Cos[6 x], 1/6 (Cos[x])^6 - 1/4 (Cos[x])^4 + 1/24, 1/4 (Sin[x])^4 - 1/6 (Sin[x])^6 - 1/24}, {x, -4 Pi, 4 Pi}, PlotLegends -> "Expressions", PlotRange -> All]



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