New answers tagged

2

In version 12.0 Integrate[1/(1 + \[Alpha]^2 + \[Beta]^2 - 2 \[Beta] Cos[\[Phi]])^(3/ 2), {\[Phi], 0, 2*Pi}, GenerateConditions -> False] $$\frac{4 E\left(-\frac{4 \beta }{\alpha ^2+(\beta -1)^2}\right)}{\sqrt{\alpha ^2+(\beta -1)^2} \left(\alpha ^2+(\beta +1)^2\right)} $$ Integrate[Cos[\[Phi]]/(1 + \[Alpha]^2 + \[Beta]^2 - 2 \[Beta] Cos[\[Phi]])^(3/ 2),...


2

This type of an integral can be rewritten more explicitly as the complete elliptic integral of the second kind, namely using change of the independent variable $x\to \frac{x}{a}$ and the integral will be equal (assuming $a\neq 0$): $$\int_0^{a}\sqrt{1+\frac{b^2 x^2}{a^4- a^2 x^2}} dx= a \int_0^{1}\sqrt{1+\frac{b^2 x^2}{a^2(1- x^2)}} dx$$ a Integrate[Sqrt[1 +...


2

For some reason, Mathematica takes a wrong turn in evaluating this integral if the integrand is $$ \sqrt{1 + \frac{b^2 x^2}{a^4 - a^2 x^2}}. $$ However, if the expression under the radical is combined into a single square root, i.e. $$ \sqrt{\frac{a^4 - a^2x^2 + b^2 x^2}{a^4 - a^2 x^2}}, $$ Mathematica happily integrates it. This can be accomplished by the ...


2

Mathematica does not like to take things out of integrals. You can define the following rule: repl = Integrate[x_ y__, {var_, bounds__}] /; FreeQ[x, var] :> x Integrate[y, {var, bounds}]; And then Mathematica will happily factor out the "constants" Integrate[f[r], {r, τ, t}] == a*Integrate[f[r]/a, {r, τ, t}] /. repl (* True *)


0

Solve this differential-algebraic equation of order 1/2 with constant boundary condition with the method of separation. pi y^2=Sqrt[1-y'^2] pi^2y^4=1-y'^2 y'=+/-Sqrt[1-pi^2y^4] dy/Sqrt[1-pi^2y^4]=+/-dx x+constant=Integrate[1/Sqrt[1 - pi^2 y^4], y] x+constant=-((I EllipticF[I ArcSin[Sqrt[-pi] y], -1])/Sqrt[-pi]) Now there is a unique functional relation ...


2

Our purpose is the follolwing graphics: The ordinary differential equation at hand can be solved exactly in terms of elliptic functions. The solution will be periodic (with singularities) and so the numerical approach is not satisfactory since the solution cannot be continued past singularity unless one takes into account basic properties of elliptic ...


2

solve ode Y = NDSolveValue[{(Pi y[x]^2) == Sqrt[ 1 + y'[x]^2] , y[0] == 1 },y, {x, -1, 1}, Method -> "StiffnessSwitching"] Solution is only real for -.23<x<.42 revolute around x-axis ParametricPlot3D[ {x, Y[x] Cos[t], Y[x] Sin[t]}, {x, -.3, 1}, {t, 0,2 Pi}, AxesLabel -> {x, y, z}, BoxRatios -> {1, 1, 1} ] alternativly ...


3

Using the substitution u==a x the identity is transformed to Integrate[u/((u^2 + ab^2) Sin[u]), {u, 0, Infinity}] == Pi/(2 Sinh[ab]) The integral is singular at u==k Pi, k=1,2,... and the integration range is splitted into subintervals (similar to @yarchik answer) containing only one singularity (thanks to @flinty and @ ChipHurst comments): int[ab_?...


2

I was not able to get a half iterate for $\cos(...)$ anything, and from reading around a bit it appears that half iterates of $\cos$ might be impossible either due to convergence or the evenness of $\cos$'s series expansion terms. However, I was able to get a half-iterate for a small part of the domain of $\sin(4 \pi x)$ through fixed point iteration on the ...


4

I want to focus on the numerics here. There is a way to do this integral taking infinite number of singularities into account. One can split the integral into the domains containing only one singularity at $a x_n=\pi n$, i.e. $x\in[x_n-\frac{\pi}{2a},x_n+\frac{\pi}{2a}]$ and an integral in the interval $x\in[0,\frac{\pi}{2a}]$. On the last step we use NSum ...


3

Following the @flinty's comment, we obtain Residue[x/(x^2 + b^2)/Sin[a*x], {x, π/a*n}, Assumptions -> n ∈ Integers] (*((-1)^-n n π)/(a^2 b^2 + n^2 π^2)*) Sum[%, {n, -∞, ∞}] (*0*) and 2*π*I*Residue[x/(x^2 + b^2)/Sin[a*x], {x, I*b}] (*π Csch[a b]*) Now, making use of the Jordan's lemma, we conclude that $$PV\int_{-\infty}^\infty\frac x {(x^2+b^2)\sin(...


2

Use FunctionExpand $Version (* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *) Clear["Global`*"] i1 = Integrate[1/Sqrt[1 + t^4], {t, 0, 1}] (* (2 Gamma[5/4]^2)/Sqrt[π] *) i2 = Integrate[Sec[u]^2/Sqrt[1 + Tan[u]^4], {u, 0, π/4}] (* 1/2 EllipticK[1/2] *) i1 == i2 // FunctionExpand // FullSimplify (* True *)


5

This is pretty easy to do with the extant region functionality: eq = {u, v, u^2 + v^2}; plane = InfinitePlane[eq, Transpose[D[eq, {{u, v}}]]]; sols = plane /. Solve[RegionMember[plane, #] & /@ {{1, 0, 0}, {0, 1, 0}}, {u, v}] {InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}}], InfinitePlane[{1, 1, 2}, {{1, 0, 2}, {0, 1, 2}}]} If you want to see ...


3

Clear["`*"]; f = x^2 + y^2 - z; Solve[{Grad[f, {x, y, z}].({x, y, z} - {1, 0, 0}) == 0 , Grad[f, {x, y, z}].({x, y, z} - {0, 1, 0}) == 0, f == 0}, {x, y, z}] Grad[f, {x, y, z}].({X, Y, Z} - {x, y, z}) == 0 /. % // Simplify


2

Solve[{Resolve[ ForAll[{x, y}, x^2 + y^2 + a*x + b*y + c >= 0] && Exists[{x, y}, x^2 + y^2 + a*x + b*y + c == 0], Reals], {a, b, -1}.{1, 0, 0} + c == 0, {a, b, -1}.{0, 1, 0} + c == 0}, {a, b, c}] a*x + b*y - z + c == 0 /. %


3

Try this: Gxyz = z - x^2 - y^2; p = {x, y, z}; p1 = {1, 0, 0}; p2 = {0, 1, 0}; n = Grad[Gxyz, p] equ1 = n.(p - p1) == 0 equ2 = n.(p - p2) == 0 equ3 = Gxyz == 0 sol = Solve[{equ1, equ2, equ3}, p] n0 = n /. sol gr1 = ContourPlot3D[Gxyz == 0, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]; gr2 = ContourPlot3D[n0[[1]].(p - p1) == 0, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]; ...


3

I expect two solutions! First we consider the plane p0,p1,p2 p1 = {1, 0, 0}; p2 = {0, 1, 0}; p0 = {x0, y0, x0^2 + y0^2}; with normal en= Cross[p0 - p1, p0 - p2]; The normal is forced to be pependicular to the tangentplane at p0 p0/. Solve[{n.D[p0, x0] == 0, n.D[p0, y0] == 0}, {x0, y0}, Reals] (*{{0, 0, 0}, {1, 1, 2}}*) GraphicsRow[{Show[{Plot3D[x^2 + y^...


9

We construct an NDSolve method which can pass an NIntegrate method to NIntegrate to set up an integration rule. We define a method nintegrate implements such a method. The requirements are the ODE is of the form y'[x] == f[x], and the NIntegrate method returns an interpolatory rule. Example: foo = NDSolveValue[{y'[x] == Sin[x^2], y[0] == 0}, y, {x, 0, 15}...


0

CurveIntegrateFor2nd[{u_, v_}, curve_, {x_, y_}, reg_, opt___] := Block[{x1, y1, cur = curve /. x1_ == y1_ :> x1 - y1}, Integrate[{u, v}.({-1, 1}*Normalize[D[cur, {{y, x}}]]) /. Abs -> RealAbs, {x, y} ∈ reg, opt]] With[{curve2 = x^2 + y^2 == 2}, CurveIntegrateFor2nd[{(4 x - y)/(4 x^2 + y^2), (x + y)/( 4 x^2 + y^2)}, curve2, {x, y}, ...


2

We can integrate over the region without transforming to an area or changing to a polar variable ($\theta$, that is). Integrate[1,{x,y} ∈ reg] gives the circumference, so we know the integration over the region is wrt path length, $ds$. Now, $dx = d(R\,cos\theta) = -R\,sin\theta\,d\theta = -(y/R) ds$ along the path. This is not the same transformation that ...


3

My guess is that Limit can have trouble if (x, y} -> {a, b} where {a, b} is not an interior point of the domain. For instance, I would say the limit here is well-defined since {0, 0} is a limit point of the domain and that the limit is 1: Limit[ConditionalExpression[Sin[x1]/x1, x1 > x2], {x1, x2} -> {0, 0}] (* Indeterminate *) Limit can handle ...


1

First, let's look at what happens if we factor the ep term out of the integral, like this ClearAll[a, b, f, R, t] ep = a + I b; B = Integrate[f[t] , {t, -R, R}] ep; With[{$Assumptions = Element[Integrate[ f[t], {t, -R, R}], Reals]}, Re[B] // ComplexExpand // Simplify ] (* a*Integrate[f[t], {t, -R, R}] *) So, it looks like MMA is able to apply the ...


2

All credit to @Roman who deserves the accept for discovering 7095816 was the target number. With this number pinned down I tried to solve this myself with Mathematica, but it was still too slow: variables = Array[x, 16]; matrix = ArrayReshape[variables, {4, 4}]; target = 7095816; uniqueConstraint = (And @@ (Unequal @@@ Subsets[variables, {2}])); ...


4

There are only seven (six unique) solutions up to row/column sums of $10^8$ (of course there are 1152 equivalent squares by permutation/transposition for each one): $$ \left( \begin{array}{cccc} 2 & 16 & 108 & 180 \\ 24 & 192 & 9 & 15 \\ 144 & 18 & 150 & 90 \\ 160 & 20 & 135 & 81 \\ \end{array} \right),\...


3

I've been back and forth trying to work out why Mathematica was getting the surface integral 'wrong'. But Mathematica can do surface integrals properly. See this answer. It turns out your original calculation with the region is correct after all: reg = ImplicitRegion[x^2 + y^2 + 4 z^2 == 4 && z >= 0, {x, y, z}]; Integrate[Sqrt[4 - x^2 - 4z^2], {x, ...


0

Here's a variation of bbgodfrey's answer that doesn't require quieting: g[a_,b_]:=Activate @ Block[{NIntegrate=Inactive[NIntegrate]},Derivative[1,0][f][a,b]] Check: g[1, 1] 1.80525 The trick is that Mathematica knows how to take derivatives of inactive integrals, so temporarily inactivating NIntegrate avoids having NIntegrate trying to integrate a ...


3

J = ImplicitRegion[ Abs[xa] < 1 && Abs[xa - xb] < 1 && Abs[-L + xb] < 1 && Abs[xa - xc] < 1 && Abs[-L + xc] < 1 && L - 2 <= xa <= 1 && L - 1 <= xb <= 2 && L - 1 <= xc <= 2, {xa, xb, xc}]; Assuming[2 < L < 3, RegionMeasure[J]] (* 1/3 (27 - 27 L + 9 L^2 - L^...


3

reg = ImplicitRegion[{Abs[xa] < 1, Abs[xa - xb] < 1, Abs[-L + xb] < 1, Abs[xa - xc] < 1, Abs[-L + xc] < 1, L - 2 <= xa <= 1, L - 1 <= xb <= 2, L - 1 <= xc <= 2}, {xa, xb, xc}]; Assuming[2 < L < 3, Integrate[1, Element[{xa, xb, xc}, reg]]] // Simplify // AbsoluteTiming (*{0.142462, -(1/3) (-3 + L)^3}*)


4

Abs makes this integrand hard to evaluate for the system and it is more straightforward to obtain a numerical integral. Defining first iLT[t_, x_] = InverseLaplaceTransform[1/(1 + s L (s c + (1/R3))), s, t - x]//FullSimplify one can see that it takes vary small values in the interesting region and in order to avoid false numerical integration we specify ...


3

When Plot is too slow, I fall back on a Table and a ListLinePlot which means you can control how many points to plot: u = 230*Sqrt[2]; ω = 2*Pi*50; Φ = Pi/46; L = 45*10^(-7); c = 59*10^(-6); R3 = 1/10; ilt = InverseLaplaceTransform[1/(1 + s*L*(s*c + (1/R3))), s, τ]; intg[t_?NumericQ] := NIntegrate[Abs[u*Sin[ω*x + Φ]]*(ilt /. {τ -> t - x}), {x, 0, t}]; ...


4

it is having hard time with exact integral. Replace with numerical. Clear["Global`*"]; u = 230*Sqrt[2]; ω = 2*Pi*50; Φ = Pi/46; L = 45*10^(-7); c = 59*10^(-6); R3 = 1/10; tmp = InverseLaplaceTransform[1/(1 + s*L*(s*c + (1/R3))), s, t - x]; Integrand = Abs[u*Sin[ω*x + Φ]]*tmp; f[t_?NumericQ] := NIntegrate[Integrand, {x, 0, t}] ...


1

The transformation can be calculated once outside (before) the plot. Replace InverseLaplaceTransform with its result and use NIntegrate instead of Integrate. Then the plot will be done in a few seconds. Andreas


1

If you you only need a numerical result for given L try int[L_?NumericQ] :=NIntegrate[ Boole[Abs[xa] < 1] Boole[Abs[xa - xb] < 1] Boole[ Abs[-L + xb] < 1] Boole[Abs[xa - xc] < 1] Boole[ Abs[-L + xc] < 1], {xa, L - 2, 1}, {xb, L - 1, 2}, {xc, L - 1,2} ] int[2.5] // AbsoluteTiming (*{0.0222419, 0.0416667}*)


2

This is more of an extended comment than an answer, but it occurred to me that your solution is incomplete. You have a double $Cos$ series in $m$ and $n$, and unlike $Sin$ series you should need $m=0$ and $n=0$ terms. You have computed your $T_{mn}$ series for $(m, n)$ going from $1$ to $\infty$ and it came out to be $0 $. You need to add a $T_{00}$ term ...


4

Try Derivative Plot[ Derivative[1][Sin ][x], {x, 0, 2 \[Pi]}] or Evaluate Plot[Evaluate[D[Sin[x], x]], {x, 0, 2 \[Pi]}]


1

Another way, for "algebraic" equations as opposed to "functional" equations: eqn = x y^2 == Exp[x y]; Dt[y]/Dt[x] /. First@Solve[Dt[eqn], Dt[y]] (* (y (-E^(x y) + y))/(x (E^(x y) - 2 y)) *) It's "algebraic" because y is not expressed explicitly y[x], as a function of x. It was easier to type a random equation because it ...


3

G = n[t] - n0 Exp[b[n[t]] t]; dG = D[G, t] /. {E^(t b[n[t]]) n0 -> n[t]}; solnt = n'[t] /. Solve[dG == 0, n'[t]][[1]] // Simplify $$ \frac{n(t) b(n(t))}{1-t n(t) b'(n(t))} $$


0

Another way that may be no more satisfying. Your f[Exp[z[x, y]], 2 z[x, y] - x - y^2] == 0 can be rewritten as eq = 2 z[x, y] - x - y^2 == g[Exp[z[x, y]]] and Mathematica cannot solve this equation for z. We can take derivatives. D[eq[[1]], x] == D[eq[[2]], x] Solve[%, Derivative[1, 0][z][x, y]]//Flatten dzdx = Derivative[1, 0][z][x, y] /. % (*-(1/(E^z[x, ...


6

$Version (* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *) Clear["Global`*"] expr = (16 Cos[k]^2 Sin[th]^4 + Sin[2 (k)]^2 Sin[2 th]^2)/(16 (-1 + Cos[k]^2 Cos[th]^2)^2); int1[th_] = Integrate[expr, {k, -π + alpha, π + alpha}, PrincipalValue -> True] Adding some Assumptions, int2[th_] = Assuming[{-Pi < th < Pi, ...


7

First: the function can be simplified to 1/(1 + Csc[th]^2 Tan[k]^2). Then you find the antiderivative Integrate[1/(1 + Csc[th]^2 Tan[k]^2), k] Sec[th] (ArcTan[Csc[th] Tan[k]] - k Sin[th]) Tan[th]. The problem with the integral is that it doesn't see the jumps of the ArcTan at the poles of its argument,so it is not continuous. A continuous antiderivative ...


0

I am not sure this is what you want but.. tt = f[Exp[z[x, y]], 2 z[x, y] - x - y^2] (* f(E^z(x,y),2 z(x,y)-x-y^2) *) sol = Solve[{D[tt, x] == 0, D[tt, y] == 0}, {D[z[x, y], x], D[z[x, y], y]}] // FullSimplify // First; sol /. Derivative[a__][f][Exp[z[x, y]], 2 z[x, y] - x - y^2] :> Derivative[a][f][X, Y] /. Exp[z[x, y]] -> Exp[z] // ...


2

If it's just for display, then I think the following is enough: Clear[myD, x] myD[myD[a_, b__], c__] := myD[a, b, c] Format[HoldPattern@myD[a_, b__]] := TraditionalForm@HoldForm@D[a, b] Format[x[a_, b_]] := Subscript[x, a, b] myD[myD[S, x[ν, μ]], x[α, β]] To automate the subsequent calculation, just define myD[a_ + b_, c_] := myD[a, c] + myD[b, c] and ...


4

You do not need numerical guess to find the minimum. Setting both partial derivatives to zero and eliminating variable a is enough. f = Log[a, 4 (3 b - 1)/9] + 8 (Log[b/a, a])^2 - 1 // PowerExpand[#, Assumptions -> {0 < a < 1, 1/3 < b < a}] &; ee1 = (D[f, a] // Together // Numerator) // PowerExpand[#, Assumptions -> {0 < a &...


6

One can use Composition (which should be the true meaning of the product of operators) with (pure) Function: ClearAll[op, ff] ff[j_] := f \[Function] D[f, x] - j f op[n_] := Composition @@ Table[ff[j], {j, n}] op[2][f[x]] // Simplify 2 f[x] - 3 f'[x] + f''[x] Update The version without Apply (@@) (actually Composition can be also replaced by ...


7

Clear["Global`*"] Defining the operator recursively, dOp[func_, x_Symbol, 1] := dOp[func, x, 1] = D[func, x] - func; dOp[func_, x_Symbol, n_Integer?Positive] := dOp[func, x, n] = D[dOp[func, x, n - 1], x] - n*dOp[func, x, n - 1]; For example, dOp[f[x], x, 2] // Expand (* 2 f[x] - 3 f'[x] + f''[x] *) Looking at the first several, Table[{n, ...


3

op[f_, x_, n_] := Block[{d}, Total[MapIndexed[#1*If[#2[[1]] == 1, 1, D[f[x], {x, #2[[1]] - 1}]] &, CoefficientList[Product[d - j, {j, 1, n}], d]]]] op[g, y, 2] gives 2 - 3 g'[y] + g''[y] Update based on your comment: op[f_, x_, n_] := Block[{d}, Total[MapIndexed[#1*D[f[x], {x, #2[[1]] - 1}] &, CoefficientList[Product[d - j, {j, 1, ...


1

The numeric integration confirms the former f = 10^5;u = 1;m = (R1 + R3)/(c*R1*R3);R1 = 100;R3 = 100;n = 100;k = c*R1;c = 100*10^(-9); g[t_?NumericQ] := (NIntegrate[(((((u*Sin[2*Pi*f*x])* Sign[u*Sin[2*Pi*f*x]])/2) + ((u*Sin[2*Pi*f*x])/ 2)))*((Exp[-m*(t - x)])/k), {x, 0, t}])^2/n; f*NIntegrate[g[t], {t, 0, 1/f}] (*0.000187112*) in view of N[...


2

Perhaps this: energy = Interpolation[Transpose@Reverse@Transpose@data, pressure]; pressure = Interpolation[data, energy]; Or this: energy = Interpolation[Transpose[{pressuredata, energydata}], pressure]; pressure = Interpolation[Transpose[{energydata, pressuredata}], energy]; Addendum: Inverting data alternatives (in order of decreasing code length and ...


1

While Erf can be difficult to work with, a simple, straightforward approach seems to work well: ClearAll[Nfunc]; Nfunc[x_] := E^(-x^2/2)/ Sqrt[2*Pi]*(1/ 2 Erf[(x - 0.256048)/Sqrt[2*1.6^2 + 0.231313^2]/Sqrt[2]] - 1/2 Erf[-Infinity/Sqrt[2]]); (* why not -1 instead of Erf[]? *) nume = NIntegrate[x*Nfunc[x], {x, -Infinity, Infinity}] (* 0....


4

Using explicit parameter lists, and immediate assignments: f[{x1_, x2_}] = x1^2 + x2^3; g[{x1_, x2_}] = D[f[{x1, x2}], {{x1, x2}}] (* {2 x1, 3 x2^2} *) If you don't need parameter lists, you can use the parameters directly (without curly braces): f[x1_, x2_] = x1^2 + x2^3; g[x1_, x2_] = D[f[x1, x2], {{x1, x2}}] (* {2 x1, 3 x2^2} *)


Top 50 recent answers are included