New answers tagged

5

Sometimes they're equal: Block[{a = 2, b = 4}, {NIntegrate[E^(I a x)/(x^2 - b^2), {x, -Infinity, -b - I, b + I, Infinity}], -((π (I Abs[b] Cos[a b] + b Sin[a b]))/b^2) // N} ] (* {-0.77704 + 0.114275 I, -0.77704 + 0.114275 I} *) Kidding aside, perhaps you should specify PrincipalValue -> True (which I just noticed, belatedly, than Daniel ...


5

This integral has not a value in Riemann's sense, then it has not a value independent of your particular problem, as many people already commented above. Hence, it is better to use the residue theorem, and decide whether you want to include the residue from the pole at +b, at -b, both ou none. Therefore: rplus = Residue[E^(I a x)/(x^2 - b^2), {x, b}] ...


3

Let, $$ f=\frac{z-e^{i \pi/2 n}}{z^{2 n}+1} $$ Then, in Mathematica code, the following seems to work, Limit[f, z -> Exp[(I Pi)/(2 n)], Assumptions -> n >= 1/2] which gives the result, $$ -\frac{e^{i \pi/2 n}}{2n} $$ The problem isn't that Mathematica is handling the $0/0$ limit incorrectly. It's that Mathematica, without additional information, ...


2

happy fish ,he said "nth derivative is not natively supported" Yes it's true,but from here. Method1: For simple functions you can use InverseFourierTransform. f[s_] := Sin[s]; nthDeriv1[f_, s_, n_] := FullSimplify[InverseFourierTransform[(-I k)^n FourierTransform[f, s, k], k, s], {n \[Element] Integers, n > 0}] nthDeriv1[f[s], s, n] $$\sin ...


0

A method to solve the original decoupled system : s = NDSolve[{ D[u[x, t], t] == -D[u[x, t], x] - u[x, t], u[x, 0] == 1, u[0, t] == 1}, {u[x, t]}, {x, 0, 4}, {t, 0, 1}] v[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 1; w[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 2; z[x_, t_] = (u[x, t] /. s[[1, 1]]) /. x -> x + 3; Row[{ ...


2

I'd suggest a simpler approach that seems to work just fine: Use arbitrary precision input if you can. In your case, instead of d -> 0.001/5, use d -> 5/1000 integrand = Re[(x^4 Sin[x b])/(9 + 4 d^2 x^2)^6 1/2 E^(-(1/2) x^2 - I x c - 1/2 a^2) (Erfc[(I x - c)/Sqrt[2]] + E^(2 I x c) Erfc[(I x + c)/Sqrt[2]]) /. {b -> 5, ...


3

The problem is that you are not using large enough precision goal for an oscillatory integrand with very small absolute values over the integration range. Look at the log plot -- there are more oscillations than the ones visible with Plot: The remedy is to use higher precision goal. Try this: NIntegrate[ Re[(x^4 Sin[x b])/(9 + 4 d^2 x^2)^6 1/ 2 ...


2

Try Integrate[ Log[Abs[2 (0.27059805007309845` - 0.7071067811865475` s)]], {s, .3826, .3829}] (*-0.00280689*) returns no errors, since it is the same with your integral.


1

As suggested by the Documentation Center, you can remove excess (last 3) conditions. s = NDSolve[{D[u[x, t], t] == -D[u[x, t], x] - u[x, t], D[v[x, t], t] == -D[v[x, t], x] - v[x, t], D[w[x, t], t] == -D[w[x, t], x] - w[x, t], D[z[x, t], t] == -D[z[x, t], x] - z[x, t], u[x, 0] == 1, v[x, 0] == 1, w[x, 0] == 1, z[x, 0] == 1, u[0, t] ...


5

Confirmed for 10.4.1 as Alexei. However, WolframAlpha still gives the c/s result. See result from Wolfram|Alpha And using the properties of Dirac delta function, I would say that c/s is the correct one. May be a bug of the new 10.4.1? You can test with numeric constants, and Mathematica gives the correct answer. But symbolic result is wrong, ...


2

If you just want to make a plot of the region in question, this is good RevolutionPlot3D[{{x, (x + 8)^4}, {x, 8 x + 64}}, {x, -8, -6}, {th, 0, 2 π}, Mesh -> None, Axes -> False, Boxed -> False, BoxRatios -> {1, 1, .3}] But try as I might, I can't seem to find a way to get the volume of the region using Volume - this would involve ...


2

Here's a symbolic-algebraic way, based on the cylindrical algebraic decomposition (CAD) that Reduce computes. (* Disk/Washer method *) Clear[x, y, z]; eqns = {y == (x - 2)^4, 8 x - y == 16}; axis = x == 10; {depV} = Variables[Subtract @@ axis]; {indepV} = Complement[{x, y}, {depV}]; vars = {indepV, depV}; components = Map[ Reduce[#, vars] &, (* ...


2

Lets start with a simpler case Integrate[q0/(-1 + a q^2), q] $\frac{\log \left(1-a \text{q}^2\right)}{2 a}$ When you put limit [0,A], it has no problem with q=0. But it is not defined when $aA^2>1$. So you always have to obey that condition. You can check that by Integrate[q0/(-1 + a q0^2), {q0, 0, A}] In your second case Integrate[q0/(-1 + 12. ...


0

Using an undocumented function, Piecewise[Transpose[Reverse[MapAt[D[#, x] &, Internal`FromPiecewise[Piecewise[{{x^2, 0 <= x <= 1}, {x, x <= 4}}]], 2]]]] Piecewise[{{2 x, 0 <= x <= 1}, {1, x <= 4}}, 0]


3

Analysis of the error (bug?) We can see from the trace below that the second limit, which carries out a ratio test for the product, mistakenly yields -17 (which would indicate divergence, if correct). Trace[ NProduct[(n^2)!/stirling[n^2], {n, 1, Infinity}], _Limit, TraceInternal -> True, TraceForward -> True] There might have been some ...


4

MapAt[D[#, x] &, Piecewise[{{x^2, 0 <= x <= 1}, {x, x <= 4}}], {{1, ;; , 1}}] Note: this function works for expressions with Head Piecewise. For general expressions that contain Piecewise subexpressions, it can be used with ReplaceAll as follows: Y[x_] = Piecewise[{{x^2, 0 <= x <= 1}, {x, x <= 4}}]*F + Piecewise[{{x^4, 0 <= ...


1

If you need the output to be a function of v0 and vt, you do not need necessarily to do explicit symbolic integration. I hope this might help: Integration[v0_?NumberQ, vt_?NumberQ] := NIntegrate[1/x, {x, v0, vt}] Integration[5, 3] My output is -0.510826


2

Is this what you mean? Solve[Integrate[1/x, {x, v0, vt}, Assumptions -> 0 < v0 <= vt] == g/v0, v0] (* Out: {{v0 -> -(g/ProductLog[-(g/vt)])}} *) Or perhaps with a few more assumptions, and heeding Solve's suggestion to use Reduce, which would get us a more complete complete answer including "special cases" (i.e. solutions that are valid only ...


2

In version 10.2 or later you can use the EXPERIMENTAL function FindFormula lst = {{0, 1}, {5/999, 0.999925}, {5/333, 0.9997}, {25/999, 0.999325}, {35/999, 0.998801}, {5/111, 0.998127}, {55/999, 0.997305}, {65/999, 0.996335}, {25/333, 0.995217}, {85/999, 0.993952}, {95/999, 0.992542}, {35/333, 0.990986}, {115/999, 0.989287}, {125/999, ...


4

First of all there is somewhere in Mma a package for numerical calculation of derivatives, but I did not manage to find a reference. To offer a way to calculate the derivative. You could use the interpolation function. Here is your list: lst = {{0, 1}, {5/999, 0.999925}, {5/333, 0.9997}, {25/999, 0.999325}, {35/999, 0.998801}, {5/111, 0.998127}, ...


2

It should be mentioned at this juncture that ExtremeValueDistribution[] is built-in; up to a normalizing factor, your distribution is equivalent to ExtremeValueDistribution[q, 1/η]. Thus, PDF[ExtremeValueDistribution[q, 1/η], x] // Simplify E^(-E^((q - x) η) + (q - x) η) η SurvivalFunction[ExtremeValueDistribution[q, 1/η], t] // Simplify 1 - E^-E^((q ...


3

You can define a custom transformation function: sepint[expr_] := expr /. Integrate[Plus[a_, b_], c_] :> Plus[Integrate[a, c], Integrate[b, c]] Then apply it to the expression. The ComplexityFunction can be used to eliminate the DiracDelta in the expression. Simplify[Integrate[ Integrate[K[x, z] u[z], {z, -Infinity, +Infinity}] K[x, y] + ...


2

I have accepted Jens' method, since it works and with a minimum of inconvenience. However, it is more useful when generalized to multiple derivatives, so I will show what I did to accomplish that below. I also want to present two other work-arounds that I came up with. I do not like either as well as Jens', but they may be useful in cases where one does not ...


2

Braces [], brackets {}, and parenthesis () all have different meanings in mathematica. Sorry for the post. I will read the documentation and tutorials more completely.


2

One could also feed the ODE into DifferentialRoot[] (along with arbitrary initial conditions) and then apply FunctionExpand[]. sol = FunctionExpand[DifferentialRoot[Function[{y, x}, {y''[x] + 2 y'[x] + 5 y[x] == x Cos[x], y[0] == C[1], y'[0] == C[2]}]][x]]; ...


6

I think because of your parameters it's having a hard time inferring convergence / continuity conditions. For instance, the integral diverges when $\eta < 0$. You can specify assumptions and get the result: Integrate[E^(-η(x - q) - E^(-η(x - q))), {x, t, ∞}, Assumptions -> η > 0] (1 - E^-E^((q - t)η))/η Side note, Mathematica has no problem ...


0

This is not an answer but too long for a comment. The integral although may appear innocent is very nasty, I suggest, try Apart on it and you will see the source of the problems, if you try to do just one integral, Integrate[((η1 - 1)*η1*(2*η2 - 1)*(ξ1 - η1)^2*(ξ1 - 1)*(2*ξ2 - 1))/(4 + (ξ1 - η1)^2 + (ξ2 - η2)^2)^(3/2), {\ η1, -1, 1}, Assumptions ...


4

In Mathematica notation $Assumptions = ϕ ∈ Reals F[ϕ_, m_] := Integrate[1/Sqrt[1 - m Sin[θ]^2], {θ, 0, ϕ}] Plot[F[ϕ, -1], {ϕ, - Pi, π}, PlotStyle -> Red] In Maple notation F[\[Phi]_, k_] := Integrate[1/Sqrt[1 - k^2 Sin[\[Theta]]^2], {\[Theta], 0, \[Phi]}] Plot[F[\[Phi], I], {\[Phi], -2 Pi, 2 \[Pi]}] In maple


0

Perhaps this suffices: f[x_, y_] := NIntegrate[ UnitBox[s, t] BesselK[0, Sqrt[(x - s)^2 + (y - s)^2]], {s, -Infinity, Infinity}, {t, -Infinity, Infinity}] Visualizing: Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}, PlotRange -> Full, Mesh -> False, PlotPoints -> 25] Plot could be improved but I do not have time at present.


5

The original problem is an interesting example where a direct usage of Solve and NSolve fails. However Reduce can succeed solving it if we set unknowns in an appropriate order, thus there is no need to play with numerical functionality if symbolic one can resolve the given system. We can observe that there is a solution under the given condition with a == ...


10

mat = ConstantArray[1, {4, 4}] - IdentityMatrix[4]; LinearSolve[mat, {-1, 3, 5, 8}] {6, 2, 0, -3}


12

s = {w, x, y, z}; sum = {-1, 3, 5, 8}; add = Plus @@@ Subsets[s, {3}] (* {w + x + y, w + x + z, w + y + z, x + y + z} *) Solve[add == sum, s] (* {{w -> -3, x -> 0, y -> 2, z -> 6}} *)


1

The AddInputAlias function in the Notation package solves this problem. To use the example input alias created below, simply type Esc apply Esc. << Notation`; AddInputAlias[ParsedBoxWrapper[ RowBox[{"\[Placeholder]", " ", OverscriptBox["\[LongRightArrow]", RowBox[{" ", "Apply", " "}]], " ", "\[Placeholder]", " "}]], "apply"]


1

I think you might be stuck with numeric integration in this situation. I had some good success with NIntegrate. You get good results using the default options, given that you don't play too much around at $\pm\infty$. Particularly, if you are just interested in a certain definite integral, all you need is a straight forward call to NIntegrate, ...


1

I believe this blog post answers your question. http://blog.wolfram.com/2008/01/19/mathematica-and-the-fundamental-theorem-of-calculus/ It boils down to this: The fundamental theorem of Calculus requires the antiderivative be continuous. This is something hard to guarantee and can be slow to detect and fix the discontinuities by shifting vertically.


5

I seem to be getting different results depending on whether I use OP's suggested inner product in the comments, or if I use the polarization identity. Before everything else, however, here is a routine by Velvel Kahan for evaluating the divided difference of a polynomial, based on Horner's method: polynomialDividedDifference[poly_, {x_, a_, b_}] /; ...


9

Perhaps this? ip[f_, g_, v_] := Module[{x, y, int}, int = (((f /. v -> x) - (f /. v -> y)) ((g /. v -> x) - (g /. v -> y)))/(x - y)^2; Integrate[int, {x, -1, 1}, {y, -1, 1}] ]; Orthogonalize[x^Range[4], ip[##, x] &] (* {x/2, 1/2 Sqrt[3/2] x^2, 3/2 Sqrt[5/13] (-((2 x)/3) + x^3), 15/8 Sqrt[21/31] (-((14 x^2)/15) + x^4)} *) The ...


11

The region within the three curves can be plotted and its area determined using Mathematica's geometric capabilities. RegionPlot[y < 3/x && y < 12 x && y > x/12, {x, 0, 6}, {y, 0, 6}, PlotPoints -> 200, FrameLabel -> {x, y}] and integrate its area by Area[ImplicitRegion[y < 3/x && y < 12 x && y ...


4

When you use Mathematica, you could start with a plot like this Plot[{3/x, 12 x, x/12}, {x, 0, 10}, PlotRange -> {{0, 10}, {0, 10}}] Then you can see where the area is which you should integrate. And by using Solve[3/x == 12 x, x], Solve[12 x == x/12, x] and Solve[x/12 == 3/x, x] you can calculate the three intersections which are 0, 0.5 and 6. ...


10

Here is one way: noIn[y_, x_] = y; noIn[Indeterminate, x_] = Round[x]; transIn[x_] = noIn[(1 + Erf[2 ArcTanh[2 x - 1]])/2, x]; transOut[x_] = noIn[(1 - Erf[2 ArcTanh[2 x - 1]])/2, x]; SeedRandom[15] f[x_, y_] = RandomReal[{-1, 1}, 4].Sin[RandomReal[{-2, 2}, {4, 4}].{1, x, y, x^(4/3)}]/3; r[t_] = {1/2 + Sin[t] + t^(3/2) - (t/2)^2, Sin[t] - t^2 + (2 t/3)^5 - ...


5

Direct Integration Possible issues in performing the integrations include choice of Assumptions, branch cuts in the integrands, and how limits are taken. Addressing the first of these gives five solutions. il[f_, s_, t_] := Module[{r}, 1/(2 π I) Integrate[f Exp[s t], {s, r - I ∞, r + I ∞}, Assumptions -> r > 2 && t > 0]] ...


0

Use FullForm or, more conveniently here, InputForm to see what the original expression looks like internally: (Sqrt[Pi]*Derivative[2, 0][Subscript[a, 0]][x, y])/(2^(2*α)*α*Gamma[α]*Gamma[1/2 + α]) Subscript[a, 0][x, y] does not actually appear here. Instead, Derivative[2, 0][Subscript[a, 0]][x, y] does. Consequently, the whole derivative must be ...


7

I do not know how you get the answer you post $2 \frac{\mu^2}{\mu^2+4 k^2}$, but if you tell Mathematica that both $\mu,\theta$ are either positive or negative at the same time, you get a similar answer but one that has a $\log$ in it: Clear[x, mu,k] integrand = Sin[x]/(1 + (4 k^2)/mu^2 (Sin[x/2])^2); Assuming[ Element[{mu, k}, Reals] && {mu, k} ...


1

How does Integrate work? https://en.wikipedia.org/wiki/Risch_algorithm There are more details you can find online, but it's not useful for most people. Integrate internally does a lot of things that most people wouldn't understand. If you want to learn more about integration, you should use Wolfram|Alpha. It can show you the steps a human would take to ...


7

Rules. Lots of rules. See the implementation notes in the documentation. I don't know of a way to show Mathematica's intermediate steps, but you can load the Rubi symbolic integration package, which will in fact show how it does an integral with ShowSteps=True;. Also it seems to work better than Mathematica's integrator. Int[Sin[x]^2/(x^2 + 1), x] Rule ...


3

I think you mean you want to calculate the area between a function and the x-axis. Define the function : g[x_] := E^(5 x) Show the area between the function and x-axis over the interval [−4,2] : Plot[g[x], {x, -4, 2}, PlotRange -> Full, Filling -> Axis, FillingStyle -> Yellow] With the knowledge of Calculus, the area can be computed with ...


2

EDIT I have now confirmed my closed form expression numerically. This was possible by helping Mathematica to calculate the numerical value of mixed partial derivatives of HypergeometricU[a,b,z] with respect to a and b. Original post We derive a closed form by another procedure. The procedure seems to be valid but Mathematica has difficulties with the ...


6

As already mentioned in a comment this limit does not exist without saying more about the way you'd like to approach the point {0,0}. First of all, I shall take the y^2 in the numerator seriously and not as mistyped y^4. The 3D plot already shows the problem: in the vicinity of {0,0} the function is not continuous Plot3D[f, {x, -1, 1}, {y, -1, 1}] In ...


1

I have two suggestions to speed up the code: Always Expand the input expression f Set option GenerateConditions→False to Integrate to bypass convergence test routines. This Expands the input and passes the result to the integrators internalINT: INT[α_, f_, x_, opts___] := Module[{expr = Expand[f]}, internalINT[α, f, x, opts] ] Of the ...


9

Integrating by parts we have: F[t_] := Exp[-a*t]; G[t_] := Log[t]*Log[1 + t]; HoldForm[Integrate[F[t]*G'[t], t] = F[t]*G[t] - Integrate[F'[t]*G[t], t]] integral = Integrate[F[t]*G'[t], t] == F[t]*G[t] - Integrate[F'[t]*G[t], t] First@Expand@Solve[integral, \[Integral]E^(-a t) Log[t] Log[1 + t] \[DifferentialD]t] $$\int F(t) G'(t) \, dt=F(t) G(t)-\int ...



Top 50 recent answers are included