Trident Help

Classic CAS manual · Chapter 7 of 16

Variables, functions and the with bar

Store values, define your own functions, delete them, and substitute values with the with bar.

7.1Store a value in a variable#

A variable name is one or more letters. Store a value with the assign key := (it types :=), or with the store arrow: type the value, press ctrl→:=, then the name. After that the name stands for the value everywhere.

Example 7.1

Store with :=

  1. Type a, press assign, type 5, enter. Then type a², enter.

    a:=5enterax²enter
Result of the example "Store with :=" The display shows: a:=5 / 5 / a² / 25.
You should seea:=5 25
Example 7.2

Store with the arrow

  1. Type 3, press ctrl then assign, type c, enter. Then c × 2.

    3ctrl→:=centerc×2enter
Result of the example "Store with the arrow" The display shows: 3→c / 3 / c·2 / 6.
You should see3→c 6
Example 7.3

Use two variables

  1. Store a and b and add them.

    a:=5enter5ctrl→:=bentera+benter
Result of the example "Use two variables" The display shows: a:=5 / 5 / 5→b / 5 / a+b / 10.
You should see10

7.2Define your own function#

Use Define (menu, 1, 1) to make a function you can reuse. Type Define, the function name with its variable in brackets, an equals sign and the rule. The calculator answers Done. You can then call it with numbers or with symbols.

The Actions menu. The display shows: Actions / 1: Define / 2: Delete Variable / 3: := assign / 4: → store / 5: | with / 6: Clear History.
The Actions menu.
Example 7.4

Define and use f(x)

f(x)=x2+1,f(3)=10f(x)=x^{2}+1,\quad f(3)=10
  1. Press menu, 1, 1. Type f(x)=x²+1 and press enter.

    menu11f(x)=x^2▶+1enter
  2. Type f(3) and press enter.

    f(3)enter
Result of the example "Define and use f(x)" The display shows: Define f(x)=x^2+1 / Done / f(3) / 10.
You should seeDone 10
Example 7.5

Call it with a symbol

  1. Define f then type f(a+1).

    define␣f(x)=x^2▶+1enterf(a+1)enter
Result of the example "Call it with a symbol" The display shows: define f(x)=x^2+1 / Done / f(a+1) / (a+1)^2+1.
You should see(a+1)^2+1
Example 7.6

A function with two variables

  1. Define g(x,y)=xy+1 then find g(2,3).

    define␣g(x,y)=x×y+1enterg(2,3)enter
Result of the example "A function with two variables" The display shows: define g(x,y)=x·y+1 / Done / g(2,3) / 7.
You should see7
Example 7.7

Differentiate a defined function

  1. Define f(x)=x²+1 then take d(f(x),x).

    define␣f(x)=x^2▶+1enterd(f(x),x)enter
Result of the example "Differentiate a defined function" The display shows: define f(x)=x^2+1 / Done / d(f(x),x) / 2·x.
You should see2·x
Example 7.8

Solve with a defined function

  1. Define f(x)=x²−3x then solve f(x)=4.

    define␣f(x)=x^2▶−3xentersolve(f(x)=4,x)enter
Result of the example "Solve with a defined function" The display shows: define f(x)=x^2−3x / Done / solve(f(x)=4,x) / x=-1 or x=4.
You should seex=-1 or x=4

A name of two or more letters followed by a bracket, such as foo(3), is a function call. If no function of that name is defined, it stays as it is. To multiply, type ×: ab·(2). A single letter before a bracket still multiplies: x(x+1) is x·(x+1).

Example 7.9

An undefined function stays as it is

  1. Type foo(3).

    foo(3)enter
Result of the example "An undefined function stays as it is" The display shows: foo(3) / foo(3).
You should seefoo(3)

7.3Delete a variable#

DelVar (menu, 1, 2) removes one variable. Home, 5 removes all of them. The name then goes back to being an ordinary symbol.

Example 7.10

Delete one variable

  1. Store a as 3, then DelVar a.

    a:=3enterdelvar␣aenter
Result of the example "Delete one variable" The display shows: a:=3 / 3 / delvar a / Done.
You should seeDone

7.4Substitute with the with bar#

The with bar (ctrl then ÷) evaluates an expression for particular values without storing them. Write the expression, the bar, then the value as x=3.

Example 7.11

Evaluate at x = 3

x2+1∣x=3=10x^{2}+1\Big|_{x=3}=10
  1. Type x²+1, ctrl ÷, x = 3.

    x^2▶+1ctrl|÷x=3enter
Result of the example "Evaluate at x = 3" The display shows: x^2+1|x=3 / 10.
You should seex^2+1|x=3 10
Example 7.12

Substitute a symbol

  1. Type (x+1)², with bar, x = a.

    (x+1)^2▶ctrl|÷x=aenter
Result of the example "Substitute a symbol" The display shows: (x+1)^2|x=a / (a+1)^2.
You should see(a+1)^2
Example 7.13

Substitute an exact angle

  1. Type sin(x) | x = π/6.

    sin(x)ctrl|÷x=π÷6enter
Result of the example "Substitute an exact angle" The display shows: sin(x)|x=π/6 / 1/2.
You should see1/2

After the bar you can also give a condition such as x>0. A condition keeps only the solutions of solve( (or the zeros of zeros() that satisfy it. Combine a value and a condition with and.

Example 7.14

Keep only the positive solution

  1. Type solve(x²=4, x), the with bar, then x > 0.

    solve(x^2▶=4,x)ctrl|÷xctrl≠≥▸=40enter
Result of the example "Keep only the positive solution" The display shows: solve(x^2=4,x)|x>0 / x=2.
You should seex=2
Example 7.15

Keep the negative zero

  1. Type zeros(x²−4, x) | x < 0.

    zeros(x^2▶−4,x)ctrl|÷xctrl≠≥▸=30enter
Result of the example "Keep the negative zero" The display shows: zeros(x^2−4,x)|x<0 / {-2}.
You should see{-2}

TI-Nspire CX CAS is a trademark of Texas Instruments Incorporated. Trident Calculator is an independent product by South View Studios and is not affiliated with, sponsored by or endorsed by Texas Instruments. The name is used only to describe the kind of calculator this model resembles; Trident's names, keys, display, fonts and software are its own clean-room design.