Bob Hanlon
• Member for 8 years, 4 months
• Last seen this week
• Clarksville, MD

Clear["Global*"] f[a_, b_] := Log[a, 4 (3 b - 1)/9] + 8 (Log[b/a, a])^2 - 1 min = (FindMinimum[{f[a, b], 1/2 < b < a, 0 < a < 1}, {a, b}, WorkingPrecision -> 20] // N) /....

Clear["Global*"] countries = EntityList@EntityClass["Country", "Europe"]; capitals = #["CapitalCity"] & /@ countries; Manipulate[ Column[{ distance[start, end, UnitSystem -> units], ...

This is a precision issue. $Version (* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *) Since you used a machine precision number (i.e., 0.5) in the integrand, the integration is done with ... View answer 10 votes dataskmc2 = {{9.65827, 0.551402}, {10.2803, 0.602804}, {11.4566, 0.953271}, {12.6648, 1.3972}, {13.8468, 1.13551}, {15.0618, 0.845794}, {16.1433, 0.817757}, {17.4852, 0.981308}, {18.6631, ... View answer Accepted answer 10 votes Generate a sequence using Table then use FindSequenceFunction to find the general form f[n_] = FindSequenceFunction[ Table[Integrate[LegendreP[n, x]^2, {x, -1, 1}], {n, 10}], n] (* 2/(1 + 2 n) *)... View answer Accepted answer 10 votes Clear[RaisedCosineDistribution] As with built-in distributions, you need to include the parameters in the distribution definition, and the constraints on the parameters as Assumptions in the ... View answer 10 votes The correct syntax for a multivariate UniformDistribution is dist = UniformDistribution[{{0, 2*Pi}, {0, 2*Pi}}]; Note that Distributed is \[Distributed] Probability[Cos[X1] + Cos[X2] <= 5, {X1, ... View answer 10 votes Using ImplicitRegion to define regions SeedRandom[1]; array = RandomReal[1, {1000, 2}]; rgn1 = ImplicitRegion[0.4 <= x <= 0.7, {x, y}]; rgn2 = ImplicitRegion[0.4 <= x <= 0.7 && ... View answer Accepted answer 10 votes expr = Log[-t - I w] + Log[-t + I w]; expr // ComplexExpand[#, TargetFunctions -> {Re, Im}] & // Simplify[#, {w > 0, t > 0}] & (* Log[t^2 + w^2] *) View answer 10 votes bin = 1011011; words = (bin // IntegerDigits) /. {1 -> "one", 0 -> "zero"}; (str = StringJoin[Riffle[words, " "]]) // InputForm (* "one zero one one zero one one" *) Speak[str] View answer Accepted answer 10 votes M = 1.876 // Rationalize m = 0.9389 // Rationalize; q = Sqrt[Q2 + ν^2]; E3[p3_] = Sqrt[p3^2 + m^2]; E4[p3_] = Sqrt[p3^2 + q^2 - 2*p3*q*Cos[θ] + m^2]; For p3zero1 and p3zero2 use Set rather than ... View answer Accepted answer 10 votes InverseLaplaceTransform[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4)), s, t] 2*E^t + (3/4)IE^((-1 - 2*I)t) (-1 + E^(4*I*t)) % // ComplexExpand // Simplify 2*E^t - (3*Cos[t]*Sin[t])/E^t % //... View answer Accepted answer 10 votes Table[If[Mod[n!, n^(2 n)] == 0, n], {n, 1, 1000}] /. Null -> Sequence[] {1} Cases[Table[If[Mod[n!, n^(2 n)] == 0, n], {n, 1, 1000}], _?NumericQ] {1} Select[Table[If[Mod[n!, n^(2 n)] == 0, n]... View answer 10 votes f[x_] = Piecewise[{ {1 - x, -1 < x <= 0}, {(1/x + Floor[1/x])/(1 + 1/x + Floor[1/x]), 0 < x < 1}}]; Plot[InverseFunction[f][y], {y, f[1. - 10^-9], f[-1. + 10^-9]}, ... View answer Accepted answer 10 votes Mathematica does not have a rule for the derivative of Abs. Assuming that the term arose from taking the derivative with respect to a then taking the derivative of Abs[1-a] results in D[Abs[1 - a], a]... View answer 9 votes$Version (* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *) Clear["Global*"] Version 12.1.1 also has mismatched FrameTicks on the left and right edges: llp = ListLogPlot[ ...

Clear["Global*"] data = {{-2.5, 0.0}, {-2, 1.1}, {1, 2.1}, {0, 2.5}, {1, 1.9}, {2, 1.1}, {2.5, 0}, {2, -1.3}, {1, -2.2}, {0, -2.5}, {-1, -2.2}, {-2, -1.2}, {-2.5, 0}}; w = {.1, .2, ....

Clear["Global*"] dist[gamma_] := ProbabilityDistribution[Exp[-(x/(2*gamma))] 1/(2*gamma), {x, 0, Infinity}]; The distribution dist is equivalent to the built-in ...

Clear["Global*"] eqns = {a*b == c + d + e, d/f == g*h + i, k == a/c}; With three equations you can solve for one variable while eliminating two others. To Solve for k while eliminating {a,...

Clear["Global*"] h[i_, 0] := 1 h[i_, j_] := ((j - 1)/(i + 1))*h[i + 2, j - 2] Use the recursion to generate a sequence for even values of j seq = {#, h[i, #]} & /@ Range[0, 10, 2] (* ...

Space for the legend is available at the upper left ListPlot[{ {2, 5, 2, 8, 6, 8, 3}, {1, 2, 5, 2, 3, 4, 3}}, PlotMarkers -> {"✶", 15}, Joined -> True, PlotStyle -> {Orange, ...

Clear["Global*"] Defining the sum recursively: LegendreQ[n, Sqrt[2]/2]/(n + 1) /. n -> 0 // Simplify (* 1/2 Log[3 + 2 Sqrt[2]] *) sum[0] = Log[3 + 2 Sqrt[2]]/2.020; sum[m_Integer?...

Clear["Global*"] A[n_Integer?Positive] := DiagonalMatrix[Range[n], 1, n + 1] A /@ Range[2, 4]//Column

For 2 or 3 dimensions: Clear["Global*"] eqnsFromMatrix[m_?MatrixQ, b_?VectorQ] := Block[ {x, n = Length@m, var, eqns, pt = LinearSolve[m, b], min, max, plt, grph}, min = Floor@Min@pt; max ...

The equation for a sphere is x^2 + y^2 + z^2 == r^2 With[{r = 7.5}, ContourPlot3D[r^2 == (x^2 + y^2 + z^2), {x, -10, 10}, {y, -10, 10}, {z, -10, 10}, AxesOrigin -> {0, 0, 0}, PlotRange ->...

The enclosed region is rgn = ImplicitRegion[ -2 Sqrt[x] < y < 2 Sqrt[x] && y > 2 x - 4, {x, y}]; The area is Area[rgn] (* 9 *) or RegionMeasure[rgn] (* 9 *) Which agree ...

Clear["Global*"] f[a_?(# > 0 &)] := Module[{x, m = 1}, x[0] = 1.; x[n_] := x[n] = (x[n - 1] + a/x[n - 1])/2; While[x[m]^2 != a, m++]; x[m]] f[#] - Sqrt[#] & /@ {2, E, Pi, Prime[...

Clear["Global*"] f[n_, x_] := (1/(4 (-1 + x^2)^2)) ((1 - x^2) (-4 π (-1 + x^2) + n (5 - 2 x^2 + x^4)) Cosh[n x] Sinh[π x] + Sinh[n x] ((1 - x^2) (-4 n (-1 + x^2) + π (5 - ...