Notation

\(Unprotect[Primes, Integers, Rationals, Reals, Complexes, Algebraics, 
      Booleans, Exists, ForAll]; 


    Format[Primes, \ StandardForm] := ℙ\)Format[Integers,  StandardForm] := ℤFormat[Rationals,  StandardForm] := ℚFormat[Reals,  StandardForm] := ℝFormat[Complexes,  StandardForm] := ℂFormat[Algebraics,  StandardForm] := 𝔸\(Format[Booleans, \ StandardForm] := 𝔹
\)MakeExpression[RowBox[{a___, "ℙ", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Primes", b}], StandardForm]\(MakeExpression[RowBox[{a___, "ℙ", b___}], 
        InputForm] := 
      MakeExpression[RowBox[{a, "Primes", b}], InputForm]
\)MakeExpression[RowBox[{a___, "ℤ", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Integers", b}], StandardForm]\(MakeExpression[RowBox[{a___, "ℤ", b___}], 
        InputForm] := 
      MakeExpression[RowBox[{a, "Integers", b}], InputForm]
\)MakeExpression[RowBox[{a___, "ℚ", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Rationals", b}], StandardForm]\(MakeExpression[RowBox[{a___, "ℚ", b___}], 
        InputForm] := 
      MakeExpression[RowBox[{a, "Rationals", b}], InputForm]
\)MakeExpression[RowBox[{a___, "ℝ", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Reals", b}], StandardForm]\(MakeExpression[RowBox[{a___, "ℝ", b___}], 
        InputForm] := MakeExpression[RowBox[{a, "Reals", b}], InputForm]

    \)MakeExpression[RowBox[{a___, "ℂ", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Complexes", b}], StandardForm]\(MakeExpression[RowBox[{a___, "ℂ", b___}], 
        InputForm] := 
      MakeExpression[RowBox[{a, "Complexes", b}], InputForm]
\)MakeExpression[RowBox[{a___, "𝔸", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Algebraics", b}], StandardForm]\(MakeExpression[RowBox[{a___, "𝔸", b___}], 
        InputForm] := 
      MakeExpression[RowBox[{a, "Algebraics", b}], InputForm]
\)MakeExpression[RowBox[{a___, "𝔹", b___}], 
        StandardForm] := 
      MakeExpression[RowBox[{a, "Booleans", b}], StandardForm]\(MakeExpression[RowBox[{a___, "𝔹", b___}], 
        InputForm] := 
      MakeExpression[RowBox[{a, "Booleans", b}], InputForm]
\)\(Exists /: \ MakeBoxes[Exists[a_, b_, c_], \ StandardForm] := 
	
      RowBox[{SubscriptBox["∃", 
            RowBox[{\ MakeBoxes[a, \ StandardForm], ",", \ 
                MakeBoxes[b, \ StandardForm]}]], 
          MakeBoxes[c, \ StandardForm]}]
\)\(MakeExpression[
        RowBox[{SubscriptBox["∃", \ RowBox[{a_, ",", \ b_}]], 
            c_}], \ StandardForm] := 
	
      MakeExpression[
        RowBox[{"Exists", "[", a, ",", b, ",", c, "]"}], 
        \ StandardForm]
\)\(ForAll /: \ MakeBoxes[ForAll[a_, b_, c_], \ StandardForm] := 
	
      RowBox[{SubscriptBox["∀", 
            RowBox[{\ MakeBoxes[a, \ StandardForm], ",", \ 
                MakeBoxes[b, \ StandardForm]}]], 
          MakeBoxes[c, \ StandardForm]}]
\)\(MakeExpression[
        RowBox[{SubscriptBox["∀", \ RowBox[{a_, ",", \ b_}]], 
            c_}], \ StandardForm] := 
	
      MakeExpression[
        RowBox[{"ForAll", "[", a, ",", b, ",", c, "]"}], 
        \ StandardForm]
\)Protect[Primes, Integers, Rationals, Reals, Complexes, Algebraics, 
      Booleans, Exists, ForAll];

f[x_, y_] := 
      If[((x^2)/4) + ((y^2)/9) - 1 > 0, 
        If[(1/9) (((x - 2))^2) + (1/4) (((y - 3))^2) - (1/4) > 0, 3, 2], 
        If[(1/9) (((x - 2))^2) + (1/4) (((y - 3))^2) - (1/4) > 0, 1, 0]]col[r_] := 
      If[r > (3/4), RGBColor[1, 1, 1], 
        If[r > (1/2), RGBColor[0, 0, 1], 
          If[r > (1/4), RGBColor[1, 0, 0], RGBColor[0, 1, 0]]]]ellipses = 
      ContourPlot[f[x, y], {x, -4, 4},  {y, -4, 4}, 
        PlotPoints -> 200, ColorFunction -> col];

\(quartic = 
      ContourPlot[x\^4 + y\^4\/16 - 1, {x, \(-2\), 2}, {y, \(-3\), 3}, 
        Contours -> {0}, PlotPoints -> 100, 
        ColorFunction -> \((RGBColor[#1, 1, 1]&)\)]; 

    line = Plot[2.57 - x, {x, \(-2\), 2}]; \)

$ContextPath = 
      Join[$ContextPath,  {"Developer`", "Experimental`"}]

New Symbolic Features in Mathematica 3.1

Assumptions

In Mathematica V3.1 one can specify assumptions about variables or patterns to be used by Simplify, FullSimplify, and FunctionExpand.

There are three types of assumptions that can be used:

Set Membership Assumptions

A new function Element[patt, set] is introduced. The available set names are:
Primes, Integers, Rationals, Reals, Complexes, Algebraics, and Booleans.

149 ∈ ℙ

(2^((Sqrt[3]))) ∈ 𝔸

Simplify[Sin[n π], n ∈ ℤ]

Simplify[
      PolyLog[Gamma[Round[x]^2 + 1], (E^x)] ∈ 
        ℝ, x ∈ ℝ]

The condition tested here is that the first argument of PolyLog be an integer, and that the second argument be a real number.

FunctionExpand[EulerPhi[(p^2) (q^3)], 
      (p | q) ∈ ℙ && p ≠ q]

Inequality Assumptions

Simplify[(Sqrt[(x^2) + 2 x y + (y^2)]), x > -y]

FunctionExpand[Log[a x],  a > 0]

Simplify[
      BesselJ[x + y, (x^2) - x y + (y^2) + 1] ∈ 
        ℝ, 
      (x | y) ∈ ℝ]

The condition tested here is that the first argument is real and the second is positive.

Simplify[((((a^Erf)[b]))^c), b ∈ ℝ]

Simplify[((((a^(((9 Erf[b])/8)))))^c), 
      b ∈ ℝ]

Here the "middle" power has to be between -1 and 1.

((((a^(((9 Erf[b])/8)))))^c) - (a^(((9 Erf[b])/8) c)) /. {
        a -> -1, b -> 3., c -> I}

Equation Assumptions

Simplify[Expand[((((x^2) - 3 y + 2))^2) (((x + 5 y))^3)], 
      (x^2) == 3 y]

Quantifier Elimination

Quantifiers are represented by functions Exists[vars, assumptions, expr], and ForAll[vars, assumptions, expr]. Resolve[expr] attempts to eliminate quantifiers from expr. The current version of Resolve can eliminate quantifiers from real polynomial equation and inequality systems. In general case it uses an algorithm based on Collins' cylindrical algebraic decomposition algorithm, with special case versions of this algorithm for decision problems and for stronginequalities. For the linear quantifier elimination it uses the Loos-Weispfenning algorithm, and for linear decision problem a method based on the simplex algorithm.

(Subscript[∃ , x, x ∈ ℝ])(x^2) - x + 1 < 0

Resolve[%]

(Subscript[∀ , {x, y}, 
        (x^2) + (y^2) < 1])(((x - 2))^2) + (((y - 2))^2) > 3

Resolve[%]

(Subscript[∀ , x, 
        (x | a | b | c) ∈ ℝ])a (x^2) + 
          b x + c ≥ 0

Resolve[%]

(Subscript[∃ , x, 
        (x | a | b) ∈ ℝ])(x^6) + a x + b
           == 0

Resolve[%]

(Subscript[∀ , ϵ, 
        ϵ > 0])(Subscript[∃ , M, 
          M ∈ ℝ])(Subscript[∀ , x, 
            x > M && λ ∈ ℝ])-
              ϵ < 
            ((3 (x^2) - 5 x + 7)/(7 (x^2) - 2 x + 11)) - λ < 
            ϵ

Resolve[%]

Developer` and Experimental` Contexts

Access to internal algorithms

Functions related to solving inequality systems

Developer`InequalityInstance[inequalities, vars] finds a real solution of a system of polynomial equations and inequalities.

Show[ellipses]

InequalityInstance[
      ((x^2)/4) + ((y^2)/9) < 1 && 
        (1/9) (((x - 2))^2) + (1/4) (((y - 3))^2) < (1/4), {x, y}]

Show[ellipses, Graphics[{PointSize[0.02], Point[{x, y} /. %]}]]

The following three functions provide an interface to the real polynomial decision algorithm.

ExistsRealQ[
      (x^2) + (y^2) < 1 && (((x - 2))^2) + (((y - 2))^2) < 3, {x, y}]

ForAllRealQ[(x^2) + (y^2) + (z^2) ≥ 0, {x, y, z}]

ImpliesRealQ[(x^2) + (y^2) < 1, x > y - (Sqrt[2])]

Experimental`CylindricalAlgebraicDecomposition gives a cylindrical algebraic decomposition of the set of real points satifying a given system of inequalities.

CylindricalAlgebraicDecomposition[(x^2) + (y^2) ≤ 1, {x, y}]

Top level access to the assumptions mechanism

Experimental`AssumedQ uses the internal assumption checking heuristic to prove that a statement follows from assumptions.

AssumedQ[CosIntegral[(x^y)] ∈ ℝ, 
      x > 0 && y ∈ ℝ]

Show[quartic, line]

AssumedQ[x + y < 2.57, (x^4) + ((y^4)/16) < 1]

Special simplifiers

Developer`BesselSimplify

BesselSimplify[BesselJ[m + 2, z] + BesselJ[m, z]]

Developer`FibonacciSimplify

FibonacciSimplify[
      Fibonacci[n - 8] + Fibonacci[n - 6] + 6 Fibonacci[n - 5] + 
        Fibonacci[n - 2], n ∈ ℤ]

Developer`GammaSimplify

GammaSimplify[x Gamma[x]]

Developer`PolyGammaSimplify

PolyGammaSimplify[PolyGamma[7, n + 1] - PolyGamma[7, n]]

Developer`PolyLogSimplify

PolyLogSimplify[PolyLog[(1/2), ((-1)^(1/7))]] // Expand

Developer`ZetaSimplify

ZetaSimplify[Zeta[3, 7]]

Developer`TrigToRadicals

TrigToRadicals[Sin[((17 Pi)/32)]]

Sparse polynomials

SparseCoefficientList[(x^2) + 2 x y + 3 y + 1, {x, y}]

FromSparseCoefficientList[%, {x, y}]

Zero testing

ZeroQ[(Sqrt[2]) + (Sqrt[3]) + (Sqrt[5]) - (Sqrt[2 (5 + (Sqrt[15]) + 2 (Sqrt[4 + (Sqrt[15])]))])]

ZeroQ[Log[(Sqrt[x])] - Log[x]/2]

Setting internal options

Mathematica caches results of some symbolic and numeric computations. These functions allow to remove the cached results.

Developer`ClearNumericCache[]Developer`ClearSymbolicCache[]

This shows a list of all system options.

Developer`SystemOptions[] // InputForm

This turns symbolic caching off.

Developer`SetSystemOptions["SymbolicCaching" -> False]

Other new functionality

Modulus Option in LUDecomposition and LUBackSubstitution

LUBackSubstitution[
      LUDecomposition[{{123, 234, 345}, {456, 567, 678}, {789, 890, 901}}, 
        Modulus -> 7], {135, 246, 357}, Modulus -> 7]

{{123, 234, 345}, {456, 567, 678}, {789, 890, 901}}.%

Mod[% - {135, 246, 357},  7]

Conjugate and Transpose Options in LUBackSubstitution

LUBackSubstitution will now take Conjugate and Transpose options, with valid values of True/False. The rationale is that, given an LU decomposition for a matrix mat, one frequently wants to solve not just mat.x==b but also Transpose[mat].x==b, Conjugate[mat].x==b, or Conjugate[Transpose[mat]].x==b. These needs arise, for example, in implementing the Hager/Higham condition number estimation routine.

Modular LinearSolve speed improvement

\(SeedRandom[1111]; 

    mat\  = \ Table[Random[Integer, \ {\(-10\), 10}], \ {100}, \ {100}]; 

    b\  = \ Table[Random[Integer, \ {\(-10\), 10}], \ {100}]; \)

Timing[LinearSolve[mat,  b,  Modulus -> Prime[1111]]][[1]]

(vs. 4.61 Second in V3.0)

Timing[LinearSolve[mat,  b,  Modulus -> Prime[111111]]][[1]]

(vs. 15.58 Second in V3.0)

Timing[LinearSolve[mat,  b,  Modulus -> Prime[11111111]]][[1]]

(vs. 14.34 Second in V3.0)

b =.

Trace of a Tensor

Tr[{{a, b}, {c, d}}]

Subresultants

This gives a list of principal subresultant coefficients:

Subresultants[(x^3) + a (x^2) + b x + c, 
      (∂_x)((x^3) + a (x^2) + b x + c), x]

Bit Operations on Integers

BitAnd[7, 17]

BitOr[7, 17]

BitXor[7, 17]

Laplace Transform

LaplaceTransform[Sin[x], x, t]

InverseLaplaceTransform[%, t, x]

Z Transform

ZTransform[(E^x), x, t]

InverseZTransform[%, t, x]

IntegrationImprovements

(∫_0^1)(( x Log[Log[(1/x)]])/(1 + (x^2))) 
        \[DifferentialD]x

(∫_0^∞)(( Sech[x] Tanh[x])/x) 
        \[DifferentialD]x

Symbolic SummationImprovements

(∑_(k = 0)^∞) (1/(5^((k^2) + k)))

(∑_(k = 1)^∞) EulerPhi[k]/(k^3)

Appell F1 Function

∫((((x^3) - x + 1))^r) \[DifferentialD]x

Nielsen Function

\(TraditionalForm
    \`\(S\_\(n, p\)\)(z) = 
      \(1\/\(\(Γ(n)\)\ \(Γ(p + 1)\)\)\) 
        \(∫\_0\%1
            \(\(\((\(-\(log(t)\)\))\)\^\(n - 1\)\ 
                  \((\(-\(log(1 - z\ t)\)\))\)\^p\)\/t\) 
            dt\)\)

The integral is convergent when Re(n) > 0, Re(p) > 0 and \(TraditionalForm
      \`|z| ≤ 1\).

PolyLog[n - 1, 1, z]

PolyLog[2, 3, 1]

D[PolyLog[n, p, z], z]

Series[PolyLog[1/2, 2, z], {z, 0, 4}]

Struve functions

StruveH[1.234, 5.678]

StruveL[1.234, 5.678]

Khinchin's Constant

(∏_(n = 1)^∞)(((1 + (1/(n (n + 2))))
          )^(Log[n]/Log[2]))

N[%]

Glaisher - Kinkelin's Constant

Glaisher // N

Harmonic Numbers

(Subscript[H, n]) = (∑_(k = 1)^n) (1/k)

 (Subscript[H, n]^((r))) = (∑_(k = 1)^n) (1/(k^r))

HarmonicNumber[∞, 2]

Distributions

(∫_0^∞) UnitStep[x - 1]/(x^2) 
        \[DifferentialD]x

(∫_0^∞) DiracDelta[x - 2] (x^2) 
        \[DifferentialD]x

D[UnitStep[x], x]