SolveAlways[eqns,vars]
gives the values of parameters that make the equations eqns valid for all values of the variables vars.
SolveAlways
SolveAlways[eqns,vars]
gives the values of parameters that make the equations eqns valid for all values of the variables vars.
Details and Options
- Equations are given in the form lhs==rhs.
- Simultaneous equations can be combined either in a list or with &&.
- A single variable or a list of variables can be specified.
- SolveAlways works primarily with linear and polynomial equations.
- SolveAlways produces relations between parameters that appear in eqns, but are not in the list of variables vars.
- SolveAlways[eqns,vars] is equivalent to Solve[!Eliminate[!eqns,vars]].
Examples
open all close allBasic Examples (1)
Scope (6)
A univariate polynomial equation:
SolveAlways[(a - b)x ^ 2 + (a ^ 2 - b + 1)x + a - c == 0, x]A multivariate polynomial equation:
SolveAlways[(a - b)x + (a ^ 2 - b + 1)x y + (a d - c + 2)x y z + a b - c d == 0, {x, y, z}]A list of polynomial equations:
SolveAlways[{(a + b - c)x y - (a - d) == 1, (c - d + 2)y == (a ^ 2 - b)x}, {x, y}]An equation involving radicals:
SolveAlways[Sqrt[a x] == Sqrt[b - 1], x]SolveAlways[a x ≠ 1, x]Boolean combinations of equations and inequations:
SolveAlways[(a + b)x + c == 0 && c x - a b ≠ 0, x]SolveAlways[(a + b)x + c == 0 || c x - a b ≠ 0, x]Options (1)
WorkingPrecision (1)
By default, SolveAlways finds exact solutions:
SolveAlways[(a ^ 2 + b ^ 2 - 1)x + a + 2b + 5 == 0, x]This computes the solutions using 20-digit numbers:
SolveAlways[(a ^ 2 + b ^ 2 - 1)x + a + 2b + 5 == 0, x, WorkingPrecision -> 20]Applications (2)
Find a condition for a cubic polynomial to have a triple root:
f[x_] := x ^ 3 + a x ^ 2 + b x + c;
SolveAlways[Implies[f[x] == 0 && f[y] == 0, x == y], {x, y}]This solves the same problem using Reduce:
Reduce[ForAll[{x, y}, Implies[f[x] == 0 && f[y] == 0, x == y]], {a, b, c}]The same problem can also be solved using Subresultants and Solve:
Solve[Drop[Subresultants[f[x], D[f[x], x], x], -1] == 0, {b, c}]Solve for undetermined coefficients in the series expansion:
y''[x] + 2 y[x] == 0 /. y -> Function[x, Sin[a x]]Series[%, {x, 0, 3}]SolveAlways[%, x]Properties & Relations (1)
Numeric solutions make the equations identically true:
eqns = (a + b - c)x y - (a - d) == 1 && (c - d + 2)y == (a ^ 2 - b)x;
SolveAlways[eqns, {x, y}]eqns /. %An equivalent formulation using Solve and Eliminate:
Solve[!Eliminate[!eqns, {x, y}]]An equivalent formulation using Solve and Resolve:
Solve[Resolve[ForAll[{x, y}, eqns]]]This solves the same problem using Reduce:
Reduce[ForAll[{x, y}, eqns], {a, b, c, d}]Possible Issues (1)
SolveAlways gives generic solutions:
eqns = (a + b)x + c == 0 || c x - a b ≠ 0;
SolveAlways[eqns, x]The equations may not be identically true when parameters satisfy additional equations:
eqns /. %This finds conditions on parameters for which the solutions are not correct:
Resolve[Exists[x, Not[#]]]& /@ %See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), SolveAlways, Wolfram Language function, https://reference.wolfram.com/language/ref/SolveAlways.html.
CMS
Wolfram Language. 1988. "SolveAlways." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SolveAlways.html.
APA
Wolfram Language. (1988). SolveAlways. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SolveAlways.html
BibTeX
@misc{reference.wolfram_2026_solvealways, author="Wolfram Research", title="{SolveAlways}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/SolveAlways.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_solvealways, organization={Wolfram Research}, title={SolveAlways}, year={1988}, url={https://reference.wolfram.com/language/ref/SolveAlways.html}, note=[Accessed: 13-June-2026]}