New answers tagged

3

You forgot the derivative (see Residue of monomial here): NIntegrate[func[Exp[I \[CurlyPhi]]]/(2 Pi I)*I*Exp[I \[CurlyPhi]], {\[CurlyPhi], 0, 2 Pi}] 1.99993 - 1.11022*10^-16 I


3

Perhaps you could try to integrate along a path which excludes the singular point p= 0+I 0 (quarter-circle radius eps) : int[eps_?NumericQ] := NIntegrate[func[I p], {p, Pi/2, eps}] + NIntegrate[func[eps (Sin[\[CurlyPhi]] + I Cos[\[CurlyPhi]])], {\[CurlyPhi],0, Pi/2 }] + NIntegrate[func[p], {p, eps, Infinity} ] The Limit eps->0 gives the integral you're ...


1

c[x] is not possible because MMA may need several constants and these are written: c[1], c[2].. However, you may indicate that the constant depends on x by using GeneratedParameters -> C[x] what will result in: c[x][1] what is displayed as e.g. with your example: u[x_, y_] := 4 x^4 + 6 x y - 24 x^2 y^2 + 4 y^4 Integrate[\!\( \*SubscriptBox[\(\[PartialD]\...


1

$Version (* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *) Clear["Global`*"] function[z_] := 1/(Sinh[z/2] Sqrt[Cosh[z]]) Add assumuptions integ[a_] = Assuming[0 < a < Pi/2, Integrate[function[z], {z, a I, -a I + Pi I/2}]] (* 2 (ArcTanh[Cos[a/2] Sqrt[Sec[a]]] - ArcTanh[Sin[1/4 (2 a + π)]/Sqrt[Sin[a]]]) *) Verifying ...


1

Here is a solution using Part Flatten[A[[All, # ;; ;; 3]] & /@ Range@3 // Transpose, 1] // Transpose


7

B == ArrayReshape[Transpose[ArrayReshape[A, {3, 3, 3}]], {3, 9}] True Also, in loop style: result = ConstantArray[0, {3, 9}]; Do[ result[[i, 3 (j - 1) + k]] = A[[j, 3 (i - 1) + k]], {i, 1, 3}, {j, 1, 3}, {k, 1, 3} ]; result == B True Or with a permutation matrix of size $27 \times 27$: P = Block[{A, B, a}, A = Array[a, {3, 9}]; B = ...


7

You can use LinearSolve to find one possible matrix such that A.X==B: X = LinearSolve[A, B]; A.X == B // FullSimplify (* True *)


1

The integral divergence in the range $[0,\infty]$ d = 2; func[p_] := 1/(Cosh[p/2]^(2/d) Tanh[p/2] Sqrt[ 1 - (Cosh[p/2]^(4 - 4/d) Tanh[p/2]^2)/(-0.419602)]) // Rationalize[#, 0] &; Integrate[func[p], {p, r, ∞}, Assumptions -> r > 0] Limit[%, r -> 0, Direction -> "FromAbove"] $$\log \left(\frac{\sqrt{81193660402}-2 \...


1

There are several messages when using DSolve[] In[15]:= DSolve[{H'[u] == -a*H[u], H[0] == HMax, X'[u] == X[u]*b*H[u]/HMax - X[u]*d*X[u]/K, X[0] == K}, {H[u], X[u]}, u] During evaluation of In[15]:= Solve::incnst: Inconsistent or redundant transcendental equation. After reduction, the bad equation is -2000+Subscript[\[ConstantC], 1] == 0. During ...


0

We can set g as parameter in ParametricNDSolve a = 0.03; b = d = 1; c = 0.5; K = HMax = 2000; v = 10^(-7); sol = ParametricNDSolve[{X'[t] == X[t]*b*H[t]/HMax - X[t]*d*(X[t] + Y[t])/K, Y'[t] == Y[t]*b*(1 - c*g)*H[t]/HMax + Y[t]*b*(1 - c*g)*g*(1 - H[t]/HMax) - Y[t]*d*(X[t] + Y[t])/K, H'[t] == Y[t]*b*(1 - c*g)*(1 - H[t]/HMax)*g - a*...


1

Here is an approach that gives an expression similar to the one you want. The main differences between this approach and the one in the original post are Variables $\epsilon_{r\theta}$, etc, must be explicit functions of $r,\theta$. Variables $\epsilon_{11}$, etc, are not "functions", so no & at the end. The mixed partial derivatives, $\...


0

We should at first differential the original equation,after that we can easy solve the p'[T] Here we giva a simple example. Clear[eq, deq, derivative]; eq = x^2 + y^2 + y*z == 1 /. y -> y[x]; deq = D[eq, x]; derivative = y'[x] /. Solve[deq, y'[x]] // First; derivative /. x -> 30 -(60/(z + 2 y[30])) For the original equation just use the same way. ...


0

Try this: here is your equation: Clear[p]; eq = p == \[Phi]/ R + ((1 - \[Phi]) \[Phi] (1 - \[Lambda]) \[Beta])/(((W - T p) R + \[Phi] T) R + \[Phi]*(1 - \[Phi]) T)/(R (\ \[Lambda]/((W - T p) R + \[Phi] T) + ((1 - \[Lambda]) \[Beta] R)/(((W - T p) R + \[Phi] T) R + \[Phi] (1 - \[Phi]) T))) It has two ...


2

Here's a way that works (see NumericQ::set for the use of NumericQ below — not sure if there are better refs for it): NumericQ[t0] = True; (* make t0 seem numeric *) DSolve[{f'[t] + ω[t] f[t] == 0, f[t0] == 1}, f, t] NumericQ[t0] =. (* unset the numeric setting *) DSolve insists that base points for the integration be numeric. The developers must have ...


1

You can use ReplaceAll /. taking care to notice that the output from DSolve is the inactive form of the integral. solMap = DSolve[{f'[t] + \[Omega][t] f[t] == 0, f[t0] == 1}, f[t], t] solMap /. Inactivate[ Integrate[g_, {x_, 1, t}] - Integrate[g_, {x_, 1, t0}], Integrate] -> Inactivate[Integrate[g, {x, t0, t}], Integrate] which ...


0

A plot of the integrand shows the region where it gets very (infinitely) large so the general integral will have a hard time...: a = 7/10; Plot3D[(1 - y*E^(b*y)*Gamma[0, y/b])/(1 + a*y), {y, 0, 12000}, {b, 0.1, 1.5}, AxesLabel -> Automatic, WorkingPrecision -> 30, PlotPoints -> 500, PlotRange -> {-10^5, 10}]


0

You should try plotting your functions before assuming they're oscillatory. Some are not. Some have numerics issues. You're asking a lot if you want people to help you with 211 slow integrals. A MWE should be minimal. Here's an idea to help with a few of the 211 integrals: Figure out where the support of the integral lies, and make sure it's sampled. rat =...


0

The integral appears to be solvable in Mathematica 8.0.1 when substituting a and b with b=Prime[3] and a=Prime[5] and applying integration by parts 3 times: Part1 = (1 - y*E^(Prime[3]*y)*Gamma[0, y/Prime[3]]); Part2 = 1/(1 + Prime[5]*y); u = Part1; du = D[Part1, y]; v = Integrate[Part2, y]; dv = Part2; u*v - Integrate[v*du, y] Integrate[Part1*Part2, y]; ...


3

You can get an analytical solution for b == 1 and a >0 with MMA version 8.0. ii[y_, a_, b_] = (1 - y*E^(b*y)*Gamma[0, y/b])/(1 + a*y) Integrate[ii[y, a, 1] // FunctionExpand, {y, 0, Infinity}, Assumptions -> a > 0] (* (1/(12 a^3))E^(-1/ a) (-12 HypergeometricPFQ[{1, 1, 1}, {2, 2, 2}, 1/a] + a (-6 EulerGamma^2 + 5 \[Pi]^2 - ...


1

Too long for a comment. Something can be done. Though the integral under consideration likely cannot be expressed in a closed form, we can consider the asymptotic of the integrand at infinity by Normal[Series[(1 - y*E^(b*y)*Gamma[0, y/b])/(1 + a*y), {y, Infinity, 4}, Assumptions -> a > 0 && b > 0]] // Simplify (1/(a^4 y^4))(-1 + a y - a^2 ...


1

You can do something like this: myD[a_, o__] /; ! OrderedQ@{o} := myD[a, Sequence @@ Sort@{o}] myD[myD[Q, x[1, 2]], x[3, 4]] This will ensure that the coordinates after which the expression is differentiated are always sorted. You can define another order instead of Sort{o}, but the key is that all equivalent forms are converted into a single canonical ...


0

Some things change to better. In 12.3 f[k_] = Sin[k]/k s[n_] := Sum[f[k]^n, {k, 0, \[Infinity]}] Table[{n, s[n]}, {n, 1, 7}] // Expand//FullSimplify {{1, (1 + \[Pi])/2}, {2, (1 + \[Pi])/2}, {3, 1/8 (4 + 3 \[Pi])}, {4, 1/6 (3 + 2 \[Pi])}, {5, 1/2 + (115 \[Pi])/384}, {6, 1/2 + (11 \[Pi])/40}, {7, 1/2 + (1/46080)\[Pi] (129423 + 4 (-7 + \[Pi]) \[Pi] (147 - ...


0

Try the following trick: realPartRule = Complex[re_, im_] :> Complex[re, 0]; realPart[exp__] := exp /. realPartRule; Applying this trick to your result we obtain: realPart[Integrate[Exp[a*(x^3)], {x, 0, b}, Assumptions -> {a > 0, b > 0}]] (*(Gamma[1/3] - Gamma[1/3, -a b^3])/(6 a^(1/3))*)


0

Here is dirty trick suitable for that particular case: rez = Integrate[Exp[5*(x^3)], {x, 0, 7}, Assumptions -> {a > 0, b > 0}] // ToRadicals rezComplex = Integrate[Exp[a*(x^3)], {x, 0, b}, Assumptions -> {a > 0, b > 0}] realAnswer = (rez // ToRadicals) /. {5 -> a, -1715 -> -a*b^3} FullSimplify[(realAnswer - rezComplex), ...


1

What you have labeled as a function is itself a differential operator. In general, they are to be applied to a function of both r and θ op1 = Cos[θ]*D[#, r] &; op2 = -Sin[θ]/r *D[#, θ] &; op2[op1[f[r, θ]]] // Apart (* (Sin[θ]^2*Derivative[1, 0][f][r, θ])/r - (Cos[θ]*Sin[θ]*Derivative[1, 1][f][r, θ])/r


3

You can try with finer discretization by making MaxCellMeasure smaller: usol = NDSolveValue[{\!\( \*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[x, y]\)\) + 0.5 Exp[-u[x, y]] - 2. Exp[u[x, y]] == 0., DirichletCondition[ u[x, y] == 2. Log[1. - 0.5 Sin[2. ArcTan[x, y]]], True]}, u, {x, y} \[Element] Disk[], Method -&...


1

Try this one Limit[Cos[n^2]/(4 + n^3 + Sqrt[n]), n -> Infinity] (*0*)


2

Try Derivative ! Examplary D[eps[r, teta] Cos[teta]^2,{{r,teta}] Derivative[1, 1][Function[{r, teta}, eps[r, teta] Cos[teta]^2] ][r, teta]


0

To long for a comment: MMA version 8.0 gives you an antiderivative that has no discontinuity (here called int1, your solution called int2) int1 = -(I (1 - 6 t^2 + t^4 + 8 t Z - 4 Z^2) (\[Pi]^2 - 4 I \[Pi] ArcTanh[(1 - t^2 + 2 I t u - 2 I u Z)/Sqrt[ 1 + t^4 + 4 t^3 y + 4 y Z + 4 Z^2 - 4 t (y + 2 Z) + t^2 (2 - 4 y Z)]] - 8 ArcTanh[(1 - t^2 +...


3

There is no concept of "transposed vector" in Mathematica. To illustrate, let's give your variables concrete values: Ip = {{Ixx, Ixy, Ixz}, {Ixy, Iyy, Iyz}, {Ixz, Iyz, Izz}}; ω = {ωx, ωy, ωz}; Your $Q$ is simply Q = ω . Ip . ω // Expand (* Ixx ωx^2 + 2 Ixy ωx ωy + Iyy ωy^2 + 2 Ixz ωx ωz + 2 Iyz ωy ωz + Izz ωz^2 *) and its gradient with ...


0

Your function definition cannot evaluate for numeric arguments. Note Clear["Global`*"] f[n_, x_] := D[Exp[x] f[n - 1, x], x] f[0, x_] = 1; f[1, 2] Delay the variable being given a value until after the differentiation Clear["Global`*"] f[n_Integer?Positive, x_] := Module[{t}, D[Exp[t] f[n - 1, t], t] /. t -> x]; f[0, x_] = 1; f[...


3

The code for D[Sum[..],..] assumes no options to Sum, so Method -> "Procedural" is treated as an iterator. This is a bug. After assuming it's an iterator, the code fails internally because it's a bad iterator. This mysteriously leads to a derivative of {{0}}, which seems an unimportant bug. This last bug happens with D[Sum[(xx - x[j])^2, j], ...


0

$Version (* "12.3.0 for Mac OS X x86 (64-bit) (May 10, 2021)" *) Clear["Global`*"] Using a replacement Rule intSumRule = Inactive[Integrate][int1_, iter_] + Inactive[Integrate][int2_, iter_] :> Integrate[int1 + int2, iter]; Using the Rule Integrate[Sqrt[Log[9 - x]]/(Sqrt[Log[9 - x]] + Sqrt[Log[3 + x]]), {x, 2, 4}] + ...


0

This can be done as follows Integrate[ Sqrt[Log[9 - x]]/(Sqrt[Log[9 - x]] + Sqrt[Log[3 + x]]), {x, 2, 4}][[1]] + Integrate[Sqrt[Log[3 + x]]/(Sqrt[Log[9 - x]] + Sqrt[Log[3 + x]]), {x, 2, 4}][[1]; and then Integrate[%, Integrate[ Sqrt[Log[9 - x]]/(Sqrt[Log[9 - x]] + Sqrt[Log[3 + x]]), {x, 2, 4}][[2]]] results in 2. Addition. In the general case ...


8

Use an immediate assignment to define v: v[t_] = Integrate[-0.08 t, t] + c (* c - 0.04 t^2 *) Solve[v[0] == 8] (* {{c -> 8.}} *) Here's a tutorial on the distinction between immediate and delayed assignments. Alternatively, use a definite integral: t0 = 0; v0 = 8; v[t_] = v0 + Integrate[-0.08 s, {s, t0, t}] (* 8 - 0.04 t^2 *)


0

Some things change to better since 12.2 FunctionDiscontinuities[D[RealAbs[x], x], x] RealAbs[x] == 0 FunctionDiscontinuities[CantorStaircase'[x], x] Falseand a warning "FunctionDiscontinuities::unkds: Warning: The set of discontinuities may be incomplete due to missing domain and discontinuity information for some of the functions involved." ...


1

The Method->"LocalAdaptive" option does the job: NIntegrate[Exp[-Cos[x1] - Cos[x2] - Cos[x1 - x3] - Cos[x1 - x4] - Cos[x2 - x3] - Cos[x2 - x4] - Cos[x3 - x4] + 2 (Cos[2 x1] + Cos[2 x2] + Cos[2 x3] + Cos[2 x4])], {x1, 0,2 Pi}, {x2, 0, 2 Pi}, {x3, 0, 2 Pi}, {x4, 0, 2 Pi}, Method -> "LocalAdaptive"] // AbsoluteTiming {1.93531, ...


1

Simplify the integrand and perform symbolic (not numerical) integration: Integrate[-Cos[x1] - Cos[x2] - Cos[x1 - x3] - Cos[x2 - x3] - Cos[x1 - x4] - Cos[x2 - x4] - Cos[x3 - x4] + 2 (Cos[2 x1] + Cos[2 x2] + Cos[2 x3] + Cos[2 x4]), {x1, 0, 2 Pi}, {x2, 0, 2 Pi}, {x3, 0, 2 Pi}, {x4, 0, 2 Pi}] (* 0 *) 1.99 seconds on a Mac laptop. You could also separate ...


3

The coefficients on Pi looks like Sin[i π/2]/i, and FindSequenceFunction can suggest the rational part: a[i_] := a[i] = Integrate[Log[1 + Sin[x]]*Sin[i*x], {x, 0, Pi}]; seq = Table[a[i] - Sin[i π/2] π/i, {i, 1, 28, 2}] // Expand // FindSequenceFunction; FullSimplify[seq[(i + 1)/2], i ∈ PositiveIntegers] (* (I^(1 + i) i π + 2 (-1)^i (-1 + i LerchPhi[-1, 1, 1 ...


4

You can get a general formula for integrals, if you TrigExpand the integer multiples of Sin[j x] and integrate each summand alone. Make use of the fact, that summands can be developed with a Binomial formula. (tab = Table[(Sin[(j)*x] // TrigExpand), {j, 1, 11}]) // TableForm (ta = Table[ Sum[(-1)^( (k - 1)/2) Binomial[n, k]*Cos[x]^(n - k) Sin[x]^k, {k, 1,...


4

Often Mathematica Integrate shows problems with integer assumptions. As a workaround try intEven[i_] := Integrate[Log[1 + Sin[x]]*Sin[(2 i )*x], {x, 0, Pi}] Table[{2 i, intEven[i]}, {i, 1, 5}] (*{{2, 0}, {4, 0}, {6, 0}, {8, 0}, {10, 0}}*) intOdd[i_] := Integrate[Log[1 + Sin[x]]*Sin[(2 i-1 )*x], {x, 0, Pi}] Table[{2 i - 1, intOdd[i]}, {i, 1, 5}] (*{{1, -2 + \...


2

f[x_] := (1 - Sqrt[x])/(1 - x) offsets = {0.5, 0.1, 0.01, 0.001, 0.0001, 0.00001}; Grid[ Join[{{"from the left", SpanFromLeft, "from the right", SpanFromLeft}, {x, StringForm["f[x]\[ThinSpace]=\[ThinSpace]``", f[x]], x, StringForm["f[x]\[ThinSpace]=\[ThinSpace]``", f[x]]}}, {1 - #, f[1 - #], 1 + #, f[1 + #]}...


2

I am not sure if this is what you meant or not. Grid[{{g1, g2}}] code f[x_] := (1 - Sqrt[x])/(1 - x) values = {1.5, 1.9, 1.99, 1.999, 1.9999}; data1 = {#, Limit[f[x], x -> #, Direction -> "FromBelow"]} & /@ values; title1 = {"From the left", SpanFromLeft}; title2 = {"x", Row[{"f(x)=", f[x]}]}; PrependTo[...


0

The Harmonic number $H_{n-1}$ can be expressed by the Digamma function $\psi(n)$ together with the Euler-Mascheroni constant $\gamma\approx 0.5772$. $\psi(n)=H_{n-1}-\gamma$ In MMA $\psi(n)$ and $\gamma$ are called by PolyGamma[n] and EulerGamma. Table[Limit[(PolyGamma[k] + EulerGamma)*k, k -> n], {n, 0, 4}] *( {-1, 0, 2, 9/2, 22/3} *) The limes is ...


Top 50 recent answers are included