New answers tagged

1

Two small steps are better than one big step. A simple workaround in 13.0.0 on Windows 10 is as follows. Integrate[1/2*Cos[2*phi]*Sin[phi]^n, {phi, 0, Pi}, Assumptions -> n > 0] + Integrate[1/2*Sin[phi]^n, {phi, 0, Pi}, Assumptions -> n > 0] (Sqrt[\[Pi]] Gamma[(1 + n)/2])/(2 Gamma[1 + n/2]) - ( n Sqrt[\[Pi]] Gamma[(1 + n)/2])/(4 Gamma[2 + n/2])...


3

Here's a way to get the answer by changing the integral by symmetry. Powers of sine and cosine that depend on parameters have always been tricky for Integrate. Not sure why the trick below works and the original fails. Integrate[ Cos[phi]^2*Sin[phi]^n + Sin[phi]^2*Cos[phi]^n, {phi, 0, Pi/2}, Assumptions -> n > 0] (* (Sqrt[π] Gamma[(1 + n)/2])/(2 ...


4

I suggest a workaround f[n_] = Integrate[Sin[phi]^n, {phi, 0, Pi}, Assumptions -> n > 0] FullSimplify[f[n] - f[n + 2]] $$\frac{\sqrt{\pi } \Gamma \left(\frac{n+1}{2}\right)}{2 \Gamma \left(\frac{n}{2}+2\right)}$$ Another way of calculating the integral FullSimplify[ Integrate[Cos[phi]^2*Sin[phi]^n, {phi, 0, Pi/4, Pi}, Assumptions -> n > 0]] ...


2

This seems to work: res = Integrate[Cos[phi]^m*Sin[phi]^n, {phi, 0, \[Pi]}] /. m -> 2 N[Table[{NIntegrate[Cos[phi]^2*Sin[phi]^n, {phi, 0, Pi}], res}, {n, 1, 6}]] (* {{0.666667, 0.666667}, {0.392699, 0.392699}, {0.266667, 0.266667}, {0.19635, 0.19635}, {0.152381, 0.152381}, {0.122718, 0.122718}} *)


0

OK in version 13.0.0 on Windows 10 D[Integrate[(1 + t^4)^(-1/2), {t, x^2, x^3}], x] ConditionalExpression[(-1)^( 1/4) ((2 (-1)^(3/4) x)/(Sqrt[1 - I x^4] Sqrt[1 + I x^4]) - ( 3 (-1)^(3/4) x^2)/(Sqrt[1 - I x^6] Sqrt[1 + I x^6])), And[ Or[Im[x] >= 0, Re[x^8 (x - Im[x])^4 (-1 + Im[x])^(-4)] >= -1], Or[Re[(1 - x)^(-1) x] < -1, Re[(1 - x)^(-1) x] >= ...


7

I get the same in V13. It looks like a bug to me. However, if I request order 11, I get order 1: ClearAll[a, b, c, e, x]; b[x_] := (a + e)^c[x]; v1 = Normal[Series[Integrate[b[x], x], {e, 0, 11}]] v2 = Integrate[Normal[Series[b[x], {e, 0, 1}]], x] I do not understand why.


1

Your problem is that Integrate evaluated before the derivative could be taken, making the output much more complicated. I think the cleanest approach is to use Inactive, e.g.: D[Inactive[Integrate][(1+t^4)^(-1/2), {t, x^2, x^3}], x] -((2 x)/Sqrt[1 + x^8]) + (3 x^2)/Sqrt[1 + x^12]


9

$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[ Table[{x, x^-10}, {x, 1, 5}], GridLines -> Automatic, Frame -> True] Looking at the FrameTicks option values: Cases[llp, HoldPattern[FrameTicks -&...


1

The reason for undesirable filling and rasterization on Export is that the points are partially reversed, what results in a polygon with self-intersections. Fixing this: g3 = Graphics[{Opacity[0.5], Red, Polygon[Join[data[[;; 251]], Reverse@data[[252 ;;]]]]}, Frame -> True]; Export["sector.pdf", g3] // SystemOpen The file is exported in ...


2

After looking into the implementation of DateInterval, it seems this is indeed a bug in the internal conversion between numerical representation of a DateObject and its standard form. When converting the ending timestamp of a numerical interval to a DateObject, the granularity should be deducted for a correct offset: ResourceFunction[ "...


1

That's the edge you see if you plot Line@data. Workaround: reg = CanonicalizePolygon[Polygon@data] g3 = Graphics[{Opacity[0.5], Red, reg, } , Frame -> True ] Export["C:/sector.pdf", g3]


5

Numerically solving, Needs["NumericalCalculus`"] lim = NLimit[Sum[Sqrt[-i^2 + n^2]/n^2, {i, 1, n}], n -> Infinity, WorkingPrecision -> 15] (* 0.785398 *) RootApproximant[lim/Pi]*Pi (* π/4 *)


8

In 13.0.0 on Windows 10 AsymptoticSum[Sqrt[-i^2/n^2 + 1]/n, {i, 1, n}, n -> Infinity] Pi/4 It should be noticed that AsymptoticSum[Sqrt[-i^2 + n^2]/n^2, {i, 1, n}, n -> Infinity] returns the input.


4

Try midpoint discretization x=1/(2n)+i/n, i,1,n-1: dx = 1/n; Sqrt[1 - x^2] dx /. x -> dx/2 + i dx // FullSimplify (*Sqrt[1 - (1 + 2 i)^2/(4 n^2)]/n*) Unfortunately Mathematica can't solve the limit Limit[Sum[Sqrt[1 - (1 + 2 i)^2/(4 n^2)]/n , {i,1, n - 1}], n -> Infinity] but numerically evaluation gives expected result ~Pi/4 Table[{n,NSum[Sqrt[1 - (...


4

This is a bug and I'll explain the details in a minute. I think the best way forward is to directly set up the PDE coefficients and use the implementation of NDEigensystem that was discussed here. My (current) understanding is that the culprit is the conservative convection term. This can easily be checked if one just omits that term there is no message and ...


14

I reproduce the issue with version 13.0.0 on Windows 10 x64. Apparently, the issue arises due to a non-default value of ImageResolution option of img: Options[img, ImageResolution] {ImageResolution -> {96., 96.}} Setting this option to Automatic: Show[Image[img, ImageResolution -> Automatic], Axes -> True] Options[%, PlotRange] {PlotRange -> {...


2

It seems be a bug. By now we have to solve it manually. poly = {{-(49/10), 266/5, 43/2}, {-(89/10), 47, 43/2}, {-(54/5), 85/2, 43/2}, {-(62/5), 217/5, 43/2}, {-(88/5), 499/10, 43/2}, {-(183/10), 487/10, 43/2}, {-(211/10), 221/5, 43/2}, {-(17/10), 162/5, 43/2}, {69/10, 459/10, 43/2}, {-(22/5), 53, 43/2}}; line = {{-7, 100, 42}, {0, 15, 10}}...


0

It seems that Automatic Legends for ArrayPlot still need some work in v-13.0.0


0

For those interested, here is a workaround using matplotlib of Python. import numpy as np import matplotlib.pyplot as plt mm = 1 / 25.4 #Array size nx = 10 ny = 40 #Cell size cx = 20*mm cy = 6*mm #relative position (left-center justified) of text in cell npx = 0.25 npy = 0.7 plt.figure(figsize=(cx*nx, cy*ny)) for x in (np.arange(nx)+1): for y in (np....


3

First of all, as chuy correctly points out in the comments, you should set PrintingStyleEnvironment to "Working" in order to avoid magnification problems discussed here: SetOptions[$FrontEndSession, PrintingStyleEnvironment -> "Working"] Then, I suggest to use Grid instead of GraphicsGrid (the value -.11 is found by trial and error): ...


11

It looks like this is a bug to me. Based on david's comment and Michael's answer, we see: TracePrint[ ToBoxes @ Graphics[ AxisObject[ Line[{{0, 0}, {10, 10}}], {0, 10}, TickPositions -> {{0, 10, 2}, {1, 9, 2}}, TickLabels -> {All, All} ] ], _System`Dump`formatTickLabelSet, ...


8

On my Mac, @kglr's fix shows an error that can be fixed by executing the menu command Cell > Show Expression twice after selecting the output cell. Here is another way to fix the problem, which is that the TickLabels option as created by MakeBoxes[] is TickLabels -> {Automatic, Automatic} instead of TickLabels -> {All, All}: Graphics[ AxisObject[...


6

A work-around: use TickLabels -> Full (or TickLabels -> {All, Full}) Graphics @ AxisObject[Line[{{0, 0}, {10, 10}}], {0, 10}, TickPositions -> {{0, 10, 2}, {1, 9, 2}}, TickLengths -> {.5, .3}, TickLabelPositioning -> {"Base", "Tip"}, TickLabels -> Full] $Version "13.0.0 for Linux x86 (64-bit) (...


9

I think you've found a bug! I think different parts of Mathematica deal with Tube differently. Note that DiscretizeRegion thinks Tube is degenerate: evaluate DiscretizeRegion[Tube[]] for an error message. This suggests to me the reason for the mixing of areas and lengths in the Area output—some kind of degeneracy. (By the way, it's not only Area that doesn't ...


7

Obviously a bug. (If I guess it right, it's introduced in v12.2 together with this bug. ) v9.0.1 gives the desired result: A possible fix is turning to the method mentioned here: Unprotect@LaplaceTransform; LaplaceTransform[(h : Plus)[a__], t_, w_] := LaplaceTransform[#, t, w] & /@ h[a] Protect@LaplaceTransform;


0

I found an effective solution in this answer: https://mathematica.stackexchange.com/a/257388/82311 CurrentValue[$FrontEnd, FrontEnd`FrontEndObjectFormat] = "Legacy" Thanks to josh and Kuba. In fact, we can find this "NotebookObject and CellObject now use a UUID string instead of specific FrontEndObject values" in incompatible changes of ...


2

This is not an answer. $Version "12.2.0 for Microsoft Windows (64-bit) (December 12, 2020)" Let me recreate what I am seeing on my machine: fun = 2 x + 34 x^2 - 5 y + 4 y^3; TreeForm[fun] {fun[[1]], fun[[2]], fun[[3]], fun[[4]]} {2 x, 34 x^2, -5 y, 4 y^3} GraphicsRow[{Plot[fun[[1]], {x, -10, 10}] , Plot[Evaluate@fun[[1]], {x, -10, 10}] }]...


17

Yep, it's a simple mistake by WRI, that is, a bug. GeometricTest[{Circle[{x0, y0}, {a, b}], InfiniteLine[{{x1, y1}, {x2, y2}}]}, {"Tangent", {x1, y1}}] (* Exists[{C[1]}, x0 + a*Cos[C[1]] == x1 && y0 + b*Sin[C[1]] == y1 && b (x0 - x1) (x1 - x2) + a (y0 - y1) (y1 - y2) == 0 && a > 0 && b &...


1

I notice that some changes in the behavior of SelectionMove occurred on the transition from version 12.3.1 to 13.0.0. Changed the behavior of SelectionMove[EvaluationCell[], Previous, CellGroup]. Now it selects the previous CellGroup, even if between the previous CellGroup and the EvaluationCell[] present several cells which aren't a member of a CellGroup. ...


6

The procedure of DSolve Where the OP solves for C[1] in the by-hand solution ($ {1}/{\sqrt{y}} = x +1+c_{1} e^{x}$), DSolve first solves for $y$ -- its process is get the general solution if possible; then specialize to the BCs. Solving for $y$ squares both sides of the equation, introducing an extraneous solution. You could say DSolve flunks 8th grade ...


6

Sometimes DSolve has problems with Sqrt. If you substitute Sqrt[y[x]]->z[x] the new ode ode = Simplify[Derivative[1][y][x] == 2 (-1 + x Sqrt[y[x]]) y[x] /.y -> Function[x, z[x]^2] , z[x] > 0] (*x z[x]^2 == z[x] + Derivative[1][z][x]*) is easily and correctly solved: DSolve[{ode,z[0]==1}, z,x] (*{{z -> Function[{x}, 1/(1 + x)]}}*) Hope it helps!...


0

To me it looks like under 12.3, DSolve, when given initial conditions, is returning two solutions because Mathematica is treating $\sqrt{y}$ in the DE as multi-valued. This to me is the more general solution. The solution $y_1(x)=\frac{1}{(1+x)^2}$ satisfies the IVP: $$y'=2y(x\sqrt{y}-1); y(0)=1 $$ and the solution $y_2(x)=\frac{1}{(-1+2e^x-x)^2}$ ...


5

Here is my explanation. Mathematica 13.0.0 correctly solves DSolve[{y'[x] == 2*y[x]*(x*Sqrt[y[x]] - 1)}, y, x] {{y -> Function[{x}, 1/(1 + x + E^x C[1])^2]}} , but does not take into account that this is a true solution under the condition 1 + x + E^x C[1]>=0 only: y'[x] - 2*y[x]*(x*Sqrt[y[x]] - 1) /. {{y -> Function[{x}, 1/(1 + x + E^x C[1])^2]}}...


4

$Version (* "13.0.0 for Mac OS X x86 (64-bit) (December 3, 2021)" *) Clear["Global`*"] Cl6[x_] := Im[PolyLog[6, Exp[I x]]] Cl6[1/10^14] // N (* 1.03693*10^-14 *) As you indicated the limit is zero Limit[Cl6[x], x -> 0] (* 0 *) For very small real arguments, use Asymptotic Cl6A[x_] = Asymptotic[Cl6[x], {x, 0, 3}] // Simplify[#, ...


Top 50 recent answers are included