calculus and analysis – How does Mathematica obtain this result?

 Sqrt(2 (Pi)) InverseFourierTransform(1/(x^2 - a^2), x, p), 
 Element(a, Reals))

Gives the output

-(((Pi) Sign(p) Sin(a p))/a)


$int_{-infty }^{infty } frac{e^{-i k x}}{x^2-a^2} , dx$ is not a defined integration. Mathematica also returns undefined as answer if you compute it.

So, I am trying to understand how does Mathematica calculates that Fourier transform of the non-integrable function.

plotting – Solid Ellipsoids – Mathematica Stack Exchange

I’m using th following way to produce solid spheres for random microstructures. I’m trying to find a way to produce solid ellipsoids with the same way. Does anyone have any idea?

Centers ,X, have produced by an algorithm and they have an array structure.enter image description here

    centers = X;
unitball[c_, x_] := EuclideanDistance[c, x] <= r;
regs = Show[
     unitball[#, {x, y, z}], {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, 
     Mesh -> False, Boxed -> False, Axes -> False, 
     PlotPoints -> 100] & /@ centers]

Bug in Transpose in Mathematica 12.2?

*In(1)=* Transpose({a, b})

returned in earlier versions of Mathematica (e.g Mathemtica 12.1) simply

*Out(1)=* Transpose({a, b})

together with the warning: “Transpose::nmtx: The first two levels of {a,b} cannot be transposed.”

However in Mathematica 12.2 (on Windows10) the output is:

*Out(1)=* {a,b}

The Transpose has disappeared. Is this a bug or a feature?

For me, it is problem, because this new behavior is breaking my existing code, where I have functions similar to:

getfromdatabase(expr_):=expr/. key_String :>  getfromdatabase(key)

In previous versions (<12.2) users of my code could execute

getfromdatabase( Transpose({"firstname, "lastname", "salary"-"rent"}) )

and the output was for example:

{ {David, Smith, somenumber}, {Lisa, Garbo, someothernumber}, ... }

Now, in 12.2, one gets:

{ {David, Lisa,...}, {Smith, Garbo, ...}, {somenumber, someothernumber, ...}}

How can I change getfromdatabase to get back the old output using the same input as before?
(Sure, in the example above, one could apply Transpose after calling the function. But in other calls there might be calls of Transpose more nested inside the expression, like getfromdatabase( Transpose({"firstname, "lastname", Transpose({"salary","rent"})) ))

equation solving – Is it possible to ask Mathematica to give all the roots of the given function?

sol = x /. Solve(36 Cos((3 x)/4) Cos((27 x)/20) (Cos((3 x)/5) + 2 Cos((21 x)/10)) == 0&& 0 < x < 4 Pi)

Plot(36 Cos((3 x)/4) Cos((27 x)/20) (Cos((3 x)/5) + 
    2 Cos((21 x)/10)), {x, 0, 4 Pi}, 
 Epilog -> {Red, 
   Point(Transpose({sol, ConstantArray(0, Length@sol)}))})

enter image description here

enter image description here

If you desire only roots that are rational multiples of Pi, you can use (among many other ways):

Select(sol, #/Pi (Element) Rationals &)

graphics – How can I ask mathematica to fill in small marginal area in regionplot3d?

I am stuck at how to fill in some marginal area in my regionplot3d. Here is my code.

RegionPlot3D[y >= -11, {x, 200, 1000}, {y, -11, -7}, {z, -11, -8}, 
 PlotRange -> All, ViewPoint -> {0, 0, [Infinity]}, Mesh -> None, 
 BoundaryStyle -> None, Axes -> {True, True, False}, LabelStyle -> 14,
  AxesLabel -> {Style["Mass", Black, Bold, FontSize -> 14], 
   Style[Rotate["Factor", [Pi]/2], Black, Bold, FontSize -> 14], 
   None}, Ticks -> Automatic, PlotStyle -> Opacity[0.25, Blue], 
 TicksStyle -> Directive[Black, Bold, Thick], 
 AxesStyle -> Directive[Thick], AspectRatio -> 1, ImageSize -> 450, 
 Boxed -> False, FaceGrids -> {{0, 0, 1}, {0, 0, -1}}]

Compiling the code, it gives this image.

enter image description here

Here, what I want to know is how can I fill in some small white space appearing between blue boundary line to its closest axis. In other words, I would like to colour the whole space by blue. Any help would be very thankful.

Slice cylinder as region – Mathematica Stack Exchange

I am trying to slice a cylinder, and plot as a region, so I can apply a colour funtion like so:

enter image description here

RegionPlot3D({(x - 1)^2 + y^2 < 1 && x <= z}, 
{x, 0, 2}, {y, -1, 1}, {z, 0, 2}, 
ColorFunction -> (LABColor(1 - #3/2, #1 - 1, #2) &), 
 ColorFunctionScaling -> False, Mesh -> None, Boxed -> False, 
 Axes -> False, PlotPoints -> 100)

However, I cant seem to rotate the colour function or the cylinder region. I looked here but can’t seem to apply it to this problem.

Ideally, I’d like to slice it with the plane as the variable, rather than altering the colour function or the cylinder, like so

enter image description here

I was wondering if I should use Boole or RegionIntersection, but haven’t had any luck so far.

Vertical cross sections should look something like this

enter image description here

which I created with a different methd:

labcross(n_, div_, div1_, div2_) := 
Flatten /@ 
Thread(Join({Transpose(Reverse(Reverse /@ #)), 
Reverse(Table(LABColor(u, #, #2) & @@ {0, 0}, 
{u, 1/div1, 1, 1/div1})), 
Reverse(Transpose(#2))}) & @@ 
Table(Table(Table(LABColor(u, #, #2) & @@ 
N@(v RotationMatrix(2 Pi x/div) . {1, 0}), 
{u, 1/div1, 1, 1/div1}), {v, 1/div2, 1, 1/div2}), 
{x, {n, div/2 + n}}));

With({n = 3}, Grid(Partition(
ArrayPlot(labcross(#, 2 n, 50, 25), Frame -> False, 
ImageSize -> 300) & /@ Range@n, 3)))

group theory – Solving abstract factorization problem with Mathematica

I’m a Mathematica newbie.

Given something like:

$$(r_0 + r_1 a + r_2 a^2 + r_3 a^5)(r’_0 + r’_1b + r’_2 b^2 + r’_3 b^5) = 1 – a^5 b^5$$

I’d like to determine if there exist $r_i,r’_i$ that solve the equation. This is a specific version of the general problem, so what I’d like to be able to do, is have Mathematica Expand the equation on the left, set like terms equal to each other (so $r_3r’_3 a^5b^5 = a^5b^5$ in the above example.) and solve the resulting system of quadratic equations, or at least, determine if a solution exists.

Any help is appreciated. Calling Simplify and Expand doesn’t resolve the equations into the form I’d like Mathematica to write them in, and as for solve systems of quadratic equations, I’ve seem some suggestions, but nothing that seems like it would scale.

Function definition is giving“`$Failed“` – Mathematica Stack Exchange

I am trying to define the function zz() as follows:

cnot = ({
    {1, 0, 0, 0},
    {0, 1, 0, 0},
    {0, 0, 0, 1},
    {0, 0, 1, 0}
rz((Theta)_) := ({
   {E^(-I ((Theta)/2)), 0},
   {0, E^(I ((Theta)/2))}
zz((Gamma)_) := 
 cnot.KroneckerProduct(IdentityMatrix(2), rz((Gamma))).cnot

I am getting the following error.