Title: Syntax_practice
Course: Demonstrating STACK (v4.4.7)

Syntax practice "questions".

In STACK you often need to enter an answer which is an algebraic expression. You should type in your answers using the same syntax as that used in the symbolic mathematics package Maxima.

The syntax is broadly similar to the syntax used for mathematical formulae in graphical calculators, general programming languages such as Maple, Java, C and Basic and in spreadsheet programs, so you will find it useful to master it.

- Use a star for multiplication. For example, \(3x\) should be entered as 3*x.
- Use a caret (^) for raising something to a power: for example, \(x^2\) should be entered as x^2
  - \(x^{-2}\) should be entered as x^(-2)
  - \(x^{1/3}\) should be entered as x^(1/3)
- Brackets are important to group terms in an expression.

Sometimes the answer will be an inequality.

- Be careful to use strict e.g. \( > \) or non-strict inequalities \( >= \).
- Sometimes you will need to chain inequalities together with logical connectives and (displayed as \(\wedge\)) or or (displayed as \(\vee\)).  There is a significant mathematical difference between these.

Multiplication needs a * symbol.

Input the equation \([value]\) in the box below.

Have a go at inputting \[[value]\] For Greek letters just write the name of the Greek letter using the Latin alphabet, eg \(\epsilon=\) epsilon.

Note: please do not copy unicode characters from elsewhere, just use the keyboard.

STACK normally rejects floating point numbers (unless the question demands them).  Avoid using floating points when a fraction, such as \(1/2\) or a surd \(\sqrt{2}\) would be more accurate.

1. Type in [value].
2. Type in [value].

Input \[[value]\] into the answer box below.
Feedback: x<0 or (1<=x and x<=3) is the correct syntax.

Input \([value]\) into the box below.
Feedback: The correct syntax is ln((x-1)^2) or you could type in an equivalent 2*ln(x-1).

Try to see if you can input the polynomial. \[x^4 - 6x^2 -7x + 23\] Hint: a*x^n will give you \(ax^n\)

Enter the following \[[value].\] in STACK. Use the (^) sign to denote a power, and make sure you input multiplication as a*b.
Feedback: The correct syntax is (x^2/((x+1)*(x-5)))

Sometimes you will need to enter a set or list.

- Sets are enclosed by curly brackets \( \{a,b,c\} \) is entered {a,b,c}
- Lists are enclosed by square brackets \( [a,b,c] \) is entered [a,b,c]

Type in [value].

Input \(\sin(2x)\) into the answer box.

In this question you can work "line by line" showing your working.

Solve [value].
Feedback: \[ [value] \]