Excercise 1

Basic arithmetic

1. Calculate 10 sin(10)
2. Divide the result by 4
3. Add 10 to the result
4. Calculate the square of the result
5. Add together the two previous results.

Substitutions

Direct substitution

1. Set the variable x equal to 10 and y equal to 5 using direct substitution
2. Set z equal to 2x+y using direct substitution. Check the value of z.
3. Set x equal to 8
5. What's the value of z now? Try it.

Clear x, y and z

Delayed substitution

1. Set x and y equal to 3 and 4.
2. Using delayed substitution, set z equal to x*y
3. Check the value of z
4. Set x equal to 5
5. What's the value of z now? Try it.
6. Clear y and check what is z.

Clear x, y and z

Extra excercises

1. Think what would a:=a+1 give.
2. Try it. Try to get the value of a.
3. Interprete the result
4. What does a=a+1 give?

Clear a.

Truth values

1. Evaluate 10 != 11
2. Evaluate 0==0.
3. Evaluate 1<=3.
4. Evaluate 10==a.
5. Evaluate -10 < 10.

Bonus excercises

Mathematica can check the types of variables and numbers. Evaluate the following:
1. NumberQ[1.24]
2. EvenQ[4]
3. OddQ[6]
4. PrimeQ[7]

Lists

1. Construct the list {1,2,3,5,7,11} and set it to the variable x.
2. Add together the first and last element of x.
3. Multiply the second element with the third element and add the fourth element to the list.

Clear x.

1. Construct the list {a,b,c} and set it to variable x.
2. Construct the list {1,2,3} and set it to y.
3. What would x+y give? Try it.

Clear x and y

1. Set A equal to the list {{1,2,3}, {4,5,6}}.
2. Extract the second element of A.
3. Extract the third element of the first element of A.
4. Extract the first element of the second element of A.
5. Add together the two previous results.

Clear A.

Extra excercises

1. Construct the matrix (({{a, b}, {c, d}, {e, f}})) and set it to A.
2. Extract the last element of the first row of A.
3. How would you extract the element e from A?

Clear A.

Rules, equations, solving equations

1. Calculate (x^2) + x + 1with x equal to 10
2. Calculate x + y with x and y equal to 1 and 2
3. Calculate ((a + 1)/(b + 2))with a and b equal to 3 and 4
4. Set x equal to 10 using a rule and a substitution operator.

1. Solve the equation (x^2) + p x + q = 0, and set the result to the variable e.
2. Extract the second element of the solution list.
3. Using the above rule, calculate x + p.
4. Calculate the above with p = 1and q = 2.
5. Check the numerical value of the above using the function N[...].

1. Set the variable Y equal to the equation (x^3) + p (x^2) + q x + r = 0.
2. Solve equation Y.
3. Check the solution by substituting it into the equation and simplifying the resulting expression

1. Set the variable y equal to ((6 + 11 x + 6 (x^2) + (x^3))/(-x + (x^3)))
2. Apply the functions Expand, Factor, Together, Apart, Cancel, Simplify, Numerator ja Denominator on y.
3. Solve the equation y = 0by taking the numerator of y and finding its zeros.
4. Check the solution by substituting it into the equation. What do you see? How could you fix the situation?

Extra excercise

1. Solve the set of equations {({{((a x)/(Sqrt[y])) = 4}, {b x + a y = 3}})for x and y. Use the function Sqrt[] for the square root.
2. Simplify the above result
3. Set above a and b equal to 1 and 2.
4. Calculate the numerical value of the above result using the function N.