# Tag Info

14

ResourceFunction["RainbowText", "Definition"]

11

FindFormula has an undocumented option Method, its possible values can be printed by the following code: sym = First@Names@"*iFindFormula" Begin[Context@#&@sym]; Keys[#][[1,2]] & /@ Rest@DownValues@#&@Symbol@sym End[]; With my Mathematica 12.2.0.0, it gives: { Automatic, "NonLinearRegression", {"SimulatedAnnealing&...

9

You can see why when you break it up. Since you use 1.1 then Mathematica evaluated it numerically. Compare v = 1 + I a = Abs[v] b = Exp[I Arg[v]] a*b With v = 1.10 + I a = Abs[v] b = Exp[I Arg[v]] a*b You see that Exp[I Arg[v]] now is 0.73994 + 0.672673 I To keep things nice, as your first example, use exact number v = 11/10 + I a = Abs[v] b = Exp[I Arg[...

9

I think your assumption is that $y\in \mathbb{R}$ is real, so you can put it as the condition (otherwise it is assumed to be complex): SolveValues[ Sin[2π x]+Sin[2π/y]==0&& Cos[2π x]-Cos[2π/y]==0&& y∈Reals ,x]//FullSimplify So after FullSimplify you get 2 answers that you are looking for: $\begin{array}{l} \fbox{$-\frac{1}{y}+2 c_1\text{ if ...

8

The reason that the second code snippet in the OP doesn't evaluate to zero is because ArcTan[x, y] is not the same as ArcTan[y/x] for every choice of x and y. This is explained in the documentation for ArcTan: it matters which quadrant the points $(x,y)$ is in. To see this, notice: Plot[{ ArcTan[Cos[(2 π)/y], -Sin[(2 π)/y]]/(2 π), ArcTan[-Sin[(2 π)/y]/...

6

eq[x_] = (\[Pi] - 2 x)^2 Sin[\[Pi]^2/(-2 \[Pi] + 2 x) + 1/2 ArcCsc[(4 \[Pi] (\[Pi] - x) Csc[\[Pi]^2/(-\[Pi] + x)])/(\[Pi]^2 + 4 (\[Pi] - x)^2)]] + (3 \[Pi] - 2 x)^2 Sin[ 1/2 (\[Pi] (4 + \[Pi]/(\[Pi] - x)) + ArcCsc[(4 \[Pi] (\[Pi] - x) Csc[\[Pi]^2/(-\[Pi] + x)])/(\[Pi]^2 + 4 (\[Pi] - x)^2)])] ...

5

Well, I guess it is a shorthand for this elaborate function which I got by evaluating your expression in Mathematica on my desktop. (1/n!)DifferenceRoot[ Function[{\[FormalY], \[FormalN]}, {-\[FormalY][\[FormalN]] + (5 + 2 \[FormalN]) \[FormalY][ 1 + \[FormalN]] + (-10 - 6 \[FormalN] - \[FormalN]^2) \[FormalY][ 2 + \[...

5

expr = X[1, 2, 3, 5] + X[2, 4, 5, 6] expr /. {5 -> 4, 6 -> 5} (* X[1, 2, 3, 4] + X[2, 4, 4, 5] *) Note that the order of the rules doesn't matter, here; according to the documentation for ReplaceAll (which is the function underlying the /. infix), ReplaceAll looks at each part of expr, tries all the rules on it, and then goes on to the next part of ...

4

Alternatively, you could use "ResourceFunctionDefinitionViewer", to open a new notebook showing the implementation: ResourceFunction["ResourceFunctionDefinitionViewer"][ResourceFunction["RainbowText"]]

4

If you have the two lines separately like this, you can use sampled audio to turn each Sound into a waveform. Then you can simply add the two waveforms together to "mix" them. rh = Sound@MapThread[SoundNote[#1, #2, "Piano"] &, {note1, time1}] lh = Sound@MapThread[SoundNote[#1, #2, "Piano"] &, {Join[ConstantArray[None,...

4

You probably need conditions on d: f[p_, x_] := Piecewise[{{p*Exp[-x], 0 < x}, {(1 - p) Exp[x], x < 0}}, 0]; Integrate[x^d f[p, x], {x, -Infinity, Infinity}, Assumptions -> d > -1] seems to work fine.

4

This expression has infinitly many roots. A plot implies, roots are at rational multiples of Pi. f = (\[Pi] - 2 x)^2 Sin[\[Pi]^2/(-2 \[Pi] + 2 x) + 1/2 ArcCsc[(4 \[Pi] (\[Pi] - x) Csc[\[Pi]^2/(-\[Pi] + x)])/(\[Pi]^2 + 4 (\[Pi] - x)^2)]] + (3 \[Pi] - 2 x)^2 Sin[ 1/2 (\[Pi] (4 + \[Pi]/(\[Pi] - x)) + ArcCsc[(4 \[Pi] (\[Pi] - ...

3

As noted in the comments, this is a DifferenceRoot object. If you click on the oblong, you get a few more details: What this means is that the denominator $y(n)$ satisfies the relationships $$(n+3) y(n+3) - (n^2 + 6n + 10) y(n+2) + (2n+5) y(n+1) - y(n) = 0 \\ y(1) = 2 \qquad y(2) = \frac{7}{2} \qquad y(3) = \frac{26}{3}.$$ These relations are sufficient ...

3

Is your motivation to reduce the amount of typing do you need to do? I assume you are already aware of solutions such as (f[#] + a*# + g[#])& @ x, mentioned in the comments. If so, my advice is not to try to do this. Mathematica is a programming language. It needs to be understood first by computers, not humans. Thus, it needs to be precise and ...

2

Normally I'd use SolveAlways, but unfortunately that will not always work. For instance: SolveAlways[u*Cos[x]^2 + v*Sin[x]^2 == 1, x] (* {{}, {u -> v + Sec[x]^2 - v Sec[x]^2}, {v -> 1}} *) _ Another way is to do a minimization of the total square difference (or could be Abs difference) between your linear combo and the target function. This actually ...

2

You can treat the resource as an object rather than a function in order to make meta-queries: ResourceObject["RainbowText"]["Properties"] {"AllVersions", "AutoUpdate", "Categories", "ContributorInformation", "Definition", "DefinitionNotebook", "DefinitionNotebookObject&...

2

It is recommended to act another way around. For example, below I use the equation a b + c d - e f == 0 to express one or another parameter in order to then substitute it to the expression under simplification: sol1 = Solve[a b + c d - e f == 0, c][[1, 1]] sol2 = Solve[a b + c d - e f == 0, a][[1, 1]] sol3 = Solve[a b + c d - e f == 0, d][[1, 1]] (* c ->...

2

Have fun: Manipulate[ (Table[If[ CoprimeQ[i, target], Style[Framed[i], Red, 20], Style[i, Lighter@Gray, 20] ], {i, 1, 100}] // Partition[#, 10] & // Grid[#, ItemSize -> {3.5, 3.5}, Frame -> All] &), {{target, 50, "Coprime with"}, 1, 100, 1}, ContentSize -> {600, 600} ]

2

Clear["Global*"] \$Version (* "12.3.1 for Mac OS X x86 (64-bit) (June 19, 2021)" *) SortBy[Range[100], -GCD[#, 24] &] (* {24, 48, 72, 96, 12, 36, 60, 84, 8, 16, 32, 40, 56, 64, 80, 88, 6, \ 18, 30, 42, 54, 66, 78, 90, 4, 20, 28, 44, 52, 68, 76, 92, 100, 3, 9, \ 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75, 81, 87, 93, 99, 2, 10, \ ...

2

Notice use of parentheses on line 1 and also on line 4. MatrixForm outputs cannot be used in computations. (A[1] := {{0, 0}, {0, 0}}) // MatrixForm; identity := {{1, 0}, {0, 1}}; A[n_] := KroneckerProduct[identity, A[n - 1]]; (A[2]) // MatrixForm \begin{array}{cccc} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 ...

2

another alternative is to use meshgrid ClearAll[f, x, y]; f[x_, y_] := Sin[Pi*x/3]*Sin[Pi*y/3]; meshgrid[x_List, y_List] := {ConstantArray[x, Length[x]], Transpose@ConstantArray[y, Length[y]]} {xx, yy} = meshgrid[Range[0, 15, .5], Range[0, 15, .5]]; u = f[xx, yy]; pts = Flatten[{xx, yy, u}, {2, 3}]; ListPlot3D[pts, PlotRange -> All, AxesLabel -> ...

1

The following code seems to work: Unprotect[Power]; Power[0, 0] = 1; Protect[Power]; Unprotect[Log]; Log[0, x_] = Power[0, x]; Protect[Log];

1

Plotting f suggests that it has very many, if not an infinite number of zeros. Plot[f, {x, 0, Pi}, PlotPoints -> 10000, ImageSize -> Large, AxesLabel -> {x, "f"}, LabelStyle -> {15, Bold, Black}] Plot[f, {x, 3, Pi}, PlotPoints -> 100000, ImageSize -> Large, AxesLabel -> {x, "f"}, LabelStyle -> {15, Bold, ...

1

Your vars is a list of 40 element, so, given your expression involves quadratic powers of some variables, CoefficientList appears to generate 40-folded list with too many elements (5566277615616, to be precise). So you run out of memory. Meanwhile, most of those elements are zeros (except 36 elements). Use CoefficientRules instead. In particular, Last/@...

Only top voted, non community-wiki answers of a minimum length are eligible