← Back to PAE Bird

PAE Bird — Command Reference

One syntax, everywhere: the Mac app, Excel, Google Sheets, and LibreOffice all use the same command engine. Type expressions one per line, then apply a mode.

Using Excel? A couple of things work differently there — jump straight to §10.
Tip: Plain expressions are expanded by default. No prefix needed for basic polynomial multiplication and simplification.
Tip: To generate a practice worksheet, use the Worksheet button (Mac app toolbar) or the Generate Worksheet option (Excel/LibreOffice task pane).
Tip: Append ! to any whole number for its factorial, in any mode — e.g. 3!+2 expands to 8, 5!=x solves to x = 120. A decimal or a bare variable before ! is left untouched.
Tip: Matrices use bracket notation, e.g. [[1,2],[3,4]], and are recognized directly — no mode switch needed, in any mode, the same way ! is. See §5.

1. Plain Expressions

Just type the expression. PAE Bird expands and simplifies it.

(x + 1)(x + 2)
2x^2y - 3xy^2
(a - b)^3

2. @: Mode Switch (affects all following lines)

Place a mode switch on its own line. Every line after it uses that mode until you switch again.

CommandMode
@:expandExpand (default)
@:expandcComprehensive expand
@:factorFactor
@:solveSolve algebraic equations
@:solveexpSolve exponential equations
@:solvelogSolve logarithmic equations
@:differentiate [var]Differentiate (default variable: x)
@:integrate [var]Integrate (default variable: x)
@:sciScientific notation
@:degtoradDegrees → radians
@:balanceBalance chemical equations
@:logtoexpLog → exponential form
@:exptologExponential → log form
@:trigonometricTrigonometric mode
@:conicConic sections
@:radicalRadical simplification
@:rationalRational expressions
@:composeFunction composition
@:inverseInverse functions
@:domainDomain
@:rangeRange
@:systemSolve a system of linear equations (semicolon-separated)
@:inequalitySolve an inequality
@:canonCanonical form — reorders terms by descending degree, then alphabetically
@:rotateSwap the two sides of an equation
@:flipNegate every term on both sides of an equation
@:sqrtSimplify a square root expression
@:radtodegRadians → degrees
@:oxstateOxidation states of a chemical formula
@:setval <var=val ...>Set one or more variable values, substituted into every following line until cleared or reassigned — e.g. @:setval x=3 y=1/2. Unassigned variables stay symbolic. See §6.
@:clearvalClear all variable values set by @:setval.
@:csv2bracketCSV cell → matrix bracket notation
@:bracket2csvMatrix bracket notation → CSV cell
@:scmS <code> / @:scmL <code>Run your own Chez Scheme code against each line's data. See §11.
@:showwork on/offPlanned — not yet implemented. Will show step-by-step work for whichever mode is active.

3. @@: One-Line Override

Apply a mode to just one line without changing the current mode. @@:setval is the one exception that takes a leading var=val ... list before its expression — every other mode takes just the expression, no separate variable argument (e.g. an inline differentiate/integrate variable isn't supported this way; use the persistent @:differentiate y form for that).

CommandExample
@@:<mode> <expr>@@:factor x^2 + 5x + 6
@@:setval <var=val ...> <expr>@@:setval x=3 x^2 + 1 → substitutes into just this one line, no persistence.
@@:<mode>ç <expr>@@:factorç x^2 - 9 → the next-line trigger (§7) works here too, for just this one line.

4. Example Session

# Polynomial expansion (default — no prefix needed)
(x + 1)(x + 2)
(a - b)^3

# Switch to factoring for a block
@:factor
x^2 - 9
x^3 - 8

# One-off factor without switching mode back
@:expand
(x - 2)(x + 5)
@@:factor x^2 + 7x + 12

# Calculus
@:differentiate x
x^3 + 2x^2 - 5x + 1

@:integrate x
x^4 - 3x^2

# Equations
@:solve
3x - 7 = 11
x^2 - 4 = 0

# Exponential / log
@:solveexp
2^x = 16

@:solvelog
log_3(x) = 4

# Chemistry
@:balance
Fe + O2 = Fe2O3

# Scientific notation (integers only, under 1 billion)
@:sci
299792458

# Matrices (recognized directly from bracket notation -- no mode switch needed)
det([[1,2],[3,4]])
inverse([[1,2],[3,4]])
[[1,2],[3,4]]+[[5,6],[7,8]]
3x*[[1,2],[3,4]]
det([[x,1],[2,y]])

# Factorial (works in any mode, not just expand)
@:expand
3! + 2

# Variable substitution -- persists until cleared or reassigned
@:setval x=3 y=1/2
x^2 + y
@:clearval

# Next-line trigger -- answer goes on the line/cell below instead of alongside.
# The ç lives on the mode switch itself, applying to every line under it.
@:solveç
x + 5 = 12
@:solve

# Your own Scheme code
@:scmL (reverse data)
x+1

5. Matrices

Matrices use bracket notation, e.g. [[1,2],[3,4]], and are recognized directly from the input in any mode — no mode switch needed, the same way ! (factorial) already works everywhere. A matrix is a full citizen of ordinary algebra now: cells may hold variables and expressions (not just numbers), a matrix can be scaled by a whole polynomial expression rather than just a bare number, and matrices nest freely inside parentheses alongside everything else.

OpSyntaxExample
AddmatrixA+matrixB[[1,2],[3,4]]+[[5,6],[7,8]]
SubtractmatrixA-matrixB[[5,6],[7,8]]-[[1,2],[3,4]]
MultiplymatrixA*matrixB[[1,2],[3,4]]*[[5,6],[7,8]]
Scalar multiplyk*matrix or matrix*kk can be a full expression, not just a number3*[[1,2],[3,4]], or 3x*[[1,2],[3,4]][[3x,6x],[9x,12x]]
Powermatrix^n (square matrices only)[[1,2],[3,4]]^2[[7,10],[15,22]]
Transposetranspose(matrix)transpose([[1,2,3],[4,5,6]])
Determinantdet(matrix) — works symbolically toodet([[1,2],[3,4]]), or det([[x,1],[2,y]])xy-2
Inverseinverse(matrix) — works symbolically tooinverse([[1,2],[3,4]])
Row reducerref(matrix) — works symbolically toorref([[1,2,3],[4,5,6]])

A bare matrix on its own (just [[1,2],[3,4]], no operator or function) is validated and reformatted. Cell values may be integers, decimals, fractions (e.g. 3/4), or genuine algebraic expressions — a variable, a sum, even a rational expression like 1/(x-2) — and always print back exactly, never rounded to a decimal. Dimension mismatches, non-square/singular inputs, and invalid combinations (e.g. adding a matrix to a plain number) all report a clear error rather than crashing.

A matrix result isn't a plain number, so a whole-line matrix expression is returned directly, regardless of whatever @: mode happens to be active — but det(...)'s numeric result composes normally into a larger expression, exactly like !: det([[1,2],[3,4]])+5 expands to 3.

Matrices nest anywhere an ordinary expression does, not just at the top level — e.g. (x+1)*([[x,0],[0,4]]) expands to [[x^2+x,0],[0,4x+4]].

det/inverse/rref on a matrix with variable entries always produce an exact symbolic result — determinant via cofactor expansion, inverse/row-reduction by picking pivots the way a first linear-algebra course would for a matrix with a parameter: a cell only counts as zero if it's zero for every value of its variables, so e.g. a cell like x-2 (zero at just one point) is still treated as a usable pivot.

Tip: @:csv2bracket / @:bracket2csv convert between bracket notation and a single quoted CSV cell, for pasting a matrix result into a spreadsheet row alongside other data. A dedicated matrix-only CSV or .xlsx file (a real Excel file — cells keep their exact values, e.g. 3/4, rather than a decimal or a misread date) can be imported/exported directly from the command line.

6. Variable Substitution — @:setval / @:clearval

@:setval takes one or more space-separated var=val pairs and substitutes those known values into every following line, leaving any variable without an assigned value symbolic. Values may be integers, decimals, or fractions (e.g. 1/2). A later @:setval adds to or overwrites the current values rather than replacing the whole set; @:clearval resets it to empty. Values persist across a mode switch (@:factor, @:solve, etc.) — only @:clearval or reassigning the same variable changes them.

@:setval x=3 y=1/2
x^2 + y        # -> 19/2
2x - 1         # -> 5
a + x          # -> a stays symbolic, only x substitutes -> a+3
@:clearval
x^2 + y        # -> x^2 + y, unchanged

For a one-off substitution without switching the persistent set, use the @@:setval one-line override (§3) or, from the API/command line, the standalone setval command: compute setval "x=3" "x^2+1".

7. Next-Line Trigger — ç

Prefix or suffix a mode-switch command with ç (c-cedilla, U+00E7) to place every following line's computed answer on the next line/cell instead of alongside the problem — e.g. in a spreadsheet, the formula's own cell shows the problem text and the result spills into the cell below. The marker lives on the command, not the expression — so it applies to every line under that mode switch, not just one, and never has to be stripped back out of an expression before it's parsed.

@:solveç
x + 5 = 12        # -> this cell shows "x + 5 = 12", "x = 7" appears one row below
x - 3 = 9          # -> still triggered, same mode
@:solve            # drop the ç to go back to normal (in-place) mode

8. Answer Chaining — ;:command

Suffix an expression with ;: followed by a mode name to run that expression under the active mode, then feed its result into another mode — chain as many as you like: expr;:factor;:expand runs expr under the current mode, factors that result, then re-expands it. Leave the expression off entirely (start the line with ;:) to chain off the running Ans register instead — the last successful result, carried forward across lines in the Mac app and spreadsheet add-ins, or passed explicitly as a fifth argument from the API/command line.

@:expand
(x+1)(x+2)          # -> x^2+3x+2
;:factor              # -> chains off the line above -> (x+1)(x+2)

x^2 - 9;:factor;:expand   # -> factor(x^2-9), then re-expand it -> x^2-9

Only the final step in a chain (or a plain expression with no ;: at all) may return a multi-value result like solve or system — a mid-chain step that does reports Error: cannot chain from a multi-value result, since there's no single value left to feed forward. This applies to the line's own active mode too: under @:solve, x+5=12;:expand errors the same way ;:solve;:expand would.

From the API/command line, the standalone compute command takes the Ans value as an optional fifth argument, since each call is stateless and has no memory of a previous one: compute expand "" "x^2-9;:factor" 0.

;:scmS and ;:scmL (§11) are a special case: instead of applying a fixed built-in mode, they run whichever Scheme program you most recently set with @:scmS <code>/@:scmL <code> — that program stays available for chaining even after switching to a different @: mode in between.

9. Indexed Variables & Superscript/Subscript Display

A lowercase letter followed by _ and a digit, single letter, or parenthesized expression is a genuinely distinct indexed variable — x_1 and x_2 are different symbols, not just different-looking text, and combine/expand correctly like any other variable. Parenthesized subscripts are normalized, so x_(1+x) and x_(x+1) refer to the same variable.

x_1 + x_2 + x_1     # -> 2x_1 + x_2
(x_1)^2 * x_1        # -> x_1³

Results are displayed with real Unicode superscript/subscript characters — ^exponent and _subscript notation in output is rendered as e.g. x², x_1 → x₁ — no special input needed, this happens automatically to every result. These characters are also accepted as input — copy a previous answer like x²+1 straight back into a new line (or type ²/ directly) and it parses exactly like x^2+1.

10. How Excel Differs

Excel Custom Functions have two hard platform constraints the Mac app, Google Sheets, and LibreOffice don't: a function can never write to any cell besides its own, and a function's name can't change per call. Two things in this reference work differently in Excel as a result.

FeatureEverywhere elseExcel
Next-line triggerç on a mode switch (§7): @:factorçA separate function name per scalar op: PAE.FACTOR_N(...) instead of PAE.FACTOR(...) — one _N variant exists for every scalar function. Matrix functions (PAE.MATRIXADD and friends) don't have _N variants — they take cell ranges, not typed expressions, so ç has no meaning there.
Where the answer landsThe next line/cell, as a plain value immediatelyPAE.FACTOR_N(...) spills the answer into the cell below via Excel's own dynamic-array mechanism. While the PAE Bird task pane is open, that spilled cell is automatically converted to a plain, independently-editable value shortly after — matching Copy → Paste Special → Values — since Excel otherwise always shows a spilled cell's formula grayed out and non-editable. The formula cell itself keeps its live formula either way. If the task pane is closed, the spilled cell just stays as a live spill result until it's reopened.
=PAE.FACTOR_N("x^2-9")   # formula cell keeps this exact formula
                          # cell below shows: (x-3)(x+3)

11. Run Your Own Scheme Code — @:scmS / @:scmL

Write your own Chez Scheme program and run it against a line's data, converted to a plain symbol list bound to data — the same representation PAE Bird uses internally for a polynomial. PAE Bird's own commands (expand, factor, solve, etc.) are not available inside your program — it runs in a genuinely isolated Scheme environment operating purely on data, not a way to call PAE Bird's own operations by another name.

CommandOutput
@:scmS <code>Renders the result back like a normal solution, e.g. 3x^2/5+x
@:scmL <code>Prints the raw Scheme value, e.g. (x + 1 +)
@:scmL (reverse data)
x+1                 # -> (+ 1 + x)

Set your program once with @:scmS <code>/@:scmL <code>, then every following line's data runs through it, exactly like any other mode switch. Every form you write runs in order — define a helper, then call it, and the last form's value becomes the result. data is a mix of numbers and symbols (operators, variables), so a helper that assumes every element is a number (e.g. doubling each one) needs to filter first:

@:scmL (define (numbers-only l) (filter number? l)) (numbers-only data)
x+1                 # -> (1)

You can also chain a bare ;:scmS or ;:scmL onto any line (§8) to run the same program against that line's own result instead of its own data — the program most recently set with @:scmS/@:scmL stays available for chaining even after switching to a different @: mode in between.