- See Also
-
Related Guides
- Manipulating Equations
- Formula Manipulation
- Number Theory
- Computational Geometry
- Polynomial Algebra
- Polynomial Equations
- Diophantine Equations
- Polynomial Systems
- Equation Solving
- Theorem Proving
- Inequalities
- Solvers over Regions
- Solid Geometry
- Plane Geometry
- Finite Fields
- Finite Mathematics
- Polygons
- Polyhedra
- Symbolic Vectors, Matrices and Arrays
-
Tech Notes
- Solving Equations
- Inequalities
- Generic and Non‐Generic Solutions
- Equations and Inequalities over Domains
- Solving Logical Combinations of Equations
- The Representation of Solution Sets
- Complex Polynomial Systems
- Real Polynomial Systems
- Diophantine Polynomial Systems
- Implementation notes: Algebra and Calculus
-
- See Also
-
Related Guides
- Manipulating Equations
- Formula Manipulation
- Number Theory
- Computational Geometry
- Polynomial Algebra
- Polynomial Equations
- Diophantine Equations
- Polynomial Systems
- Equation Solving
- Theorem Proving
- Inequalities
- Solvers over Regions
- Solid Geometry
- Plane Geometry
- Finite Fields
- Finite Mathematics
- Polygons
- Polyhedra
- Symbolic Vectors, Matrices and Arrays
-
Tech Notes
- Solving Equations
- Inequalities
- Generic and Non‐Generic Solutions
- Equations and Inequalities over Domains
- Solving Logical Combinations of Equations
- The Representation of Solution Sets
- Complex Polynomial Systems
- Real Polynomial Systems
- Diophantine Polynomial Systems
- Implementation notes: Algebra and Calculus
Reduce
Details and Options
- The statement expr can be any logical combination of:
-
lhs==rhs equations lhs!=rhs inequations lhs>rhs or lhs>=rhs inequalities expr∈dom domain specifications {x,y,…}∈reg region specification ForAll[x,cond,expr] universal quantifiers Exists[x,cond,expr] existential quantifiers - The result of Reduce[expr,vars] always describes exactly the same mathematical set as expr.
- Reduce[{expr1,expr2,…},vars] is equivalent to Reduce[expr1&&expr2&&…,vars].
- Reduce[expr,vars] assumes by default that quantities appearing algebraically in inequalities are real, while all other quantities are complex.
- Reduce[expr,vars,dom] restricts all variables and parameters to belong to the domain dom.
- If dom is Reals, or a subset such as Integers or Rationals, then all constants and function values are also restricted to be real.
- Reduce[expr&&vars∈Reals,vars,Complexes] performs reductions with variables assumed real, but function values allowed to be complex.
- Reduce[expr,vars,Integers] reduces Diophantine equations over the integers.
- Reduce[…,x∈reg,Reals] constrains x to be in the region reg. The different coordinates for x can be referred to using Indexed[x,i].
- Reduce[expr,{x1,x2,…},…] effectively writes expr as a combination of conditions on x1, x2, … where each condition involves only the earlier
. - Algebraic variables in expr free of the
and of each other are treated as independent parameters. - Applying LogicalExpand to the results of Reduce[expr,…] yields an expression of the form
, where each of the
can be thought of as representing a separate component in the set defined by expr. - The
may not be disjoint and may have different dimensions. After LogicalExpand, each of the
has the form
. - Without LogicalExpand, Reduce by default returns a nested collection of conditions on the
, combined alternately by Or and And on successive levels. - When expr involves only polynomial equations and inequalities over real or complex domains, then Reduce can always in principle solve directly for all the
. - When expr involves transcendental conditions or integer domains, Reduce will often introduce additional parameters in its results.
- When expr involves only polynomial conditions, Reduce[expr,vars,Reals] gives a cylindrical algebraic decomposition of expr.
- Reduce can give explicit representations for solutions to all linear equations and inequalities over the integers and can solve a large fraction of Diophantine equations described in the literature.
- When expr involves only polynomial conditions over real or complex domains, Reduce[expr,vars] will always eliminate quantifiers, so that quantified variables do not appear in the result.
- The following options can be given:
-
Backsubstitution False whether to give results unwound by backsubstitution » Cubics False whether to use explicit radicals to solve all cubics » GeneratedParameters C how to name parameters that are generated » Modulus 0 modulus to assume for integers » Quartics False whether to use explicit radicals to solve all quartics » - Reduce[expr,{x1,x2,…},Backsubstitution->True] yields a form in which values from equations generated for earlier
are backsubstituted so that the conditions for a particular
have only minimal dependence on earlier
. »
Examples
open all close allBasic Examples (4)
Reduce equations and inequalities:
Reduce[x ^ 2 - y ^ 3 == 1, {x, y}]Reduce[x ^ 2 + y ^ 2 < 1, {x, y}]Reduce[x ^ 2 - 7y ^ 2 == 1 && x > 0 && y > 0, {x, y}, Integers]Reduce[x ^ 2 - 7y ^ 2 == 1 && x > 0 && y > 0, {x, y}, Reals]Reduce a quantified expression:
Reduce[Exists[{x, y}, x ^ 2 + a y ^ 2 ≤ 1 && x - y ≥ 2], a]Reduce with geometric region constraints:
Reduce[{x, y}∈InfiniteLine[{{0, 0}, {2, 2}}] && {x, y}∈Circle[], {x, y}]Graphics[{Blue, Circle[], InfiniteLine[{{0, 0}, {2, 2}}], {Red, Point[{x, y}] //. {ToRules[%]}}}]Scope (83)
Basic Uses (5)
Find an explicit description of the solution set of a system of equations:
Reduce[x ^ 2 + y ^ 2 == 2 && x - y == 1, {x, y}]Use ToRules and ReplaceRepeated (//.) to list the solutions:
{x, y} //. {ToRules[%]}Find an explicit description of the solution set of a system of inequalities:
Reduce[x ^ 2 + y ^ 2 < 2 && x - y ≥ 1, {x, y}]Find solutions over specified domains:
Reduce[(x ^ 4 - 1)(x ^ 4 - 4) == 0, x, Complexes]Reduce[(x ^ 4 - 1)(x ^ 4 - 4) == 0, x, Reals]Reduce[(x ^ 4 - 1)(x ^ 4 - 4) == 0, x, Integers]The solution set may depend on symbolic parameters:
Reduce[a x ^ 2 + b x + c == 0, x]Representing solutions may require introduction of new parameters:
Reduce[Sin[x] == 1 / 2, x]Reduce[x ^ 2 - 2y ^ 2 == 1 && x > 0 && y > 0, {x, y}, Integers]% /. Table[{C[1] -> i}, {i, 10}]//SimplifyComplex Domain (16)
Reduce[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}]A univariate polynomial equation:
Reduce[x ^ 3 - 2x + 1 == 0, x]A multivariate polynomial equation:
Reduce[x ^ 2 - y z == 1, {x, y, z}]Systems of polynomial equations and inequations can always be reduced:
Reduce[x ^ 2 + y ^ 3 == z && x + 2y == 3z + 1 && x y z ≠ 0, {x, y, z}]A quantified polynomial system:
Reduce[ForAll[x, Exists[y, a x ^ 2 + b y ^ 2 - 3y == 1 && y ≠ 0]], {a, b}]Reduce[Sqrt[x + 2y] - 3x + 4y == 5 && x + y ^ (1 / 3) == 1, {x, y}]Transcendental equations solvable in terms of inverse functions:
Reduce[Sin[x] == 1 / 3, x]Reduce[ 4 ^ (x ^ 2)2 ^ x == 8, x]In this case there is no solution:
Reduce[Log[x] == 75 / 11 I Pi + 17, x]Equations involving elliptic functions:
Reduce[JacobiSN[x, y] == 1, x]Equations solvable using special function zeros:
Reduce[Zeta[x] == 0, x]Solving this system does not require the Riemann hypothesis:
Reduce[Zeta[x] == 0 && Re[x] == 1 / 2 && Im[x] ^ 2 < 500, x]Elementary function equation in a bounded region:
Reduce[Sin[E ^ x] - Cos[2 x] == 1 && -1 ≤ Re[x] ≤ 1 && -1 ≤ Im[x] ≤ 1, x]Holomorphic function equation in a bounded region:
Reduce[Gamma[x] - Log[x] == I / 2 && Abs[x - 2] < 3 / 2, x]Here Reduce finds some solutions but is not able to prove there are no other solutions:
Reduce[x == E ^ (1 / x) && Abs[x] < 5, x]Equation with a purely imaginary period over a vertical stripe in the complex plane:
Reduce[Cos[Exp[x]] == 3 Exp[-x] + 1 && 0 ≤ Re[x] ≤ 1, x]Doubly periodic transcendental equation:
Reduce[JacobiCS[x, 3] == 1 + I, x]A system of transcendental equations solvable using inverse functions:
Reduce[Sin[x + y] == 1 / 2 && E ^ x - y == 1, {x, y}]A square system of analytic equations over a bounded box:
Reduce[FresnelS[x - y] - AiryAi[x] + y == (3 + I) / 2 && CosIntegral[x] y - Sin[x y] == -5(1 - I) / 4 && 1 ≤ Re[x] ≤ 2 && 0 ≤ Im[x] ≤ 1 && 1 ≤ Re[y] ≤ 2 && 0 ≤ Im[y] ≤ 1, {x, y}]Real Domain (26)
Reduce[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}, Reals]A univariate polynomial equation:
Reduce[x ^ 5 - 2x + 1 == 0, x, Reals]A univariate polynomial inequality:
Reduce[x ^ 5 - 2x + 1 < 0, x, Reals]A multivariate polynomial equation:
Reduce[x ^ 2 - y z == 1, {x, y, z}, Reals]A multivariate polynomial inequality:
Reduce[x ^ 2 - 2y + z ^ 2 ≤ 1, {x, y, z}, Reals]Systems of polynomial equations and inequalities can always be reduced:
Reduce[x ^ 2 + y z == 1 && x + 2y ≤ 3z + 1 && x y z > 7, {x, y, z}, Reals]A quantified polynomial system:
Reduce[ForAll[x, Exists[y, a x ^ 2 + b y ^ 2 - 3y == 1 && y < 0]], {a, b}, Reals]Reduce[Sqrt[x + 2y] - 3x + 4y ≥ 5 && x + y ^ (1 / 3) == 1, {x, y}, Reals]Reduce[Abs[(x + Abs[x + 2]) ^ 2 - 1] ^ 2 == 9, x, Reals]Reduce[Max[x, y] == Min[y ^ 2 - x, x], {x, y}]Reduce[Abs[3x ^ 2 - 7x - 6] < Abs[x ^ 2 + x], x, Reals]Reduce[Floor[x ^ 2 + Ceiling[x ^ 2]] < 10, x, Reals]Transcendental equations, solvable using inverse functions:
Reduce[E ^ x - x == 7, x, Reals]Reduce[ 27^2x - 1^(1/(x)) == Sqrt[9^2x - 1], x, Reals]Transcendental inequalities, solvable using inverse functions:
Reduce[Sin[x] < 1 / 3, x, Reals]Reduce[ (1/2^x - 1) > (1/1 - 2^x - 1), x, Reals]Inequalities involving elliptic functions:
Reduce[1 < JacobiNC[x, 3] ≤ 2, x, Reals]Transcendental equation, solvable using special function zeros:
Reduce[AiryBi[1 - x ^ 2] == 0 && 99 < x < 100, x, Reals]Transcendental inequality, solvable using special function zeros:
Reduce[900 < AiryAiZero[2t + 1] ^ 2 < 1000, t, Reals]Reduce[E ^ (2E ^ x) - Log[x ^ 2 + 1] - 20x == 11, x, Reals]High-degree sparse polynomial equation:
Reduce[x ^ 1000000 - 2x ^ 777777 + 3x ^ 12345 + 9x ^ 67 - 10 == 0, x, Reals]Algebraic equation involving high-degree radicals:
Reduce[2x ^ (123451 / 67890) - x ^ 2 + 4Sqrt[x] - 4x - 9 / 8 == 0, x, Reals]Equation involving irrational real powers:
Reduce[x ^ Pi - x ^ x ^ Sqrt[2] - Sqrt[3]x + 2 ^ (1 / 3) == 0, x, Reals]Reduce[E ^ (2E ^ x) - Log[x ^ 2 + 1] - 20x < 11, x, Reals]Elementary function equation in a bounded interval:
Reduce[2Sin[Exp[x]] - Cos[Pi x] == 3 / 2 && -1 < x < 1, x, Reals]Holomorphic function equation in a bounded interval:
Reduce[Cos[x] - BesselJ[5, x] == 1 / 2 && 0 ≤ x ≤ 10, x]Meromorphic function inequality in a bounded interval:
Reduce[Gamma[x] ≤ 2x && -2 ≤ x ≤ 2, x, Reals]Periodic elementary function equation over the reals:
Reduce[Exp[Sin[x]] - Sin[3 Cos[x]] == 0, x, Reals]Transcendental systems solvable using inverse functions:
Reduce[Sin[x + y] == 1 / 2 && E ^ x - y ≤ 1, {x, y}, Reals]Reduce[ 3^x - 2^2y == 77 && Sqrt[3^x] - 2^y == 7, {x, y}, Reals]Systems exp-log in the first variable and polynomial in the other variables:
Reduce[E ^ x y ^ 3 + Log[x]y == 1 && x y + E ^ x / x ≥ 2, {x, y}, Reals]Reduce[E ^ x y ^ 3 + Log[x] y > 3x, {x, y}, Reals]Reduce[Exists[a, a x ^ 2 + Sinh[x ^ 2 + 1]a ^ 2 ≥ 1 && x ^ 2 + a ^ 2 ≤ 1], x, Reals]Systems elementary and bounded in the first variable and polynomial in the other variables:
Reduce[Sin[x - Cos[x]] y ^ 3 - x == 1 && x ^ 2 + y ^ 2 ≤ 1, {x, y}, Reals]Reduce[Exists[y, y ^ 3 - Cos[x] y + 2 x ^ 2 Sin[x ^ 2 - 1] > 0 && x ^ 2 + Cos[x] ^ 2 ≤ 2], x, Reals]Systems analytic and bounded in the first variable and polynomial in the other variables:
Reduce[y ^ 3 - BesselJ[2, x + 2] y - y - 3 x == -2 && y < 0 && x ^ 2 < 2, {x, y}, Reals]Reduce[Exists[y, y ^ 4 - Gamma[x + 2] y - y - 3 ArcSin[x / 3] == 1 && y < -1 / 2 && 0 < x < 2], x, Reals]Square systems of analytic equations over bounded regions:
Reduce[Gamma[x + y + 1] - Sin[x y] == 1 && Erf[x ^ 2 - y] - E ^ y - x + 4 == 0 && 0 < x < 3 && 0 < y < 3, {x, y}, Reals]Integer Domain (13)
Reduce[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}, Integers]A linear system of equations and inequalities:
Reduce[2 x + 3y == 4 && 3x - 4y ≤ 5 && x - 2y > -21, {x, y, z}, Integers]A univariate polynomial equation:
Reduce[x ^ 1000 - 2x ^ 777 + 1 == 0, x, Integers]A univariate polynomial inequality:
Reduce[x ^ 5 - 2x + 1 < 0, x, Integers]Reduce[x ^ 2 + x y + y ^ 2 == 109, {x, y}, Integers]Reduce[x ^ 2 - 3y ^ 2 == 22 && x > 0 && y > 0, {x, y}, Integers]Reduce[x ^ 2 - 6 x y + 9y ^ 2 - x + 2y == 1, {x, y}, Integers]Reduce[x ^ 3 - 2x ^ 2 y + y ^ 3 == 2, {x, y}, Integers]Reduce[x ^ 2 + 4y ^ 2 + 9z ^ 2 + 16t ^ 2 == 354 && x > 0 && y > 0 && z > 0 && t > 0, {x, y, z, t}, Integers]Reduce[x ^ 2 + y ^ 2 == z ^ 2, {x, y, z}, Integers]A bounded system of equations and inequalities:
Reduce[x ^ 4 + y ^ 4 + z ^ 4 ≤ 500 && x + y ^ 2 + z ^ 3 == 32, {x, y, z}, Integers]A high-degree system with no solution:
Reduce[2x ^ 7 + 8y ^ 15 + 14 x y z == 3, {x, y, z}, Integers]Transcendental Diophantine systems:
Reduce[Exp[y ^ 2] < x && Abs[x] < 5 && Abs[y] < 5, {x, y}, Integers]Reduce[Exp[x ^ 2 - 5y ^ 2 + 1] + x ^ 2 - 5y ^ 2 == 0 && x > 0 && y > 0, {x, y}, Integers]A polynomial system of congruences:
Reduce[Mod[x ^ 2 + y ^ 2, 2] == 1 && Mod[x - 2y, 3] == 2, {x, y}, Integers]Diophantine equations with irrational coefficients:
Reduce[GoldenRatio x ^ 2 - Sqrt[5] y ^ 2 - z == Sqrt[5], {x, y, z}, PositiveIntegers]Reduce[Pi x ^ 2 + Sqrt[6]x y - Sqrt[3] y ^ 3 + Pi ^ 2 Sqrt[3] y ^ 2z ^ 2 - 3Sqrt[3] y z == Sqrt[2(109 + 12Sqrt[3])] + 4Pi + 144Sqrt[3]Pi ^ 2 - Sqrt[2] - 63 Sqrt[3], {x, y, z}, Integers]Modular Domains (5)
Reduce[2 x + 3y - 5z == 1 && 3x - 4y + 7z == 3, {x, y, z}, Modulus -> 12]A univariate polynomial equation:
Reduce[x ^ 3 - 2x + 1 == 0, x, Modulus -> 5]A multivariate polynomial equation:
Reduce[x ^ 2 - y z == 1, {x, y, z}, Modulus -> 4]A system of polynomial equations and inequations:
Reduce[x ^ 2 + y ^ 3 == z && x + 2y == 3z + 1 && x y z ≠ 0, {x, y, z}, Modulus -> 7]Reduce a quantified polynomial system:
Reduce[ForAll[x, Exists[y, a x ^ 2 + b y ^ 2 - 3y == 1 && y ≠ 0]], {a, b}, Modulus -> 3]Finite Field Domains (4)
ℱ = FiniteField[53, 4];
Reduce[x ^ 5 + ℱ[123]x == ℱ[234], x]Reduce[x ^ 7 + 2 x + 3 == 0, x, ℱ]ℱ = FiniteField[71, 2];
Reduce[ℱ[123]x + ℱ[234]y == ℱ[345] && ℱ[321]x + ℱ[432]y == ℱ[543], {x, y}]Reduce[ℱ[1234]x + ℱ[2345]y + ℱ[3456]z == ℱ[4567] && ℱ[1]x + ℱ[2]y + ℱ[3]z == ℱ[4], {x, y, z}]Systems of polynomial equations:
ℱ = FiniteField[7, 5];
Reduce[x ^ 2 + y ^ 2 == 3 && x ^ 5 + y ^ 5 == 5, {x, y}, ℱ]Reduce[ℱ[123]x ^ 2 + ℱ[234]y ^ 3 + ℱ[345]z ^ 4 == ℱ[456] && ℱ[21]x + ℱ[32]y ^ 2 + ℱ[43]z ^ 3 == ℱ[54] && x y z == ℱ[1], {x, y, z}]Systems involving quantifiers:
ℱ = FiniteField[2, 5];
Reduce[Exists[z, ℱ[1]x + ℱ[3]y + ℱ[5]z == ℱ[7] && ℱ[21]x + ℱ[23]y + ℱ[25]z == ℱ[27]], {x, y}]Reduce[Exists[{y, z}, ℱ[1]x ^ 2 + ℱ[2]y ^ 3 + ℱ[3]z ^ 4 == ℱ[4] && ℱ[5]x ^ 4 + ℱ[6]y ^ 3 + ℱ[7]z ^ 2 == ℱ[8] && x y z != ℱ[0]], x]Mixed Domains (4)
Mixed real and complex variables:
Reduce[x ^ 2 + y ^ 2 == 1 && Element[x, Reals], {x, y}]Find real values of
and complex values of
for which
is real and less than
:
Reduce[x ^ 2 + y ^ 2 < 1 && Element[x, Reals], {x, y}, Complexes]Reduce an inequality involving Abs[x]:
Reduce[1 < Abs[ (z - 2/2z - 1)] < 2, z]Block[{z = u + I v}, RegionPlot[1 < Abs[ (z - 2/2z - 1)] < 2, {u, -1, 1}, {v, -1, 1}]]Mixed integer and real variables:
Reduce[x ^ 2 + y ^ 2 < 5 && Element[x, Integers], {x, y}, Reals]Geometric Regions (10)
Constrain variables to basic geometric regions in 2D:
Subscript[ℛ, 1] = Circle[];
Subscript[ℛ, 2] = Line[{{-2, 1}, {1, -2}}];Reduce[{x, y}∈Subscript[ℛ, 1] && {x, y}∈Subscript[ℛ, 2], {x, y}]Graphics[{{Blue, Subscript[ℛ, 1], Subscript[ℛ, 2]}, {Red, Point[{x, y}] //. {ToRules[%]}}}]Constrain variables to basic geometric regions in 3D:
Reduce[2 x + 3 y - 5 z == 1 && 2 x y == z^2 && {x, y, z}∈Sphere[], {x, y, z}, Reals]Show[{ContourPlot3D[{2 x + 3 y - 5 z == 1, 2 x y == z^2}, {x, -1.2, 1.2}, {y, -1.2, 1.2}, {z, -1.2, 1.2}, Mesh -> None, ContourStyle -> Opacity[0.5]], Graphics3D[{{Opacity[0.5], Green, Sphere[]}, {PointSize[Large], Red, Point[{x, y, z} //. {ToRules[%]}]}}]}]Project a 3D region onto the
-
plane:
ℛ = Cone[{{0, 0, 0}, {1, 1, 1}}, 2];Reduce[Subscript[∃, z]{x, y, z}∈ℛ, {x, y}, Reals]RegionPlot[%, {x, -2, 2}, {y, -2, 2}]ℛ = ImplicitRegion[a + 2 b - 3 c ≥ 1 && a b c == 7, {a, b, c}];Reduce[x^2 + y z == 1 && x + 2 y < 3 z + 7 && {x, y, z}∈ℛ, {x, y, z}, Reals]A parametrically defined region:
ℛ = ParametricRegion[{s^2, t^2, s t}, {s, t}];Reduce[x^2 + y^2 + z^2 == 1 && {x, y, z}∈ℛ, {x, y, z}, Reals]ℛ = RegionIntersection[Disk[{0, 0}, 2], Disk[{1, 1}, 2]];Reduce[x^2 == x y + 1 && {x, y}∈ℛ, {x, y}, Reals]The solution of
restricted to the intersection:
Show[{DiscretizeRegion[ℛ], ContourPlot[x^2 == x y + 1, {x, -2, 3}, {y, -2, 3}],
Plot@@{Last[%[[2]]], {x, First[#], Last[#]}, PlotStyle -> Red}& /@ (List@@%[[1]])}]Eliminate quantifiers over a Cartesian product of regions:
ℛ = RegionProduct[Circle[], Circle[]];Reduce[Subscript[∃, {a, b}](4 x y a b == 1 && {x, a, y, b}∈ℛ), {x, y}]Regions dependent on parameters:
Subscript[ℛ, 1] = InfiniteLine[{{2, 0}, {0, t}}];
Subscript[ℛ, 2] = Circle[];Reduce[{x, y}∈Subscript[ℛ, 1] && {x, y}∈Subscript[ℛ, 2], {t, x, y}, Reals]Subscript[ℛ, 1] = Disk[{a, b}];
Subscript[ℛ, 2] = Triangle[{{0, 0}, {0, 5}, {7, 0}}];
Reduce[Subscript[∀, {x, y}, {x, y}∈Subscript[ℛ, 1]]{x, y}∈Subscript[ℛ, 2], {a, b}, Reals]Use
to specify that
is a vector in
:
ℛ = RegionIntersection[Circle[], Line[{{-2, -1}, {1, 2}}]];Reduce[x∈ℛ, x]ℛ = Sphere[];Reduce[x.{1, 2, 3} == 0 && x∈ℛ, x]Options (7)
Backsubstitution (1)
Since y appears after x in the variable list, Reduce may use x to express the solution for y:
Reduce[x ^ 2 + y ^ 2 == 1 && x ^ 2 - y == 2, {x, y}]With Backsubstitution->True, Reduce gives explicit numeric values for y:
Reduce[x ^ 2 + y ^ 2 == 1 && x ^ 2 - y == 2, {x, y}, Backsubstitution -> True]Cubics (1)
GeneratedParameters (1)
Reduce may introduce new parameters to represent the solution:
Reduce[Cos[x] == 1 / 2, x]Use GeneratedParameters to control how the parameters are generated:
Reduce[Cos[x] == 1 / 2, x, GeneratedParameters -> (Subscript[k, #]&)]Method (1)
This locally sets system options in "InequalitySolvingOptions" and "ReduceOptions" groups:
Reduce[y^5 - 3 y^2 + x^5 + 4 == 0 && y^2 + y - x^5 - 3 x - 11 == 0, {x, y}, Reals, Backsubstitution -> True, Method -> {"AlgebraicNumberOutput" -> False}]By default, Reduce uses AlgebraicNumber objects to represent the solution here:
Reduce[y^5 - 3 y^2 + x^5 + 4 == 0 && y^2 + y - x^5 - 3 x - 11 == 0, {x, y}, Reals, Backsubstitution -> True]Modulus (1)
Quartics (1)
By default, Reduce does not use general formulas for solving quartics in radicals:
Reduce[x ^ 4 + 2 x ^ 2 + 3 x + 4 == 0, x]With Quartics->True, Reduce solves all quartics in terms of radicals:
Reduce[x ^ 4 + 2 x ^ 2 + 3 x + 4 == 0, x, Quartics -> True]WorkingPrecision (1)
Finding the solution with exact computations takes a long time:
TimeConstrained[Reduce[x^77 + 3 x - 11 == E && y^5 - x^2 y + 21 == π && x^2 y^3 + z^4 == E^π, {x, y, z}, Reals], 60]With WorkingPrecision->100, Reduce finds a solution fast, but it may be incorrect:
Timing[Reduce[x^77 + 3 x - 11 == E && y^5 - x^2 y + 21 == π && x^2 y^3 + z^4 == E^π, {x, y, z}, Reals, WorkingPrecision -> 100]]Applications (9)
Basic Applications (1)
Prove geometric inequalities for
,
, and
sides of a triangle:
triangle = a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a;
acute = a ^ 2 + b ^ 2 > c ^ 2 && a ^ 2 + c ^ 2 > b ^ 2 && b ^ 2 + c ^ 2 > a ^ 2;
s = 1 / 2(a + b + c);
F = Sqrt[s(s - a)(s - b)(s - c)];Prove an inequality for triangles:
Reduce[ForAll[{a, b, c}, triangle, a b c(a ^ 2 / b ^ 2 + b ^ 2 / c ^ 2 + c ^ 2 / a ^ 2) ≥ a ^ 3 + b ^ 3 + c ^ 3 + a b(b - a) + a c(a - c) + b c(c - b)]]Prove an inequality for acute triangles:
Reduce[ForAll[{a, b, c}, triangle && acute, 27(b ^ 2 + c ^ 2 - a ^ 2) ^ 2(a ^ 2 + c ^ 2 - b ^ 2) ^ 2(a ^ 2 + b ^ 2 - c ^ 2) ^ 2 ≤ (4F) ^ 6]]Polynomial Root Problems (1)
Find conditions for a quartic to have all roots equal:
f[x_] := x ^ 4 + a x ^ 3 + b x ^ 2 + c x + dReduce[Exists[x, f[x] == 0, ForAll[y, f[y] == 0, x == y]], {a, b, c, d}]Using Subresultants:
Reduce[Thread[Drop[Subresultants[f[x], D[f[x], x], x], -1] == 0], {a, b, c, d}, Backsubstitution -> True]Parametrization Problems (1)
Plot a space curve given by an implicit description:
curve = x ^ 2 + y ^ 2 + z ^ 2 == 1 && x ^ 3 + x y ^ 2 == z ^ 2;red = Reduce[curve, {x, y, z}, Reals]bound = N[First[red]]pieces = {x, y, z} //. {ToRules[Rest[red]]}ParametricPlot3D[pieces, {x, First[bound], Last[bound]}]Plot the projection of the space curve on the
-
plane:
proj = Reduce[Exists[z, curve], {x, y}, Reals]bounds = N[First[proj]]pieces2d = {x, y} //. {ToRules[Rest[proj]]}ParametricPlot[pieces2d, {x, First[bounds], Last[bounds]}]Integer Problems (3)
Reduce[x ^ 2 + y ^ 2 == 5 ^ 2 && y > x > 0, {x, y}, Integers]Find a sequence of Pythagorean triples:
Table[Reduce[x ^ 2 + y ^ 2 == z ^ 2 && y > x > 0, {x, y}, Integers], {z, 30}]Find how to pay $2.27 postage with 10-, 23- and 37-cent stamps:
Reduce[a 10 + b 23 + c 37 == 227 && a >= 0 && b >= 0 && c >= 0, {a, b, c}, Integers]The same task can be accomplished with IntegerPartitions:
IntegerPartitions[227, All, {37, 23, 10}]Show that there are only five regular polyhedrons:
Show[PolyhedronData[#], ImageSize -> Tiny]& /@ PolyhedronData["Platonic"]Each face for a regular
-gon contributes
edges, but they are shared, so they are counted twice:
e = (1/2)(n f);Each face for a regular
-gon contributes
vertices, but they are shared, so they are counted
times:
v = (1/m)(n f);Using Euler's formula
, find the number of faces:
Reduce[f - e + v == 2 && m ≥ 3 && n ≥ 3, f, Reals]For this last formula to be well defined, the denominator needs to be positive and an integer:
Reduce[2 m + 2 n - m n > 0 && m ≥ 3 && n ≥ 3, {m, n}, Integers]Hence the following five cases:
{f, e, v} /. f -> -(4 m/-2 m - 2 n + m n) /. FindInstance[2 m + 2 n - m n > 0 && m ≥ 3 && n ≥ 3, {m, n}, Integers, 5]//SortCompare this to the actual counts in PolyhedronData:
Table[{PolyhedronData[p, "FaceCount"], PolyhedronData[p, "EdgeCount"], PolyhedronData[p, "VertexCount"]}, {p, PolyhedronData["Platonic"]}]//SortGeometry Problems (3)
The region ℛ is a subset of if
is true. Show that Disk[{0,0},{2,1}] is a subset of Rectangle[{-2,-1},{2,1}]:
ℛ = Disk[{0, 0}, {2, 1}];
𝒮 = Rectangle[{-2, -1}, {2, 1}];Reduce[Subscript[∀, {x, y}]{x, y}∈ℛ{x, y}∈𝒮, Reals]Graphics[{{LightRed, EdgeForm[Gray], 𝒮}, {LightBlue, EdgeForm[Gray], ℛ}}]Show that Cylinder[]⊆Ball[{0,0,0},2]:
ℛ = Cylinder[];
𝒮 = Ball[{0, 0, 0}, 2];Reduce[Subscript[∀, {x, y, z}]{x, y, z}∈ℛ{x, y, z}∈𝒮, Reals]Graphics3D[{{Opacity[0.3], 𝒮}, {LightBlue, EdgeForm[Gray], ℛ}}]For a finite point set
, the Voronoi cell for a point
can be defined by
, which corresponds to all points closer to
than any other point
for
. Find a simple formula for a Voronoi cell, using Reduce:
pts = {{0, 0}, {1, 0}, {1, 1}, {2, 0}};The Voronoi cell associated with pts〚1〛 is given by:
voronoi1 = And@@Table[EuclideanDistance[pts[[1]], {x, y}] <= EuclideanDistance[pts[[j]], {x, y}], {j, 2, 4}]The resulting cell is given by an intersection of half-spaces:
Reduce[voronoi1, {x, y}, Reals]RegionPlot[%, {x, -1, 1}, {y, -1, 1}]Find simple formulas for all Voronoi cells:
vcells = And@@@Table[EuclideanDistance[pts[[i]], {x, y}] <= EuclideanDistance[pts[[j]], {x, y}], {i, 4}, {j, Complement[Range[4], {i}]}];vscells = Reduce[#, {x, y}, Reals]& /@ vcellsRegionPlot[Evaluate@Table[vscells[[i]], {i, 4}], {x, -1, 3}, {y, -1, 3}, PlotLegends -> SwatchLegend[Map[Style[#, Small]&, vscells]], Epilog -> Point[pts]]Properties & Relations (10)
The result of reduction is equivalent to the original system:
syst = x ^ 2 + y ^ 2 + z ^ 2 ≤ 1 && 2x y > z ^ 2;red = Reduce[syst, {x, y, z}, Reals]SeedRandom[0];Table[{syst, red} /. {x -> RandomReal[{-1, 1}], y -> RandomReal[{-1, 1}], z -> RandomReal[{-1, 1}]}, {10}]ToRules and ReplaceRepeated can be used to backsubstitute finite solution sets:
Reduce[x ^ 2 + y == 1 && x ^ 2 - y ^ 2 == 2, {x, y}]x ^ 2 + y == 1 && x ^ 2 - y ^ 2 == 2 //. {ToRules[%]}Use Expand to simplify a result of substitution involving simple radicals:
Expand[%]To simplify expressions involving algebraic numbers, use RootReduce:
Reduce[x ^ 2 + y ^ 2 == 1 && x ^ 3 - 2y ^ 3 == 3, {x, y}]RootReduce[x ^ 2 + y ^ 2 == 1 && x ^ 3 - 2y ^ 3 == 3 //. {ToRules[%]}]To find solution instances, use FindInstance:
FindInstance[x ^ 2 + y ^ 2 + z ^ 2 ≤ 1 && 2x y > z ^ 2, {x, y, z}, Reals]FindInstance[x ^ 2 - 3y ^ 2 == 1 && 0 < x < 10 ^ 10, {x, y}, Integers, 3]Solve represents solutions of complex equations in terms of replacement rules:
Solve[x ^ 2 + y ^ 2 == 1 && 2x + 3y == 1, {x, y}]Solve omits solutions involving equations on parameters:
Reduce[a x ^ 2 + x == 1, x]Solve[a x ^ 2 + x == 1, x]For transcendental equations, Solve may not give all solutions:
Solve[x + E ^ x == 1 / 2, x]Reduce[x + E ^ x == 1 / 2, x]Using inverse functions allows Solve to find some solutions fast:
Solve[x ^ n == 1, x]//TimingFinding the complete solution may take much longer, and the solution may be large:
(red = Reduce[x ^ n == 1, x])//LeafCount//TimingThis finds the values of
for which x 2 is a solution:
Reduce[red /. x -> 2, n]Simplify[x ^ n /. {x -> 2, n -> 2I Pi C[1] / Log[2]}, Element[C[1], Integers]]SolveAlways gives the values of parameters for which complex equations are always true:
SolveAlways[(a - 2b + 1)x ^ 2 + (a - b ^ 2 - c)x == a ^ 2 - b + 3c - 1, x]This solves the same problem using Reduce:
Reduce[ForAll[x, (a - 2b + 1)x ^ 2 + (a - b ^ 2 - c)x == a ^ 2 - b + 3c - 1], {a, b, c}]Resolve eliminates quantifiers, possibly without solving the resulting quantifier‐free system:
Resolve[Exists[x, x ^ 2 + y ^ 2 + z ^ 2 == 1 && x y > z ^ 3], Reals]Resolve[ForAll[{x, y}, a x ^ 2 + b x + c == 0 && a y ^ 2 + b y + c == 0, x == y]]Eliminate eliminates variables from systems of complex equations:
Eliminate[x ^ 2 + y ^ 2 + z ^ 2 == 1 && x y == z ^ 3, x]This solves the same problem using Resolve:
Resolve[Exists[x, x ^ 2 + y ^ 2 + z ^ 2 == 1 && x y == z ^ 3]]Reduce additionally solves the resulting equations:
Reduce[Exists[x, x ^ 2 + y ^ 2 + z ^ 2 == 1 && x y == z ^ 3], {y, z}]Possible Issues (5)
Because
appears in an inequality, it is assumed to be real;
is allowed to be complex:
Reduce[x ^ 2 < 1 && y - Sqrt[x] == 0, {x, y}]When domain Reals is specified,
,
, and Sqrt[x] are required to be real:
Reduce[x ^ 2 < 1 && y - Sqrt[x] == 0, {x, y}, Reals]This allows complex values of
for which both sides of the inequality are real:
Reduce[x ^ 2 < 1 && y - Sqrt[x] == 0, {x, y}, Complexes]The order of variables may affect solvability of the problem. This is easy to solve for
in terms of
:
Reduce[y == x - Sin[x], {x, y}]Solving for
in terms of
would be much harder:
Reduce[y == x - Sin[x], {y, x}]Reduce does not solve equations that depend on branch cuts of Wolfram Language functions:
Reduce[Sqrt[x + 2y] - x ^ 2 + y - 1 == 0, {x, y}]
Plot the region where the first condition is nonzero:
Block[{x = u + I v}, RegionPlot[Abs[-1 + Sqrt[3 + x + 2 x^2] - Sqrt[4 + x + 2 x^2 - 2 Sqrt[3 + x + 2 x^2]]] > 0.001, {u, -10, 10}, {v, -10, 10}]]Reduce will not find real solutions that fall outside the real domains of subexpressions:
Reduce[z > 0 && Im[HankelH1[0, z]] == 0, z, Reals]Reduce uses FunctionDomain to determine real domains of mathematical functions:
FunctionDomain[HankelH1[0, z], z]FunctionDomain has real domain information that is accurate up to lower-dimensional sets:
Plot[Im[HankelH1[0, z]], {z, -3, 3}]There exist isolated points at which HankelH1[0,z] is real valued:
N[HankelH1[0, BesselYZero[0, 1]], 20]Removable singularities of input equations are generally not considered valid solutions:
Reduce[(x ^ 2 - 2Sqrt[2]x + 2) / (x - Sqrt[2]) == 0, x]Limit[(x ^ 2 - 2Sqrt[2]x + 2) / (x - Sqrt[2]), x -> Sqrt[2]]However, solutions may include removable singularities that are cancelled by automatic simplification:
Reduce[x ^ 2 / x == 0, x]The removable singularity at
is cancelled by evaluation:
x ^ 2 / x == 0Here the removable singularity at
is cancelled by Together, which is used to preprocess the equation:
Reduce[(x ^ 2 - 2x + 1) / (x - 1) == 0, x]Together[(x ^ 2 - 2x + 1) / (x - 1) == 0]Tech Notes
-
▪
- Solving Equations ▪
- Inequalities ▪
- Generic and Non‐Generic Solutions ▪
- Equations and Inequalities over Domains ▪
- Solving Logical Combinations of Equations ▪
- The Representation of Solution Sets ▪
- Complex Polynomial Systems ▪
- Real Polynomial Systems ▪
- Diophantine Polynomial Systems ▪
- Implementation notes: Algebra and Calculus
Related Guides
-
▪
- Manipulating Equations ▪
- Formula Manipulation ▪
- Number Theory ▪
- Computational Geometry ▪
- Polynomial Algebra ▪
- Polynomial Equations ▪
- Diophantine Equations ▪
- Polynomial Systems ▪
- Equation Solving ▪
- Theorem Proving ▪
- Inequalities ▪
- Solvers over Regions ▪
- Solid Geometry ▪
- Plane Geometry ▪
- Finite Fields ▪
- Finite Mathematics ▪
- Polygons ▪
- Polyhedra ▪
- Symbolic Vectors, Matrices and Arrays
History
Introduced in 1988 (1.0) | Updated in 2003 (5.0) ▪ 2014 (10.0) ▪ 2024 (14.0)
Text
Wolfram Research (1988), Reduce, Wolfram Language function, https://reference.wolfram.com/language/ref/Reduce.html (updated 2024).
CMS
Wolfram Language. 1988. "Reduce." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Reduce.html.
APA
Wolfram Language. (1988). Reduce. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Reduce.html
BibTeX
@misc{reference.wolfram_2026_reduce, author="Wolfram Research", title="{Reduce}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Reduce.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_reduce, organization={Wolfram Research}, title={Reduce}, year={2024}, url={https://reference.wolfram.com/language/ref/Reduce.html}, note=[Accessed: 13-June-2026]}