       Re: FullSimplify and HypergeometricPFQ

• To: mathgroup at smc.vnet.net
• Subject: [mg72078] Re: FullSimplify and HypergeometricPFQ
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Mon, 11 Dec 2006 04:54:51 -0500 (EST)
• References: <ele6ht\$rlg\$1@smc.vnet.net><elglfo\$h5a\$1@smc.vnet.net>

```I think someone else will be more helpful but I still believe that it
is very hard
for someone with no special knowledge of Computer Science to understand
what is "going on" in the Trace outputs.

You can make sense of some parts if you have the courage to see all the
"mess" but for more things...

Let's investigate something more down to earth than Hypergeometric's (I
just have basic knowledge of them so I can't follow you in a email
communication!);
the solution of the cubic equation
(see http://mathworld.wolfram.com/CubicFormula.html
and
and http://math.fullerton.edu/mathews/c2003/CubicEquationBib.html )

We will see the reduced cubic equation.

The solution is provided by Cardan's formula and of course Mathematica
knows it!

Solve[x^3 + p*x + q == 0, x]
Simplify[x^3 + p*x + q == 0 /. %%]
{{x -> -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) +
(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))}, {x -> ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))},
{x -> ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}}
{True, True, True}

Copy/paste the following in a notebook to see how the Vieta's method
provides the roots of the cubic; that is we use Mathematica to do the
hand job!
When you will go to paste it choose Paste As->Formated Text. Then in
the open dialogue box press Yes!

Cell[BoxData[{
RowBox[{
"\[IndentingNewLine]",
RowBox[{"SetOptions", "[",
RowBox[{
RowBox[{"SelectedNotebook", "[", "]"}], ",",
RowBox[{"StyleDefinitions", "->", "\"\<DemoText.nb\>\""}]}],
"]"}], "\[IndentingNewLine]",
RowBox[{"Clear", "[", "\"\<Global`*\>\"", "]"}],
"\[IndentingNewLine]",
RowBox[{"Off", "[",
RowBox[{"N", "::", "meprec"}], "]"}], "\[IndentingNewLine]",
RowBox[{"Off", "[",
RowBox[{"General", "::", "spell1"}], "]"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<creation of a general cubic
equation\>\"", "]"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Plus", "@@",
RowBox[{"Table", "[",
RowBox[{
RowBox[{
SubscriptBox["a", "i"],
SuperscriptBox["z", "i"]}], ",",
RowBox[{"{",
RowBox[{"i", ",", "0", ",", "3"}], "}"}]}], "]"}]}],
"\[Equal]", "0"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<set \!\(a\_3\)\[Congruent]1, a generic
cubic equation\>\"", "]"}], ";",
RowBox[{"gencub", "=",
RowBox[{"%", "/.",
RowBox[{
SubscriptBox["a", "3"], "\[Rule]", "1"}]}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<set z\[Congruent]y-\[Lambda]  \>\"",
"]"}], ";",
RowBox[{"%", "/.",
RowBox[{"z", "\[Rule]",
RowBox[{"y", "-", "\[Lambda]"}]}]}]}], "\[IndentingNewLine]",

RowBox[{
RowBox[{"Print", "[", "\"\<expand last equation\>\"", "]"}], ";",

RowBox[{"Expand", "/@", "%"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<collect the terms\>\"", "]"}], ";",
RowBox[{
RowBox[{
RowBox[{"Collect", "[",
RowBox[{"#", ",", "y"}], "]"}], "&"}], "/@", "%"}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<coefficient of the quadratic
term\>\"", "]"}], ";",
RowBox[{
RowBox[{
RowBox[{"Coefficient", "[",
RowBox[{"#", ",",
SuperscriptBox["y", "2"]}], "]"}], "&"}], "/@", "%"}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<this value eliminates the  \!\(y\^2\)
term\>\"", "]"}], ";",
RowBox[{"\[Lambda]val", "=",
RowBox[{"Solve", "[",
RowBox[{"%", ",", "\[Lambda]"}], "]"}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<substitution in the cubic equation in
y of evaluated \[Lambda]\>\"", "]"}], ";",
RowBox[{"%%%", "/.",
RowBox[{"%", "[",
RowBox[{"[", "1", "]"}], "]"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<the reduced cubic equation\>\"",
"]"}], ";",
RowBox[{"redcub", "=",
RowBox[{"%", "/.",
RowBox[{
RowBox[{
SuperscriptBox["y", "3"], "+",
RowBox[{"a_", " ", "y"}], "+", "b_"}], "\[Rule]",
RowBox[{
SuperscriptBox["y", "3"], "+",
RowBox[{"p", " ", "y"}], "+", "q"}]}]}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<set y\[Congruent]t+w/t\>\"", "]"}],
";",
RowBox[{"%", "/.",
RowBox[{"y", "\[Rule]",
RowBox[{"t", "+",
RowBox[{"w", "/", "t"}]}]}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<expand last equation\>\"", "]"}], ";",

RowBox[{"Expand", "/@", "%"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<multiply through by \!\(t\^3\)\>\"",
"]"}], ";",
RowBox[{
RowBox[{
RowBox[{"Expand", "[",
RowBox[{"#",
SuperscriptBox["t", "3"]}], "]"}], "&"}], "/@", "%"}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<collect the terms \[Implies] a sectic
equation in t\>\"", "]"}], ";",
RowBox[{"sect", "=",
RowBox[{
RowBox[{
RowBox[{"Collect", "[",
RowBox[{"#", ",", "t"}], "]"}], "&"}], "/@", "%"}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<the coefficients of t in the sectic
equation in increasing order\>\"", "]"}], ";",
RowBox[{"CoefficientList", "[",
RowBox[{
RowBox[{"%", "[",
RowBox[{"[", "1", "]"}], "]"}], ",", "t"}], "]"}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<the value w=-p/3 eliminates both the
quadratic and the quartic term\>\"", "]"}], ";",
RowBox[{
RowBox[{"MapIndexed", "[",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{"#2", "[",
RowBox[{"[", "1", "]"}], "]"}], "-", "1"}], ",",
RowBox[{"#1", "\[Equal]", "0"}]}], "}"}], "&"}], ",",
"%"}], "]"}], "//",
RowBox[{
RowBox[{"Simplify", "[",
RowBox[{"#", ",",
RowBox[{"{",
RowBox[{
RowBox[{"p", ">", "0"}], ",",
RowBox[{"q", ">", "0"}], ",",
RowBox[{"w", "\[NotEqual]", "0"}]}], "}"}]}], "]"}],
"&"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Cases", "[",
RowBox[{"%", ",", "_Equal", ",", "2"}], "]"}], "[",
RowBox[{"[", "1", "]"}], "]"}], "\[IndentingNewLine]",
RowBox[{"Solve", "[",
RowBox[{"%", ",", "w"}], "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<substitution of w\[Congruent]-p/3 in
the sextic equation in t\>\"", "]"}], ";",
RowBox[{"sect", "/.",
RowBox[{"%", "[",
RowBox[{"[", "1", "]"}], "]"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<set \!\(t\^3\)\[Congruent]x \[Implies]
a quadratic equation in x\>\"", "]"}], ";",
RowBox[{"%", "/.",
RowBox[{
SuperscriptBox["t", "n_."], "\[Rule]",
SuperscriptBox["x",
RowBox[{"n", "/", "3"}]]}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<the roots by the qudratic
formula\>\"", "]"}], ";",
RowBox[{"Simplify", "[",
RowBox[{"Solve", "[",
RowBox[{"%", ",", "x"}], "]"}], "]"}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<rearrangement of the roots\>\"",
"]"}], ";",
RowBox[{"%", "/.",
RowBox[{
RowBox[{"(",
RowBox[{"a_", "\[Rule]", "b_"}], ")"}], "\[RuleDelayed]",
RowBox[{"(",
RowBox[{"a", "\[Rule]",
RowBox[{"Expand", "[", "b", "]"}]}], ")"}]}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Map", "[",
RowBox[{
RowBox[{
RowBox[{"#", "/",
SuperscriptBox["18", "2"]}], "&"}], ",", "%", ",",
RowBox[{"{", "7", "}"}]}], "]"}], ";"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<roots of the quadratic equation in x
after rearrangement\>\"", "]"}], ";",
RowBox[{"solsx", "=",
RowBox[{"%", "/.",
RowBox[{
RowBox[{"(",
RowBox[{"a_", "\[Rule]",
RowBox[{"b_", "+", "c_"}]}], ")"}], "\[RuleDelayed]",
RowBox[{"(",
RowBox[{"a", "\[Rule]",
RowBox[{"b", "+",
RowBox[{"18", "c"}]}]}], ")"}]}]}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<solution of the equation \!\(t\^3\)=x
in t\>\"", "]"}], ";",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{
SuperscriptBox["t", "3"], "\[Equal]", "x"}], ",", "t"}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[",
RowBox[{"\"\<substitution of the above determined roots for x
in the last result \[Implies] \>\"", ",", " ",
RowBox[{"StyleForm", "[",
RowBox[{"\"\<superficially \>\"", ",",
RowBox[{"FontSlant", "->", "Italic"}]}], "]"}], ",",
"\"\<six roots for t\>\""}], "]"}], ";", " ",
RowBox[{"solst", "=",
RowBox[{"{",
RowBox[{
RowBox[{"%", "/.",
RowBox[{"solsx", "[",
RowBox[{"[", "1", "]"}], "]"}]}], ",",
RowBox[{"%", "/.",
RowBox[{"solsx", "[",
RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[",
RowBox[{
RowBox[{"-",
FractionBox["q", "2"]}], "\[PlusMinus]",
SqrtBox[
RowBox[{
FractionBox[
SuperscriptBox["p", "3"], "27"], "+",
FractionBox[
SuperscriptBox["q", "2"], "4"]}]]}], "]"}]}],
"]"}], ";",
RowBox[{"solstminus", "=",
RowBox[{"solst", "[",
RowBox[{"[", "1", "]"}], "]"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[",
RowBox[{
RowBox[{"-",
FractionBox["q", "2"]}], "\[PlusMinus]",
SqrtBox[
RowBox[{
FractionBox[
SuperscriptBox["p", "3"], "27"], "+",
FractionBox[
SuperscriptBox["q", "2"], "4"]}]]}], "]"}]}],
"]"}], ";",
RowBox[{"solstplus", "=",
RowBox[{"solst", "[",
RowBox[{"[", "2", "]"}], "]"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<the roots in the form of the Solve
output (i.e. as rules)\>\"", "]"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[",
RowBox[{
RowBox[{"-",
FractionBox["q", "2"]}], "\[PlusMinus]",
SqrtBox[
RowBox[{
FractionBox[
SuperscriptBox["p", "3"], "27"], "+",
FractionBox[
SuperscriptBox["q", "2"], "4"]}]]}], "]"}]}],
"]"}], ";",
RowBox[{"solsyminus", "=",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"y", "\[Rule]", "#"}], "}"}], "&"}], "/@",
RowBox[{"(",
RowBox[{
RowBox[{"t", "-",
RowBox[{"p", "/",
RowBox[{"(",
RowBox[{"3", "t"}], ")"}]}]}], "/.",
"solstminus"}], ")"}]}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[",
RowBox[{
RowBox[{"-",
FractionBox["q", "2"]}], "\[PlusMinus]",
SqrtBox[
RowBox[{
FractionBox[
SuperscriptBox["p", "3"], "27"], "+",
FractionBox[
SuperscriptBox["q", "2"], "4"]}]]}], "]"}]}],
"]"}], ";",
RowBox[{"solsyplus", "=",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"y", "\[Rule]", "#"}], "}"}], "&"}], "/@",
RowBox[{"(",
RowBox[{
RowBox[{"t", "-",
RowBox[{"p", "/",
RowBox[{"(",
RowBox[{"3", "t"}], ")"}]}]}], "/.", "solstplus"}],
")"}]}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<verification for the roots in which we
have choosed the minus sign\>\"", "]"}], ";",
RowBox[{"verminus", "=",
RowBox[{"redcub", "/.", "solsyminus"}]}]}],
"\[IndentingNewLine]",
RowBox[{"Map", "[",
RowBox[{"Expand", ",", "verminus", ",",
RowBox[{"{", "2", "}"}]}], "]"}], "\[IndentingNewLine]",
RowBox[{"Map", "[",
RowBox[{"Together", ",", "%", ",",
RowBox[{"{", "2", "}"}]}], "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<verification for the roots in which we
have choosed the plus sign\>\"", "]"}], ";",
RowBox[{"verplus", "=",
RowBox[{"redcub", "/.", "solsyplus"}]}]}],
"\[IndentingNewLine]",
RowBox[{"Map", "[",
RowBox[{"Expand", ",", "verplus", ",",
RowBox[{"{", "2", "}"}]}], "]"}], "\[IndentingNewLine]",
RowBox[{"Map", "[",
RowBox[{"Together", ",", "%", ",",
RowBox[{"{", "2", "}"}]}], "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<an arithmetic example\>\"", "]"}],
";",
RowBox[{"valpq", "=",
RowBox[{"{",
RowBox[{
RowBox[{"p", "\[Rule]", "3"}], ",",
RowBox[{"q", "\[Rule]", "2"}]}], "}"}]}]}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<minus sign\>\"", "]"}], ";",
RowBox[{"solsyminus", "/.", "valpq"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<substitution and verification\>\"",
"]"}], ";",
RowBox[{
RowBox[{"(",
RowBox[{"redcub", "/.", "valpq"}], ")"}], "/.", "%"}]}],
"\[IndentingNewLine]",
RowBox[{"Map", "[",
RowBox[{"Expand", ",", "%", ",",
RowBox[{"{", "2", "}"}]}], "]"}], "\[IndentingNewLine]",
RowBox[{"Simplify", "[", "%", "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<numerical value with 40 digits
precision\>\"", "]"}], ";",
RowBox[{
RowBox[{"N", "[",
RowBox[{
RowBox[{"solsyminus", "/.", "valpq"}], ",", "20"}], "]"}],
"//", "Chop"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<sorting\>\"", "]"}], ";",
RowBox[{"Sort", "[", "%", "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<plus sign\>\"", "]"}], ";",
RowBox[{"solsyplus", "/.", "valpq"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<substitution and verification\>\"",
"]"}], ";",
RowBox[{
RowBox[{"(",
RowBox[{"redcub", "/.", "valpq"}], ")"}], "/.", "%"}]}],
"\[IndentingNewLine]",
RowBox[{"Map", "[",
RowBox[{"Expand", ",", "%", ",",
RowBox[{"{", "2", "}"}]}], "]"}], "\[IndentingNewLine]",
RowBox[{"Simplify", "[", "%", "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<numerical value with 40 digits
precision\>\"", "]"}], ";",
RowBox[{
RowBox[{"N", "[",
RowBox[{
RowBox[{"solsyplus", "/.", "valpq"}], ",", "20"}], "]"}],
"//", "Chop"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<so we get the same set of roots
regardless which sign we choose; let choose the minus sign\>\"", "]"}],

";", "solsyminus"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<Mathematica's Solve solution\>\"",
"]"}], ";",
RowBox[{"Solve", "[",
RowBox[{"redcub", ",", "y"}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<comparison of LeafCount values\>\"",
"]"}], ";",
RowBox[{"LeafCount", "/@",
RowBox[{"{",
RowBox[{"%%", ",", "%"}], "}"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<so leafcount[solution
procedure]<leafcount[solution procedure]\>\"", "]"}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<let obtain the roots for the initial
varible z\>\"", "]"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"y", "-", "\[Lambda]"}], ")"}], "/.",
RowBox[{"\[Lambda]val", "[",
RowBox[{"[", "1", "]"}], "]"}]}], "/.", "solsyminus"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Print", "[", "\"\<the roots for z in rule format\>\"",
"]"}], ";",
RowBox[{"solsz", "=",
RowBox[{
RowBox[{
RowBox[{"{",
RowBox[{"z", "\[Rule]", "#"}], "}"}], "&"}], "/@",
"%"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"\$PrePrint", "=", "StandardForm"}], ";"}]}], "Input",
CellLabel->"In:=",
CellMargins->{{Inherited, 14}, {Inherited, Inherited}},
TextAlignment->Left,
TextJustification->1]

-------------------------------------------------------------------

Let's see Trace now

Trace[Solve[x^3 + p*x + q == 0, x], TraceInternal -> True]
{{{HoldForm[x^3 + p*x + q], HoldForm[q + p*x + x^3]}, HoldForm[q + p*x
+ x^3 == 0]}, HoldForm[Solve[q + p*x + x^3 == 0, x]],
{HoldForm[Roots[q + p*x + x^3 == 0, x]], {HoldForm[(q + p*x + x^3) +
0], HoldForm[q + p*x + x^3]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]}, {{{HoldForm[I],
HoldForm[I]}, HoldForm[Integrate`\$I -> I],
HoldForm[Integrate`\$I -> I]}, HoldForm[Solve`SolvVar[x] /.
Integrate`\$I -> I], HoldForm[Solve`SolvVar[x]]},
{HoldForm[\$MessageList], HoldForm[{}]}, {HoldForm[\$MessageList =
{}], HoldForm[{}]},
{{{HoldForm[I], HoldForm[I]}, HoldForm[Integrate`\$I -> I],
HoldForm[Integrate`\$I -> I]},
HoldForm[Solve`ParmVar[q] /. Integrate`\$I -> I],
HoldForm[Solve`ParmVar[q]]}, {HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]}, {{{HoldForm[I],
HoldForm[I]}, HoldForm[Integrate`\$I -> I],
HoldForm[Integrate`\$I -> I]}, HoldForm[Solve`ParmVar[p] /.
Integrate`\$I -> I], HoldForm[Solve`ParmVar[p]]},
{HoldForm[\$MessageList], HoldForm[{}]}, {HoldForm[q^0],
HoldForm}, {HoldForm[p^0], HoldForm},
{HoldForm[Expand], HoldForm}, {HoldForm[x^0], HoldForm},
{HoldForm[q^0], HoldForm}, {HoldForm[p^0], HoldForm},
{{HoldForm[Options[Factor]], HoldForm[{Extension -> None,
GaussianIntegers -> False, Modulus -> 0, Trig -> False}]},
HoldForm[Extension /. {Extension -> None, GaussianIntegers ->
False, Modulus -> 0, Trig -> False}], HoldForm[None]},
{HoldForm[\$MessageList = {}], HoldForm[{}]}, {HoldForm[FactorList[q
+ p*x + x^3, Modulus -> 0]],
HoldForm[{{1, 1}, {q + p*x + x^3, 1}}]}, {HoldForm[\$MessageList],
HoldForm[{}]}, {HoldForm[Together], HoldForm},
{HoldForm[Together], HoldForm}, {HoldForm[Together[p]],
HoldForm[p]}, {HoldForm[Together[q]], HoldForm[q]},
{HoldForm[Expand[3*p]], HoldForm[3*p]}, {HoldForm[0*p],
HoldForm}, {HoldForm[Expand[-27*q]], HoldForm[-27*q]},
{HoldForm[(3*p)^3], HoldForm[27*p^3]}, {HoldForm[(-27*q)^2],
HoldForm[729*q^2]},
{HoldForm[FactorSquareFree[108*p^3 + 729*q^2]], HoldForm[27*(4*p^3 +
27*q^2)]},
{HoldForm[FactorTermsList[27*(4*p^3 + 27*q^2)]], HoldForm[{27, 4*p^3
+ 27*q^2}]},
{HoldForm[FactorTermsList], HoldForm[{1, 1}]},
{HoldForm[Sqrt[4*p^3 + 27*q^2]],
{HoldForm[(1/2)*Log[4*p^3 + 27*q^2]], HoldForm[(1/2)*Log[4*p^3 +
27*q^2]]}, HoldForm[Sqrt[4*p^3 + 27*q^2]]},
{HoldForm[(3*Sqrt)*Sqrt[4*p^3 + 27*q^2]],
HoldForm[3*Sqrt*Sqrt[4*p^3 + 27*q^2]]},
{{HoldForm[1/2], HoldForm[1/2]}, HoldForm[(1/2)*(-27*q +
3*Sqrt*Sqrt[4*p^3 + 27*q^2])],
HoldForm[(1/2)*(-27*q + 3*Sqrt*Sqrt[4*p^3 + 27*q^2])]},
{HoldForm[(1/2)*(-27*q + 3*Sqrt*Sqrt[4*p^3 + 27*q^2]) /.
(Solve`a_)^(Solve`b_ /;  !IntegerQ[Solve`b]) ->
Solve`RootsAuxVar[Solve`a, Solve`b]], {{HoldForm[IntegerQ[1/2]],
HoldForm[False]}, HoldForm[ !False], HoldForm[True]},
{{HoldForm[IntegerQ[1/2]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
HoldForm[(1/2)*(-27*q + 3*Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[4*p^3 + 27*q^2, 1/2])]},
{HoldForm[FactorTermsList[-27*q + 3*Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[4*p^3 + 27*q^2, 1/2]]],
HoldForm[{-3, 9*q - Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[4*p^3 + 27*q^2, 1/2]}]},
{HoldForm[FactorTermsList], HoldForm[{2, 1}]},
{HoldForm[(3/2)*(-9*q + Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[4*p^3 + 27*q^2, 1/2]) /.
Solve`RootsAuxVar[Solve`a_, Solve`b_] -> Solve`a^Solve`b],
HoldForm[(3/2)*(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])],
{{{HoldForm[Sqrt[4*p^3 + 27*q^2]], {HoldForm[(1/2)*Log[4*p^3 +
27*q^2]], HoldForm[(1/2)*Log[4*p^3 + 27*q^2]]},
HoldForm[Sqrt[4*p^3 + 27*q^2]]}, HoldForm[Sqrt*Sqrt[4*p^3 +
27*q^2]]}, HoldForm[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]},
HoldForm[(3/2)*(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])]},
{HoldForm[(3/2)*(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]) /.
(Solve`a_)^(Solve`b_ /;  !IntegerQ[Solve`b]) ->
Solve`RootsAuxVar[Solve`a, Solve`b]], {{HoldForm[IntegerQ[1/2]],
HoldForm[False]}, HoldForm[ !False], HoldForm[True]},
{{HoldForm[IntegerQ[1/2]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
HoldForm[(3/2)*(-9*q + Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[4*p^3 + 27*q^2, 1/2])]},
{HoldForm[(3/2)*(-9*q + Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[4*p^3 + 27*q^2, 1/2]) /.
Solve`RootsAuxVar[Solve`a_, Solve`b_] -> Solve`a^Solve`b],
HoldForm[(3/2)*(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])],
{{{HoldForm[Sqrt[4*p^3 + 27*q^2]], {HoldForm[(1/2)*Log[4*p^3 +
27*q^2]], HoldForm[(1/2)*Log[4*p^3 + 27*q^2]]},
HoldForm[Sqrt[4*p^3 + 27*q^2]]}, HoldForm[Sqrt*Sqrt[4*p^3 +
27*q^2]]}, HoldForm[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]},
HoldForm[(3/2)*(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])]},
{HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]],
HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
{{HoldForm[1/(3*(3/2)^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))], {HoldForm[1/(3/2)^(1/3)], HoldForm[1/(3/2)^(1/3)],
HoldForm[(2/3)^(1/3)]}, {HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)],
HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]*-1],
HoldForm[(-(1/3))*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[(2/3)^(1/3)/(3*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))]},
HoldForm[((3*p)*(2/3)^(1/3))/(3*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))],
HoldForm[(3*p*(2/3)^(1/3))/(3*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))],
HoldForm[(3*(2/3)^(1/3)*p)/(3*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))], {HoldForm[1/p], HoldForm[1/p]},
HoldForm[((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)]}, {{HoldForm[1/3], HoldForm[1/3]},
HoldForm[(1/3)*(3/2)^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)],
HoldForm[(1/3)*(3/2)^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)],
HoldForm[(1/3)*(3/2)^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)],
HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)/(2^(1/3)*3^(2/3))]}, {{HoldForm[1/2], HoldForm[1/2]},
HoldForm[(1/2)*(1 - I*Sqrt)], HoldForm[(1/2)*(1 - I*Sqrt)]},
{HoldForm[1/p], HoldForm[1/p]},
{HoldForm[1/(1 - I*Sqrt)], HoldForm[1/(1 - I*Sqrt)]},
{{HoldForm[1/2], HoldForm[1/2]}, HoldForm[(1/2)*(1 + I*Sqrt)],
HoldForm[(1/2)*(1 + I*Sqrt)]}, {HoldForm[1/(1 + I*Sqrt)],
HoldForm[1/(1 + I*Sqrt)]},
{{HoldForm[1/2], HoldForm[1/2]}, HoldForm[(1/2)*(1 - I*Sqrt)],
HoldForm[(1/2)*(1 - I*Sqrt)]},
{HoldForm[1/(1 - I*Sqrt)], HoldForm[1/(1 - I*Sqrt)]},
{{HoldForm[1/2], HoldForm[1/2]}, HoldForm[(1/2)*(1 + I*Sqrt)],
HoldForm[(1/2)*(1 + I*Sqrt)]}, {HoldForm[1/p], HoldForm[1/p]},
{HoldForm[1/(1 + I*Sqrt)], HoldForm[1/(1 + I*Sqrt)]},
{{{HoldForm[((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))], {HoldForm[1/p], HoldForm[1/p]},
{HoldForm[1/(1 + I*Sqrt)], HoldForm[1/(1 + I*Sqrt)]},
HoldForm[((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))]},
HoldForm[((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
{{HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))], {HoldForm[1/p], HoldForm[1/p]},
{HoldForm[1/(1 - I*Sqrt)], HoldForm[1/(1 - I*Sqrt)]},
HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))]},
HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
HoldForm[{-(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3)), ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)),
((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}]},
{HoldForm[-(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3)) /. (Solve`a_)^(Solve`b_ /;
!IntegerQ[Solve`b]) -> Solve`RootsAuxVar[Solve`a, Solve`b]],
{{HoldForm[IntegerQ[1/3]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(2/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/3]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
HoldForm[(-Solve`RootsAuxVar[2/3, 1/3])*p*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] +
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]],
{HoldForm[(-Solve`RootsAuxVar[2/3, 1/3])*p*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]],
HoldForm[(-p)*Solve`RootsAuxVar[2/3, 1/3]*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]]},
HoldForm[(-p)*Solve`RootsAuxVar[2/3, 1/3]*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] +
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]]},
{HoldForm[FactorTermsList[(-p)*Solve`RootsAuxVar[2/3,
1/3]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] +
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]]],
HoldForm[{-1, p*Solve`RootsAuxVar[2/3, 1/3]*Solve`RootsAuxVar[-9*q
+ Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]}]},

{HoldForm[FactorTermsList], HoldForm[{1, 1}]},
{HoldForm[(-p)*Solve`RootsAuxVar[2/3, 1/3]*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] +
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3] /.
Solve`RootsAuxVar[Solve`a_, Solve`b_] -> Solve`a^Solve`b],
HoldForm[-((p*(2/3)^(1/3))/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))], {{HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]*-1],
HoldForm[(-(1/3))*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[-((p*(2/3)^(1/3))/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))],
HoldForm[-(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))], {HoldForm[1/p], HoldForm[1/p]},
HoldForm[-(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))]},
{{HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]],
HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)/(2^(1/3)*3^(2/3))]},
HoldForm[-(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))]}, {HoldForm[((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) /.
(Solve`a_)^(Solve`b_ /;  !IntegerQ[Solve`b]) ->
Solve`RootsAuxVar[Solve`a, Solve`b]],
{{HoldForm[IntegerQ[-(2/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/2]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(2/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/2]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/3]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
HoldForm[Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 + I*Solve`RootsAuxVar[3, 1/2])*p*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
(1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*(1 - I*Solve`RootsAuxVar[3,
1/2])*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3]], {HoldForm[Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*(1 + I*Solve`RootsAuxVar[3,
1/2])*p*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]],

HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 + I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)]]},
HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 + I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
(1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*(1 - I*Solve`RootsAuxVar[3,
1/2])*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3]]}, {HoldForm[FactorTermsList[p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*
(1 + I*Solve`RootsAuxVar[3, 1/2])*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
(1/2)*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*(1 - I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]]],
{HoldForm[(p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)] + I*p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)]) +
((-(1/2))*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3] + (1/2)*I*Solve`RootsAuxVar[2,
-(1/3)]*Solve`RootsAuxVar[3, -(2/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3])],

HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)] + I*p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]
- (1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3] +
(1/2)*I*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]]},
HoldForm[{I/2, -2*I*p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]
+ 2*p*Solve`RootsAuxVar[2, -(2/3)]*
Solve`RootsAuxVar[3, -(1/3)]*Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] +
I*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3] +
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]}]},
{HoldForm[FactorTermsList], HoldForm[{1, 1}]},
{HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 + I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]
- (1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*(1 - I*Solve`RootsAuxVar[3,
1/2])*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3] /. Solve`RootsAuxVar[Solve`a_, Solve`b_] ->
Solve`a^Solve`b],
HoldForm[(p*(1 + I*Sqrt))/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))],
{{HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]*-1],
HoldForm[(-(1/3))*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[(p*(1 + I*Sqrt))/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))],
HoldForm[((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))], {HoldForm[1/p], HoldForm[1/p]},
{HoldForm[1/(1 + I*Sqrt)], HoldForm[1/(1 + I*Sqrt)]},
HoldForm[((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))]},
{{HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]],
HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[-(((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)))],
{HoldForm[1/(1 - I*Sqrt)], HoldForm[1/(1 - I*Sqrt)]},
HoldForm[-(((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)))]},
HoldForm[((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
{HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) /.
(Solve`a_)^(Solve`b_ /;  !IntegerQ[Solve`b]) ->
Solve`RootsAuxVar[Solve`a, Solve`b]],
{{HoldForm[IntegerQ[-(2/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/2]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(1/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[-(2/3)]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/2]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
{{HoldForm[IntegerQ[1/3]], HoldForm[False]}, HoldForm[ !False],
HoldForm[True]},
HoldForm[Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 - I*Solve`RootsAuxVar[3, 1/2])*p*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
(1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*(1 + I*Solve`RootsAuxVar[3,
1/2])*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3]], {HoldForm[Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*(1 - I*Solve`RootsAuxVar[3,
1/2])*p*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]],

HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 - I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)]]},
HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 - I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
(1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*(1 + I*Solve`RootsAuxVar[3,
1/2])*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3]]}, {HoldForm[FactorTermsList[p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*
(1 - I*Solve`RootsAuxVar[3, 1/2])*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
(1/2)*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*(1 + I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]]],
{HoldForm[(p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)] - I*p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)]) +
((-(1/2))*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3] - (1/2)*I*Solve`RootsAuxVar[2,
-(1/3)]*Solve`RootsAuxVar[3, -(2/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3])],

HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
-(1/3)] - I*p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]
- (1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*Solve`RootsAuxVar[-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3] -
(1/2)*I*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]]},
HoldForm[{-(I/2), 2*I*p*Solve`RootsAuxVar[2,
-(2/3)]*Solve`RootsAuxVar[3, -(1/3)]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]
+ 2*p*Solve`RootsAuxVar[2, -(2/3)]*
Solve`RootsAuxVar[3, -(1/3)]*Solve`RootsAuxVar[3,
1/2]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)] -
I*Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3] +
Solve`RootsAuxVar[2, -(1/3)]*Solve`RootsAuxVar[3,
-(2/3)]*Solve`RootsAuxVar[3, 1/2]*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], 1/3]}]},
{HoldForm[FactorTermsList], HoldForm[{1, 1}]},
{HoldForm[p*Solve`RootsAuxVar[2, -(2/3)]*Solve`RootsAuxVar[3,
-(1/3)]*(1 - I*Solve`RootsAuxVar[3, 1/2])*
Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2], -(1/3)]
- (1/2)*Solve`RootsAuxVar[2, -(1/3)]*
Solve`RootsAuxVar[3, -(2/3)]*(1 + I*Solve`RootsAuxVar[3,
1/2])*Solve`RootsAuxVar[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2],
1/3] /. Solve`RootsAuxVar[Solve`a_, Solve`b_] ->
Solve`a^Solve`b],
HoldForm[(p*(1 - I*Sqrt))/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))],
{{HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]*-1],
HoldForm[(-(1/3))*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[1/(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[(p*(1 - I*Sqrt))/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))],
HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))], {HoldForm[1/p], HoldForm[1/p]},
{HoldForm[1/(1 - I*Sqrt)], HoldForm[1/(1 - I*Sqrt)]},
HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3))]},
{{HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)],
{HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]],
HoldForm[(1/3)*Log[-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2]]]},
HoldForm[(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)]},
HoldForm[-(((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)))],
{HoldForm[1/(1 + I*Sqrt)], HoldForm[1/(1 + I*Sqrt)]},
HoldForm[-(((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)))]},
HoldForm[((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
HoldForm[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3)) || x == ((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) ||
x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{{HoldForm[And[x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]],
HoldForm[x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
HoldForm[x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) /.
Solve`InvFun[Solve`a_, Solve`k_Integer, _Integer][Solve`w___,
(Solve`a_)[Solve`w___, Solve`b_, Solve`g___], Solve`g___] :>
Solve`b /; Length[{Solve`w}] == Solve`k - 1],
HoldForm[x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]}, {HoldForm[\$MessageList],
HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{{HoldForm[And[x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]],
HoldForm[x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
HoldForm[x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) /.
Solve`InvFun[Solve`a_, Solve`k_Integer, _Integer][Solve`w___,
(Solve`a_)[Solve`w___, Solve`b_, Solve`g___], Solve`g___] :>
Solve`b /; Length[{Solve`w}] == Solve`k - 1],
HoldForm[x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]}, {HoldForm[\$MessageList],
HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{{HoldForm[And[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))]], HoldForm[x == -(((2/3)^(1/3)*p)/(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) +
(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/(2^(1/3)*3^(2/3))]},

HoldForm[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3)) /. Solve`InvFun[Solve`a_, Solve`k_Integer,
_Integer][Solve`w___,
(Solve`a_)[Solve`w___, Solve`b_, Solve`g___], Solve`g___] :>
Solve`b /; Length[{Solve`w}] == Solve`k - 1],
HoldForm[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))]}, {HoldForm[\$MessageList], HoldForm[{}]},
{HoldForm[\$MessageList = {}], HoldForm[{}]},
{HoldForm[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3)) || x == ((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) ||
x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) /.
Solve`InvFun[Solve`a_, Solve`k_Integer, _Integer][Solve`w___,
(Solve`a_)[Solve`w___, Solve`b_, Solve`g___], Solve`g___] :>
Solve`b /; Length[{Solve`w}] == Solve`k - 1],
HoldForm[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3)) || x == ((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) ||
x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]},
{HoldForm[\$MessageList], HoldForm[{}]},
{{HoldForm[ToRules[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3
+ 27*q^2])^(1/3)) +
(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/(2^(1/3)*3^(2/3))
||
x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3)) ||
x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]],
HoldForm[ToRules[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3
+ 27*q^2])^(1/3)) +
(-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/(2^(1/3)*3^(2/3))],

ToRules[x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))],
ToRules[x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]],
{HoldForm[ToRules[x == -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3
+ 27*q^2])^(1/3)) +
(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)/(2^(1/3)*3^(2/3))]],
HoldForm[{x -> -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))}]},
{HoldForm[ToRules[x == ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]],
HoldForm[{x -> ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}]},
{HoldForm[ToRules[x == ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))]],
HoldForm[{x -> ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}]},
HoldForm[{x -> -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))}, {x -> ((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))},
{x -> ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}]},
HoldForm[{Sequence[{x -> -(((2/3)^(1/3)*p)/(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) +
(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)/(2^(1/3)*3^(2/3))},
{x -> ((1 + I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))},
{x -> ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}]}],
HoldForm[{{x -> -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))}, {x -> ((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))},
{x -> ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}}]},
HoldForm[{{x -> -(((2/3)^(1/3)*p)/(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) + (-9*q + Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)/
(2^(1/3)*3^(2/3))}, {x -> ((1 +
I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3)) -
((1 - I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))},
{x -> ((1 - I*Sqrt)*p)/(2^(2/3)*3^(1/3)*(-9*q +
Sqrt*Sqrt[4*p^3 + 27*q^2])^(1/3)) -
((1 + I*Sqrt)*(-9*q + Sqrt*Sqrt[4*p^3 +
27*q^2])^(1/3))/(2*2^(1/3)*3^(2/3))}}]}

Period! No further comment!

Best Regards
Dimitris

Paul-Olivier Dehaye <paul-olivier.dehaye at merton.ox.ac.uk> wrote:

Thank you for this, but in the case of very "unobvious" manipulations
of hypergeometric sums, there are only finitely many identities that
are known (and referred to usually as the hypergeometric database, as
first described by Bailey). See
http://mathworld.wolfram.com/GeneralizedHypergeometricFunction.html
As far as I know, that's essentially how Mathematica tries to simplify
those "hard" HypergeometricPFQ.

By essentially, I mean that without those rules hard-coded in the
system, there is almost no chance mathematica would stumble upon it.

Some of them are more trivial than others, and it would be a good
question for instance to know if Mathematica had to use any of the
identities in the table on the page linked above.

Now, in the problem you were suggesting me to Trace, it looks like this
is indeed what s happening. Beyond, indeed, a huge mess, there are some
parts that I can make sense of:

>                    System`GammaDump`SimpGammaN[{{1 + a - c, 1},
>                     {1 + a - b - c, -1}}],
>                   {{1 + a - c === 1 + a - b - c && 1 === -1,
>                     {1 + a - c === 1 + a - b - c, False}, False},
>                      {{1 + a - c, 1 + Sign}}], False], Fail},
>                   If[Length[{{1 + a - c, 1}, {1 + a - b - c, -1}}] <
2,
>                    System`GammaDump`SimpGamma1[{{1 + a - c, 1},

and in general wherever there is a RuleCondition, it looks as if
Mathematica is trying to establish whether it is under the hypothesis
of the specific rule being considered.

I don't understand that output, but what I want is in there...

On 12/9/06, dimitris <dimmechan at yahoo.com> wrote:
CAS like Mathematica have implementated algorithms which usually don't
solution by hand; quite the opposite.
The intermediate evaluated expressions may be interesting for someone
with deeper knowledge in Computer Science but for the common user of
Mathematica.

Consider for example the following example of definite integration

Integrate[1/Sqrt[1 - x^2], {x, 0, 1}]
Pi/2

A trivial solution by hand provided by the substitution x=sinu.
We let Mathematica do this for us.

Reduce[Sin[u] == 0 && 0 <= u <= Pi/2, u] && Reduce[Sin[u] == 1 && 0 <=
u <= Pi/2, u]
integrand = Simplify[(1/Sqrt[1 - x^2])*dx /. x -> Sin[u] /. dx ->
D[Sin[u], u], 0 <= u <= Pi/2]
Integrate[integrand, {u, 0, Pi/2}]

u == 0 && u == Pi/2
1
Pi/2

If you want to take a look of the intermediate expressions in the
direct evaluation of
the integral by Mathematica execute the following command (and be
impressed!)

Trace[Integrate[1/Sqrt[1 - x^2], {x, 0, 1}], TraceInternal -> True]

The output is big and I avoid to display it.
But watch that even this quite simple integral involves the calling of
"exotic" functions
like PolyLog

Cases[Trace[

Integrate[1/Sqrt[1-x^2],{x,0,1}],TraceInternal\[Rule]True],_PolyLog,{-3}]
{PolyLog[Integrate`ImproperDump`v, Integrate`NLtheoremDump`w],
PolyLog[2, 1 + I], PolyLog[3, -I], PolyLog[3, 1 + I],
PolyLog[Integrate`ImproperDump`v, Integrate`NLtheoremDump`w],
PolyLog[2, 1 + I], PolyLog[3, -I], PolyLog[3, 1 + I],
PolyLog[Integrate`ImproperDump`v, Integrate`NLtheoremDump`w],
PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)],
PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2,
(-1)^(1/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(3/4)],
PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2,
(-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(3/4)],
PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2,
(-1)^(3/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)],
PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2,
(-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(1/4)],
PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2,
(-1)^(3/4)], PolyLog[2, (-1)^(1/4)]}

Look in the implementation notes of Integrate for more details.

Consider an example from the Help Browser

HypergeometricPFQ[{a, b, c}, {1 + a - b, 1 + a - c}, 1]
(Pochhammer[1 + a, -b]*Pochhammer[1 + a/2 - c, -b])/(Pochhammer[1 +
a/2, -b]*Pochhammer[1 + a - c, -b])

Then

FunctionExpand[HypergeometricPFQ[{a, b, c}, {1 + a - b, 1 + a - c}, 1]]
(Sqrt[Pi]*Gamma[1 + a - b]*Gamma[1 + a - c]*Gamma[1 + a/2 - b - c])/
(2^a*(Gamma[1/2 + a/2]*Gamma[1 + a/2 - b]*Gamma[1 + a/2 - c]*Gamma[1
+ a - b - c]))

Use above setting of Trace and be impressed again!

Trace[FullSimplify[HypergeometricPFQ[{a, b, c}, {1 + a - b, 1 + a - c},
1]], TraceInternal -> True]

Note that

Information["TraceInternal", LongForm -> True]
"TraceInternal is an option for Trace and related functions which, if
True or False, specifies whether to trace evaluations of \
expressions generated internally by Mathematica. The intermediate
Automatic setting traces a selected set of internal \
evaluations including Messages and sets or unsets of visible symbols."
Attributes[TraceInternal] = {Protected}

Also I suggest you reading the following relevant post

Best Regards
Dimitris

> Hi,
> I have a question regarding something that Mathematica can do via the
> command FullSimplify.
> I use it to prove an identity between HypergeometricPFQ's. However it
> would be helpful to me to see how Mathematica proves it. How can I
get
applied?
> Also, is there a definite list of all the things FullSimplify will
try
> in Automatic setting?
> Thank you very much

> Hi,
> I have a question regarding something that Mathematica can do via the
> command FullSimplify.
> I use it to prove an identity between HypergeometricPFQ's. However it
> would be helpful to me to see how Mathematica proves it. How can I
get
applied?
> Also, is there a definite list of all the things FullSimplify will
try
> in Automatic setting?
> Thank you very much

dimitris wrote:
> CAS like Mathematica have implementated algorithms which usually don't
> follow human's solution by hand; quite the opposite.
> The intermediate evaluated expressions may be interesting for someone
> with deeper knowledge in Computer Science but for the common user of
> Mathematica.
>
> Consider for example the following example of definite integration
>
> Integrate[1/Sqrt[1 - x^2], {x, 0, 1}]
> Pi/2
>
> A trivial solution by hand provided by the substitution x=sinu.
> We let Mathematica do this for us.
>
> Reduce[Sin[u] == 0 && 0 <= u <= Pi/2, u] && Reduce[Sin[u] == 1 && 0 <=
> u <= Pi/2, u]
> integrand = Simplify[(1/Sqrt[1 - x^2])*dx /. x -> Sin[u] /. dx ->
> D[Sin[u], u], 0 <= u <= Pi/2]
> Integrate[integrand, {u, 0, Pi/2}]
>
> u == 0 && u == Pi/2
> 1
> Pi/2
>
> If you want to take a look of the intermediate expressions in the
> direct evaluation of
> the integral by Mathematica execute the following command (and be
> impressed!)
>
> Trace[Integrate[1/Sqrt[1 - x^2], {x, 0, 1}], TraceInternal -> True]
>
> The output is big and I avoid to display it.
> But watch that even this quite simple integral involves the calling of
> "exotic" functions
> like PolyLog
>
> Cases[Trace[
>
> Integrate[1/Sqrt[1-x^2],{x,0,1}],TraceInternal\[Rule]True],_PolyLog,{-3}]
> {PolyLog[Integrate`ImproperDump`v, Integrate`NLtheoremDump`w],
> PolyLog[2, 1 + I], PolyLog[3, -I], PolyLog[3, 1 + I],
>   PolyLog[Integrate`ImproperDump`v, Integrate`NLtheoremDump`w],
> PolyLog[2, 1 + I], PolyLog[3, -I], PolyLog[3, 1 + I],
>   PolyLog[Integrate`ImproperDump`v, Integrate`NLtheoremDump`w],
> PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)],
>   PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2,
> (-1)^(1/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(3/4)],
>   PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2,
> (-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(3/4)],
>   PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2,
> (-1)^(3/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)],
>   PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(1/4)], PolyLog[2,
> (-1)^(3/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2, (-1)^(1/4)],
>   PolyLog[2, (-1)^(1/4)], PolyLog[2, (-1)^(3/4)], PolyLog[2,
> (-1)^(3/4)], PolyLog[2, (-1)^(1/4)]}
>
> Look in the implementation notes of Integrate for more details.
>
> As regards your particular question:
>
> Consider an example from the Help Browser
>
> HypergeometricPFQ[{a, b, c}, {1 + a - b, 1 + a - c}, 1]
> (Pochhammer[1 + a, -b]*Pochhammer[1 + a/2 - c, -b])/(Pochhammer[1 +
> a/2, -b]*Pochhammer[1 + a - c, -b])
>
> Then
>
> FunctionExpand[HypergeometricPFQ[{a, b, c}, {1 + a - b, 1 + a - c}, 1]]
> (Sqrt[Pi]*Gamma[1 + a - b]*Gamma[1 + a - c]*Gamma[1 + a/2 - b - c])/
>   (2^a*(Gamma[1/2 + a/2]*Gamma[1 + a/2 - b]*Gamma[1 + a/2 - c]*Gamma[1
> + a - b - c]))
>
> Use above setting of Trace and be impressed again!
>
> Trace[FullSimplify[HypergeometricPFQ[{a, b, c}, {1 + a - b, 1 + a - c},
> 1]], TraceInternal -> True]
>
> Note that
>
> Information["TraceInternal", LongForm -> True]
> "TraceInternal is an option for Trace and related functions which, if
> True or False, specifies whether to trace evaluations of \
> expressions generated internally by Mathematica. The intermediate
> Automatic setting traces a selected set of internal \
> evaluations including Messages and sets or unsets of visible symbols."
> Attributes[TraceInternal] = {Protected}
>
> Also I suggest you reading the following relevant post
>
>
> Best Regards
> Dimitris
>
>
>
> > Hi,
> > I have a question regarding something that Mathematica can do via the
> > command FullSimplify.
> > I use it to prove an identity between HypergeometricPFQ's. However it
> > would be helpful to me to see how Mathematica proves it. How can I get