# CAS View

From GeoGebra Manual

Revision as of 10:38, 2 August 2011 by Andrea.duringer (talk | contribs)

## Basic input

- Enter: evaluate input
- Ctrl+Enter: check input but do no evaluate input, e.g. b+b stays b+b. Note that assignments are always evaluated, e.g. a := 5
- In an empty row type
- space bar for previous output
- ) for previous output in parentheses
- = for previous input

- Suppress output with a semicolon at the end of your input, e.g. a := 5;

## Toolbar

- Clicking a button in the toolbar applies a command to the currently edited row
- You can select part of the input text to only apply the operation to this selected part

## Variables

### Assignments & Connection with GeoGebra

- Assignments use the := notation, e.g. b := 5, a(n) := 2n + 3
- To free up a variable name again, use Delete[b] or b :=
- Variables and functions are always shared between the CAS view and GeoGebra if possible. If you define b:=5 in the CAS view, then you can use b in all of GeoGebra. If you have a function f(x)=x^2 in GeoGebra, you can also use this function in the CAS view.

### Row References

You can refer to other rows in the CAS view in two ways

- Static row references insert text from another row, so your input is changed.
- # inserts the previous output
- #5 inserts the output of row 5
- ## inserts the previous input
- #5# inserts the input of row 5

- Dynamic row references use text from another row, but don't change your input.
- $ inserts the previous output
- $5 inserts the output of row 5
- $$ inserts the previous input
- $5$ inserts the input of row 5

## Equations

- Equations are written using the simple Equals sign, e.g. 3x + 5 = 7
- You can perform arithmetic operations on equations, e.g. (3x + 5 = 7) - 5 subtracts 5 from both sides of the equation. This is useful for manual equation solving.
- LeftSide[3x + 5 = 7] gives 3x+5 and RightSide[3x + 5 = 7] gives 7

## Solve Equations

You can use the Solutions and Solve commands to solve equations.

- Solutions[ equation ] solves an equation for x
- Solutions[ x^2 = 4 ] returns {2, -2}

- Solutions[ equation, var ] solves an equation for the given variable.
- Solutions[ 3a = 5b, a ] returns {5b / 3}

- Solve[ equation ] solves an equation for x
- Solve[ x^2 = 4 ] returns {x = 2, x = -2}

- Solve[ equation, var ] solves an equation for the given variable.
- Solve[ 3a = 5b, a ] returns {a = 5b / 3}

## System of Two Equations

- Solutions[{equation1, equation2}] solves two equations for x and y
- Solutions[{x + y = 2, y = x}] returns {{1,1}}

- Solutions[{equation1, equation2},{var1, var2}] solves two equations for var1 and var2
- Solutions[{a + b = 2, a = b}, {a, b}] returns {{1,1}}

- Solve[{equation1, equation2}] solves two equations for x and y
- Solve[{x + y = 2, y = x}] returns {{x = 1, y = 1}}

- Solve[equation1, equation2, var1, var2] solves two equations for var1 and var2
- Solve[{a + b = 2, a = b}, {a, b}] returns {{x = 1,y = 1}}

## Basic commands

- Expand[ exp ]expands the given expression
- Expand[ (x-2) (x+3) ] returns x^2 + x - 6

- Factor[ exp ] factors the given expression
- Factor[ 2x^3 + 3x^2 - 1 ] returns 2*(x+1)^2 * (x-1/2)

- Numeric[ exp ], Numeric[ exp, precision ] tries to determine a numerical approximation of the given expression
- Numeric[ 1/2 ] returns 0.5
- Numeric[ sin(1), 20 ] returns 0.84147098480789650666

## Calculus

- Limit[ exp, var, value ] tries to determine the limit of an expression.
- Limit[ sin(x)/x, x, 0 ] returns 1

- LimitAbove[ exp, var, value ] tries to determine the limit of an expression.
- LimitAbove[ 1/x, x, 0 ] returns Infinity

- LimitBelow[ exp, var, value ] tries to determine the limit of an expression.
- LimitBelow[ 1/x, x, 0 ] returns -Infinity

- Sum[ exp, var, from, to ] finds the sum of a sequence
- Sum[i^2, i, 1, 3] returns 14
- Sum[r^i, i,0,n] returns (1-r^(n+1))/(1-r)
- Sum[(1/3)^i, i,0,Infinity] returns 3/2

- Derivative[ function ], Derivative[ function, var ], Derivative[ function, var, n ] takes the derivative of a function with respect to the given variable. If no variable is given, "x" is used.
- Derivative[ sin(x)/x^2, x ] returns (x^2*cos(x) - sin(x)*2*x) / x^4
- Derivative[ sin(a*x), x, 2 ] returns -sin(a*x)*a^2

- Integral[ function, var ], Integral[ function, var, x1, x2 ] finds the (definite) integral of a function with respect to the given variable
- Integral[ cos(x), x ] returns sin(x)
- Integral[ cos(x), x, a, b ] returns sin(b) - sin(a)

## Further Commands and Tools

For the complete list see CAS Commands and CAS tools.