ConditionalExpression

ConditionalExpression[expr,cond]

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)

There is a solution only when :

The answer is valid when the condition is satisfied:

Scope  (16)

Conditional solutions:

Parametrized solutions:

Conditionally valid integration results:

Conditionally valid summation results:

Conditionally valid Fourier series:

ConditionalExpression with True or False conditions:

Mathematical functions with ConditionalExpression arguments:

Boolean combinations of equations and inequalities involving ConditionalExpression:

Contradictory conditions:

Inverse of a function with a restricted domain:

Simplify a conditional expression:

Find solutions of equations involving conditional expressions:

Plot a function with a restricted domain:

Piecewise function involving conditional expressions:

Transform a conditionally valid expression:

Conditionally valid expressions in calculus functions:

Properties & Relations  (4)

ConditionalExpression with True condition evaluates to its first argument:

ConditionalExpression with False condition evaluates to Undefined:

ConditionalExpression is propagated from the arguments of mathematical functions:

ConditionalExpression is propagated from the arguments of equations and inequalities:

ConditionalExpression is propagated from the arguments of Boolean functions:

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

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

Possible Issues  (1)

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

ConditionalExpression subexpressions that are not arguments are not used:

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.

CMS

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_conditionalexpression, organization={Wolfram Research}, title={ConditionalExpression}, year={2010}, url={https://reference.wolfram.com/language/ref/ConditionalExpression.html}, note=[Accessed: 21-November-2024 ]}