Tag Info

New answers tagged

1

You could use a definite integral: Integrate[1/beta/(2*z0)/(1 - beta), {z0, 1, z}, Assumptions -> {z > 1, 0 < beta < 1}] (* Log[z]/(2 beta - 2 beta^2) *) Of course, this requires by-hand tuning of the lower limit, but if you want a certain form (i.e. a certain choice of offset), then that's required anyway.


4

The brute force method to arrive at your second solution f[z_] = 1/beta/(2*z)/(1 - beta); cl = CoefficientList[f[z], 1/z]; cl.Integrate[(1/z)^Range[0, Length[cl] - 1], z] Log[z]/(2*(1 - beta)*beta)


3

Perhaps what you are looking for is: A = {{2, -1, 0}, {-1, 2, -1}, {0, -1, 1}}; Integrate[Exp[(-x . A . x)/2], x ∈ FullRegion[3]] 2 Sqrt[2] π^(3/2)


5

Since your integrand does not approach zero but a finite positive number, Limit[Exp[-16.136 (1 - Exp[-0.012*t])], t -> Infinity] (* 9.82255*10^-8 *) the integral over {t, 0, Infinity} does not converge. By the way, the error in the NIntegrate[integrand, {t, 0, 1000}] should be about 10^-7, which seems better than R. In fact, the precision seems ...


4

When you try to NIntegrate your expression, the error messages include: "suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small". Your expression does not have a singularity, its integral is manifestly not zero, it is not oscillatory, so it must be a numerical precision problem. ...


1

This is taking your first modification of the original code and just changing the way f is defined, then using that function inside the module. It seems to work fine for me. Clear[x, y, f]; x = 10;(*Global values have no effect on Module...*) y = 12;(*Global values have no effect on Module...*) f[x_, y_] := E^(-x^2 - y^2) + x y; Manipulate[ Module[ {x, ...


4

Both Module and DynamicModule are shadowing the global variables x and y in the example in which you use them. The demonstration is best written without using either Module or DynamicModule. Manipulate[ ContourPlot[f, {x, -1, 1}, {y, -1, 1}, Contours -> 20, Epilog -> Dynamic[Arrow[{pt, pt + grad /. {x -> pt[[1]], y -> pt[[2]]}}]]], {f, ...


1

It is not exactly what you asked about, but did you try this: list = {Cos[x], Sin[x], -(Cos[t3 (d1 - d2)]/(1728 tg^3 (d1 - d2)^2)) + Cos[t3 (d1 - d2)]/(864 tg^3 (d1 - d2) (-d1 + d2)) + Cos[t3 (d1 - d2)]/(864 tg^3 (d1 - d2) (2 (d1 - d2) - 2 (-d1 + d2))) - Cos[t3 (d1 - d2)]/(864 tg^3 (d1 - d2) (2 (d1 - d2) + 2 (-d1 + ...


7

Mathematica seems to split the integrand component, E^(-((-m + Log[x])^2/(2 s^2))) into E^(-((m^2 + Log[x]^2)/(2 s^2))) times the sort-of "coefficient" E^((m Log[x])/s^2) (* == x^(m/s^2) *) in order to calculate the integral in terms of Meijer $G$. For reasons that are obscure to me, it seems to want the coefficient of m in the exponent to be ...


1

I suspect that you want to evaluate the derivatives at $(0,0)$ after performing the derivative. Otherwise the whole expression would vanish anyways. In the documnetnation for D you will find that there is indeed a way to achieve what you want: D[f[x1,...,xn],{x1,a1},...,{xn,an}] successively computed the $a_i$th derivative of f with respect to its ...


6

The problem here is the Sin[n] which has no limit since it is an oscillating function, but it is always bounded by $\pm 1$: if you change you code with the following: Limit[(n - Sqrt[1 + 10 n + n^2])^2, n -> Infinity] with 1 in place of Sin (or -1 if you want), you get the result: (*25*)


1

Summarizing the comments, this bug has been fixed as of version 10.0.1. Limit[(Log[(3+Sqrt[5])/2]/(2*Log[(1+Sqrt[5])/2]))^(-1-2*n), n -> Infinity] (* 1 *)


2

Update. The argument about not getting a nice closed form is of course wrong. (The $W$ Lambert function is nicer than I expected and is implemented in Mathematica as ProductLog.) Nonetheless, I think that the numerical solution below is useful, so I will leave this solution up. Original post As stated by Guess who it is in a comment and shown by ...


2

Not exactly a parametrization, but I wonder if this might help: Clear[contourplot] contourplot[level_] := Module[ {}, solns = Reduce[(x^2 + 3 y^2) Exp[-x^2 - y^2] == level, {x, y}, Reals]; Show[ Plot3D[(x^2 + 3 y^2) Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, Mesh -> None], ParametricPlot3D[ Tooltip[Evaluate[{x, #, level} & /@ (y /. ...


2

This isn't very different from MarcoB's solution, but I did implement the tangent vector, :-) Clear[k]; With[{kk = Sqrt[Log[3/k]]}, Manipulate[ Show[ Plot3D[3 Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, Mesh -> None, BoxRatios -> Automatic], ParametricPlot3D[r[s, k], {s, 0, 2 π kk}, PlotStyle -> {Blue, Thick}], ...


4

Although Belisarius' creative solution is entirely satisfactory, a solution symbolic at every step may be useful. To begin, define x[t_] := -9 Sin[2 t] - 5 Sin[3 t] y[t_] := 9 Cos[2 t] - 5 Cos[3 t] and note that t = π corresponds to the uppermost point in the star in the question, {0, 14}}. From there, the point {0, -5} can be reached by increasing or ...


2

How about something like this? Clear[f, plt, kk, curve] f[x_, y_] = 3 Exp[-x^2 - y^2]; plt = Plot3D[3 Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, Mesh -> None, BoxRatios -> Automatic]; Manipulate[ kk = Sqrt[Log[3/k]]; curve = ParametricPlot3D[{kk Cos[s/kk], kk Sin[s/kk], k}, {s, 0, 2 Pi kk}, PlotStyle -> {Blue, Thick}]; Show[ plt, curve, ...


3

From Trace[ Limit[(1 - z)/(1 - Conjugate[z]), z -> 1], TraceInternal -> True] one may observe a couple of things: First, Mathematica substitutes z -> z + 1, essentially transforming the limit to Limit[z/Conjugate[z], z -> 0] Second, it is using the default direction Direction -> -1, which may be observed in the assumption found in the ...


1

This bug has been fixed as of version 10.2.0. The example now returns unevaluated without any messages. Integrate[Cos[Sin[x]]^n, {x, 0, Pi}] // InputForm (* Integrate[Cos[Sin[x]]^n, {x, 0, Pi}] *)


6

The problem is that you're mixing exact and machine numbers in the definition of the function f. The machine numbers create a small nonzero constant term in the numerator of the Limit, which is the cause of the infinite result as you divide by h and take h -> 0. The fix is to use {x0,y0}= u/5 instead of 0.2. However, if you do need to work with machine ...


5

If what you want is a nice smooth surface of the outer boundary, then in Mathematica 10.2 you can do the following: data3D = RandomReal[{0, 1}, {100, 3}]; (* generate some random point *) cvx = ConvexHullMesh[data3D] (* get the outer boundary *) Now we can Discretize the surface and smooth it in one go: smooth = DiscretizeRegion[cvx, ...


3

The nub of the problem is that we all get a little sloppy in writing down this kind of equation. Fortunately, it's possible to convey what we mean to Mathematica in our sloppy notation. Here's what's sloppy: $z(x,y)$ involves $x$ and $y$ as dummy variables and is no different from $z(r,\theta)$. You can't tell me the value of $z(0, 1)$ unless I tell you the ...


6

They should not be equal. Note that $$ \lim_{x\to0}\frac{d^n}{dx^n} e^{-\sqrt{x}}=\infty $$ for every integer $n$. What Series does is computing the fractional power series, a.k.a Puiseux Series, which cannot be obtained by evaluating the derivative. You can see this problem with a simpler example: try expanding the function $f=\frac{1}{x}$ or $g=\sqrt{x}$ ...


7

Here is a way to do this using the new commands FromPolarCoordinates and ToPolarCoordinates in version 10.1. I'll use ψ for the function name, instead of f or z. Also, I like to use ϕ for the polar angle: Clear[x, y, r, ϕ, ψ]; polarCoords = Thread[{x, y} -> FromPolarCoordinates[{r, ϕ}]] {x -> r Cos[ϕ], y -> r Sin[ϕ]} ψChain[x_, y_] = ...


23

The plan is first get the "external" contour and then use Green's theorem to find its area. r[t_] := {-9 Sin[2 t] - 5 Sin[3 t], 9 Cos[2 t] - 5 Cos[3 t], 0} (*find the intersections*) tr = Quiet@ToRules@Reduce[{r@t1 == r@t2, 0 < t1 < t2 < 2 Pi}, {t1, t2}]; pt = {t1, t2} /. {tr} // Flatten; pts = SortBy[pt, N@# &]; pps = Partition[pts, 2]; Now ...


5

Summarizing the comments, this was a bug in version 10.0.0. It has been fixed as of version 10.0.1. In[1]:= Integrate[ DiracDelta[x]*DiracDelta[y], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}] Out[1]= 1


2

This appears to be fixed in 10.1.0: Integrate[1/(a^2 + b^2 - 2 a b Cos[t]), {t, 0, 2 Pi}, Assumptions -> {a > b > 0}] (* (2 π)/(a^2 - b^2) *) Integrate[1/(a^2 + b^2 - 2 a b Cos[t + t0]), {t, 0, 2 Pi}, Assumptions -> {a > b > 0}] (* ConditionalExpression[(2 π)/(a^2 - b^2), -3 π <= Re[t0] <= -π && Im[t0] == 0] *)


3

That would be because it's false. Integrate[Cos[2 t]/(a^2 Sin[t]^2 + b^2 Cos[t]^2), {t, 0, \[Pi]}] FullSimplify it under the assumption that 0 < b <= a, and you get ((a - b) \[Pi])/(a b (a + b)).


1

I am not really sure that I understand your aim, but as to the simple example in the end of your question, this seems to do the job: Clear[x, y, u, v, f]; x = u^2 - u*v + v^2; y = u^2 + 2 u*v - 3 v^2; f = x^2 + y^2; D[f, u] /. {x -> X, y -> Y} (* 2 (2 u - v) X + 2 (2 u + 2 v) Y *) Have fun!


3

I have found a simple method to mitigate the limit bug: using an intermediate Series[], the Dirichlet coefficients of a function f[x] can be calculated correctly as a Limit[]. The formulas for the coefficients are cD := Module[{}, a[1] = Limit[f[x], x -> ∞]; a[n_] := a[n] = Limit[ Series[n^x (f[x] - Sum[a[k] k^-x, {k, 1, n - 1}]), {x, ∞, ...


2

Why not TrigExpand[1/2*\[Eta][x, t]^2] /. Exp[_]->0 which gives -((A^2 Ap^2 k^6)/(16 ω^4)) + (A Ap k^2)/(4 ω^2)


0

I frequently do what march advises in a comment, especially when I do not want to Simplify but I do want a differentiable norm: norm = Sqrt[#.#] &; If you were going to put this in a package for students to use, then you might prefer norm[v_?VectorQ] := Sqrt[v.v]; Of course, it's only good for real-component vectors.


2

In the current version of the question, the second parameter $\epsilon$ isn't needed. If you can do without it, I would suggest pre-computing the list of relevant $\delta$ values and making a ListAnimate to speed up the rendering. But I will assume that you can't go that route, maybe because you'll add some dependence on $\epsilon$ later. Then the numerical ...


5

Reduce (on exact input) returns quickly and series of conditions joined by Or. The first one implies any disk of radius less than 1/10, d being the radius squared, is sufficient. res = Reduce[-1/10 < (y (x^4 + 4 x^2 y^2 - y^4))/(x^2 + y^2)^2 < 1/10 && x^2 + y^2 < d, {d, x, y}]; dom = If[Head[res] == Or, First[res]] (* 0 < d <= ...


4

Now fixed in version 10.2. In[1]:= Residue[LogisticSigmoid[z], {z, I Pi}] Out[1]= 1 In[2]:= Residue[1/(1 + Exp[-z]), {z, I Pi}] Out[2]= 1 In[3]:= Coefficient[Series[1/(1 + Exp[-z]), {z, I Pi, 0}], 1/(z - I Pi)] Out[3]= 1


3

Solution with NIntegrate NIntegrate[f[X[u, v]] Norm[Cross[D[X[u, v], u], D[X[u, v], v]]], {u, -π/2, π/2}, {v, 0, π}] (* 19.8097 *) An alternative approach to the problem is s = ImplicitRegion[{x^2/2 + y^2/3 + z^2/2 == 1 && y > 0}, {x, y, z}]; Chop[NIntegrate[x^2 + z^2, {x, y, z} ∈ s], 10^-7] which, of course, yields the same answer. Added: ...


3

Fractional Iterates A way to obtain an approximate fractional iterate of a function is to use its Carleman matrix, which is formed from its Taylor coefficients, and then taking the appropriate $p$-th power of the matrix to obtain the series coefficients. Note that I never said that $p$ had to be an integer; in the example given in the OP, then, we can take ...


5

I speculate about the reason for this behavior in the comment, but no matter whether that's the correct explanation, I would say that the documentation isn't wrong because I can verify the removal of the UpValues using Definition. However, this doesn't solve the problem. As a workaround that requires less typing than the UnSet approach in the question, I ...


5

Application of the implicit function theorem in this case shows that $\frac{\partial z}{\partial x}=-\frac{\partial f}{\partial x}/\frac{\partial f}{\partial z} $ and $\frac{\partial z}{\partial y}=-\frac{\partial f}{\partial y}/\frac{\partial f}{\partial z} $, where $f(x,y,z)=0$ is the implicit function. f = x^3 + y^3 + z^3 + 6 x y z - 1; -D[f, {{x, ...


0

eqn = x^3 + y^3 + z^3 + 6 x y z - 1 == 0 Solve[Dt[eqn, x], Dt[z, x]] /. Dt[y, x] -> 0 Solve[Dt[eqn, y], Dt[z, y]] /. Dt[x, y] -> 0 If y is function of x, just do: Solve[Dt[eqn, x], Dt[z, x]] Solve[Dt[eqn, y], Dt[z, y]] $$\frac{\partial z}{\partial x} = \frac{-x^2-y^2 \frac{\partial y}{\partial x}-2 x z \frac{\partial y}{\partial x}-2 y z}{2 x ...


5

Try this: Solve[0 == Dt[x^3 + y^3 + z^3 + 6 x y z - 1, x] /. Dt[y, x] -> 0, Dt[z, x]][[1, 1]] Dt[z, x] -> (-x^2 - 2 y z)/(2 x y + z^2) The procedure is similar for the other independent variable.


2

Your code Solve[Int[e^{x/2} x^{g/2 - 1} dx, x]] is completely invalid for finding the indefinite integral of E^(x/2) x^(g/2 - 1) with respect to x. The correct formulation is Integrate[E^(x/2) x^(g/2 - 1), x] which produces ((-2^(g/2))*x^(g/2)*Gamma[g/2, -(x/2)])/(-x)^(g/2) That this is a correct result is confirmed by taking the derivative of ...


0

Integrate[ y^2 Exp[-y], {y, (a Cos[θ])/x, Sqrt[1 + (a Cos[θ])^2]/x}, Assumptions -> {θ > 0, x > 0}] $\frac{e^{-\frac{\sqrt{a^2 \cos ^2(\theta )+1}}{x}} \left(-\frac{2 x}{\sqrt{a^2 \cos ^2(\theta )+1}}-2 x^2-1\right)+a^2 \cos ^2(\theta ) \left(e^{-\frac{\sqrt{a^2 \cos ^2(\theta )+1}}{x}} \left(-\frac{2 x}{\sqrt{a^2 \cos ^2(\theta ...


0

When evaluating an integral, Mathematica applies a series of change-of-variables substitutions in attempt to put this integral in a standard from. Likely ehat has happened here is that Mathematica has performed a substitution like $t\to -t$ which has the effect of changing the bounds of integration. The resulting integral does not converge which almost ...


8

RegionMeasure chooses a method which is slow when exact non-rational coefficients are present. I will correct this for a future version. Thanks for pointing it out. In Mathematica 10 the example works fast with approximate coefficients. In[1]:= Timing@RegionMeasure@N@ RegionIntersection[ Tetrahedron[{{0, 0, Sqrt[3/2]}, {2/Sqrt[3], 0, ...


1

Is this what you want to plot? ParametricPlot[Chop @ {z[l], r[l]}, {l, 0, 2}, PlotStyle -> {Red, Thick}, AspectRatio -> Automatic, GridLines -> Automatic] ParametricPlot[Chop @ {r[l], r'[l]}, {l, 0, 2}, PlotStyle -> {Red, Thick}, AspectRatio -> Automatic, GridLines -> Automatic]


4

My experiments with this question indicate that something more than simple composition of Arrow and Tube is needed. What I came up with is ParametricPlot3D[{Cos[t], Sin[t], t/4}, {t, 0, 2 π}, PlotRange -> All, PlotStyle -> Directive[{Red, Arrowheads[.08]}]] /. Line[pts_] :> Arrow[Tube[pts, .04], {0, -.1}] which produces Of course, this ...


3

The expressions inset by Text are not considered in the PlotRange used by ContourPlot. We can make the problem more severe and apparent by using wider FrameMargins: f[x_, y_] := 6 - 3 x - 2 y; gr = ContourPlot[f[x, y], {x, -4, 6}, {y, -2, 2}, ContourShading -> None, Contours -> {-6, 0, 6, 12}, ContourLabels -> Function[{x, y, z}, ...


2

Sum of this two function is. $$e^{-\frac{b^2 x^2}{2 c}}=\sum _{n=0}^{\infty } \frac{\left(\frac{b^2}{2 c}\right)^n (-1)^n x^{2 n}}{n!}$$ and $$J_d(x)=\sum _{n=0}^{\infty } \frac{(-1)^n \left(\frac{t x}{2}\right)^{2 n+d}}{n! \Gamma (n+1+d)}$$ Multiply Sum of this functions: Iloczyn = Sum[((-1)^k*(1/2*t*x)^(2 k + d)*x)/( k!*Gamma[k + 1 + ...


2

If my interpretation of your question is correct, the following code should produce the desired behaviour. prePrint[input_] := Module[{solveFor}, input /. {D[y_, x_, NonConstants -> {y_}] :> (solveFor = y'[x])} // If[OwnValues[solveFor] === {}, input, Solve[#, solveFor]] & // FullSimplify]; $PrePrint = prePrint; Test D[x == ...



Top 50 recent answers are included