The | Command


Command Summary

Substitutes a value for a variable temporarily.

Command Syntax


Menu Location

Press the

Calculator Compatibility

This command works on all calculators.

Token Size

1 byte

The | operator (which nobody seems to know how to pronounce, although TI suggests "with") temporarily sets a variable to some value, just for a single evaluation. For example:


Using the | operator doesn't actually affect the value of the variable. However, it will work both if the variable is undefined, and if the variable already has a different value.

Only one | can occur in a single expression: if you have more, this will either cause an error or ignore all but the first substitution, depending on placement. However, one | is enough for any number of variables: just separate the values to use with and:

:x+y|x=2 and y=2

Advanced Uses

The | operator has a more complicated use: rather than giving a specific value for a variable, you might give a condition (or several conditions) for its value, using the >, , <, and operators. This condition will be used if it helps simplify the expression, especially with solve(). For instance:


Weird things can happen if you do this to a variable whose value is already defined, however:



If a complicated expression has a repeating element, you may be able to make the calculation smaller and faster by replacing this repeating element with a variable, for which you substitute the correct value. For example (here the repeating element is √(1-x^2)):


can be


A related trick is to make a substitution with a function, for an operation that has to be done several times in a single line. For example:

can be


Error Conditions

200 - Constraint expression invalid happens when the condition doesn't make sense to the calculator.

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License