Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
ConditionalExpression
  • See Also
    • Undefined
    • Condition
    • Piecewise
    • Assumptions
    • Solve
    • Integrate
  • Related Guides
    • Conditionals
    • See Also
      • Undefined
      • Condition
      • Piecewise
      • Assumptions
      • Solve
      • Integrate
    • Related Guides
      • Conditionals

ConditionalExpression[expr,cond]

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

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Properties & Relations  
Possible Issues  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • Undefined
    • Condition
    • Piecewise
    • Assumptions
    • Solve
    • Integrate
  • Related Guides
    • Conditionals
    • See Also
      • Undefined
      • Condition
      • Piecewise
      • Assumptions
      • Solve
      • Integrate
    • Related Guides
      • Conditionals

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 all close all

Basic Examples  (2)

There is a solution only when :

Wolfram Language code: Solve[x ^ 2 + y ^ 2 + x == 1, y, Reals]

The answer is valid when the condition is satisfied:

Wolfram Language code: Integrate[x ^ n, {x, 0, 1}]

Scope  (16)

Conditional solutions:

Wolfram Language code: Solve[a x ^ 2 + b x + c == 0, x, Reals]

Parametrized solutions:

Wolfram Language code: Solve[x ^ 2 - 2y ^ 2 == 1 && x > 0 && y > 0 , {x, y}, Integers]

Conditionally valid integration results:

Wolfram Language code: Integrate[Exp[x ^ a], {x, 0, 1}]

Conditionally valid summation results:

Wolfram Language code: Sum[1 / n ^ a, {n, ∞}, GenerateConditions -> True]

Conditionally valid Fourier series:

Wolfram Language code: FourierSeries[a ^ x, x, 3, GenerateConditions -> True]

ConditionalExpression with True or False conditions:

Wolfram Language code: ConditionalExpression[a, True]
Wolfram Language code: ConditionalExpression[a, False]

Mathematical functions with ConditionalExpression arguments:

Wolfram Language code: Sin[ConditionalExpression[x, x > 0] + 1] ConditionalExpression[x, x < 1] ^ 2

Boolean combinations of equations and inequalities involving ConditionalExpression:

Wolfram Language code: ConditionalExpression[x, x > 0] ^ 2 == 1 && ConditionalExpression[y, y < 0] > -1

Contradictory conditions:

Wolfram Language code: ConditionalExpression[x, x > 0] + ConditionalExpression[x, x < 0]

Inverse of a function with a restricted domain:

Wolfram Language code: InverseFunction[ConditionalExpression[# ^ 2 + # + 1, # ≤ -1 / 2]&]

Simplify a conditional expression:

Wolfram Language code: Simplify[ConditionalExpression[Sqrt[x ^ 2], x < 0]]

Find solutions of equations involving conditional expressions:

Wolfram Language code: Reduce[ConditionalExpression[x ^ 2 - 1, x > 0] == 0, x]

Plot a function with a restricted domain:

Wolfram Language code: Plot3D[ConditionalExpression[x ^ 2 - y ^ 2, x ^ 2 + y ^ 2 < 1], {x, -1, 1}, {y, -1, 1}]

Piecewise function involving conditional expressions:

Wolfram Language code: Piecewise[{{ConditionalExpression[x + y, x > 0], y > 0}, {x - y, ConditionalExpression[y ≤ 0, y > -1]}}]

Transform a conditionally valid expression:

Wolfram Language code: Expand[ConditionalExpression[(x + y) ^ 2, x - y > 0]]
Wolfram Language code: Factor[%]

Conditionally valid expressions in calculus functions:

Wolfram Language code: Integrate[ConditionalExpression[a ^ x, a > 0], x]
Wolfram Language code: D[%, x]
Wolfram Language code: FourierTransform[ConditionalExpression[x ^ n, n > 0], x, t]

Properties & Relations  (4)

ConditionalExpression with True condition evaluates to its first argument:

Wolfram Language code: ConditionalExpression[a, True]

ConditionalExpression with False condition evaluates to Undefined:

Wolfram Language code: ConditionalExpression[a, False]

ConditionalExpression is propagated from the arguments of mathematical functions:

Wolfram Language code: Sin[ConditionalExpression[x, x > 0]] + 3ConditionalExpression[Cos[x], x < 1] ^ 2

ConditionalExpression is propagated from the arguments of equations and inequalities:

Wolfram Language code: {ConditionalExpression[x ^ 2, x > 0] == 1, ConditionalExpression[x ^ a, a > 0] < 2}

ConditionalExpression is propagated from the arguments of Boolean functions:

Wolfram Language code: ConditionalExpression[p, c] && ( ConditionalExpression[q, d] || r)

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

Wolfram Language code: Limit[ConditionalExpression[a ^ x, 0 < a < 1], x -> Infinity]

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

Wolfram Language code: Refine[{ConditionalExpression[Sqrt[x ^ 2], x > 0], ConditionalExpression[Sqrt[x ^ 2], x < 0]}]

Possible Issues  (1)

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

Wolfram Language code: Residue[Tan[x], ConditionalExpression[{x, (2n + 1) Pi / 2}, Element[n, Integers]]]

ConditionalExpression subexpressions that are not arguments are not used:

Wolfram Language code: Residue[Tan[x], {x, ConditionalExpression[(2n + 1) Pi / 2, Element[n, Integers]]}]

See Also

Undefined  Condition  Piecewise  Assumptions  Solve  Integrate

Related Guides

    ▪
  • Conditionals

History

Introduced in 2010 (8.0)

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_2026_conditionalexpression, author="Wolfram Research", title="{ConditionalExpression}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ConditionalExpression.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_conditionalexpression, organization={Wolfram Research}, title={ConditionalExpression}, year={2010}, url={https://reference.wolfram.com/language/ref/ConditionalExpression.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English