WOLFRAM

is a symbolic construct that represents the expression expr when the condition cond is True.

Details

  • ConditionalExpression[expr,True] evaluates to expr.
  • ConditionalExpression[expr,False] evaluates to Undefined.
  • ConditionalExpression is automatically propagated from the arguments of mathematical functions, equations and inequalities, and Boolean operators, i.e. h[ConditionalExpression[e1,c1],ConditionalExpression[e2,c2],] is transformed to ConditionalExpression[h[e1,e2,],c1&&c2&&].
  • If a function takes assumptions, then the conditional part of ConditionalExpression arguments gets added to the assumptions.
  • Algebraic transformation functions applied to a conditional expression apply to the first argument.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

There is a solution only when :

Out[1]=1

The answer is valid when the condition is satisfied:

Out[1]=1

Scope  (16)Survey of the scope of standard use cases

Conditional solutions:

Out[1]=1

Parametrized solutions:

Out[1]=1

Conditionally valid integration results:

Out[1]=1

Conditionally valid summation results:

Out[1]=1

Conditionally valid Fourier series:

Out[1]=1

ConditionalExpression with True or False conditions:

Out[1]=1
Out[2]=2

Mathematical functions with ConditionalExpression arguments:

Out[1]=1

Boolean combinations of equations and inequalities involving ConditionalExpression:

Out[1]=1

Contradictory conditions:

Out[1]=1

Inverse of a function with a restricted domain:

Out[1]=1

Simplify a conditional expression:

Out[1]=1

Find solutions of equations involving conditional expressions:

Out[1]=1

Plot a function with a restricted domain:

Out[1]=1

Piecewise function involving conditional expressions:

Out[1]=1

Transform a conditionally valid expression:

Out[1]=1
Out[2]=2

Conditionally valid expressions in calculus functions:

Out[1]=1
Out[2]=2
Out[3]=3

Properties & Relations  (4)Properties of the function, and connections to other functions

ConditionalExpression with True condition evaluates to its first argument:

Out[1]=1

ConditionalExpression with False condition evaluates to Undefined:

Out[2]=2

ConditionalExpression is propagated from the arguments of mathematical functions:

Out[1]=1

ConditionalExpression is propagated from the arguments of equations and inequalities:

Out[2]=2

ConditionalExpression is propagated from the arguments of Boolean functions:

Out[3]=3

For functions taking the Assumptions option, argument conditions are used as assumptions:

Out[1]=1

Refine, Simplify, and FullSimplify use the conditions to transform the values:

Out[1]=1

Possible Issues  (1)Common pitfalls and unexpected behavior

For functions taking the Assumptions option, argument conditions are used as assumptions:

Out[1]=1

ConditionalExpression subexpressions that are not arguments are not used:

Out[2]=2
Wolfram Research (2010), ConditionalExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/ConditionalExpression.html.
Wolfram Research (2010), ConditionalExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/ConditionalExpression.html.

Text

Wolfram Research (2010), ConditionalExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/ConditionalExpression.html.

Wolfram Research (2010), ConditionalExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/ConditionalExpression.html.

CMS

Wolfram Language. 2010. "ConditionalExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ConditionalExpression.html.

Wolfram Language. 2010. "ConditionalExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ConditionalExpression.html.

APA

Wolfram Language. (2010). ConditionalExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConditionalExpression.html

Wolfram Language. (2010). ConditionalExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConditionalExpression.html

BibTeX

@misc{reference.wolfram_2025_conditionalexpression, author="Wolfram Research", title="{ConditionalExpression}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ConditionalExpression.html}", note=[Accessed: 14-May-2025 ]}

@misc{reference.wolfram_2025_conditionalexpression, author="Wolfram Research", title="{ConditionalExpression}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ConditionalExpression.html}", note=[Accessed: 14-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_conditionalexpression, organization={Wolfram Research}, title={ConditionalExpression}, year={2010}, url={https://reference.wolfram.com/language/ref/ConditionalExpression.html}, note=[Accessed: 14-May-2025 ]}

@online{reference.wolfram_2025_conditionalexpression, organization={Wolfram Research}, title={ConditionalExpression}, year={2010}, url={https://reference.wolfram.com/language/ref/ConditionalExpression.html}, note=[Accessed: 14-May-2025 ]}