Math 350 - Lecture 1

Corresponding to Chapters 1 and 2 in Hazrat

Mathematica as a Calculator

5*3+2

%

Out[2]

2^9940

PrimeQ[2^9940 -1]

22/7

N[22/7]

Tan[3 Pi/11] + 4 Sin[2 Pi/11]

Simplify[Out[10]]

FullSimplify[Out[10]]

Numbers

4!

FactorInteger[24]

2 2 2 3

PrimeQ[24]

?Prime

Prime[1]

Prime[10]

Mod[13,6]

Binomial[10, 2]

Algebraic Computations

(1+x)^4

Expand[(1+x)^4]

Factor[1 + 3x^3 + 3 x^6  + x^9]

Apart[(x+2)/((x+3)^2(x^2 + 1))]

Variables

s = 2

t = 3;

t

Expand[(1+t)^3]

Clear[t]

Equalities

Variable assignment (=)

t= 3;

t

Boolean comparison (==)

t == 3

t==4

Delayed assignment (:=)

Random[]

x = Random[]

x

x

x

x:=Random[]

x

x

x

Dynamic Variables

Manipulate[Expand[(1+x)^n], {n, 1, 10, 1}]

Manipulate[Plot[a+ c x^2, {x, 0, 4}],{a,-4,4}, {c, -3,3}]

Formulas as functions

f[n_]:=n^3 - 2n +3

f[3]

f[4]

Plot[f[x], {x, 0,2}]

f[f[x]]

Expand[f[f[f[x]]]]

f[x_]:= Sin[x] Cos[x] + Tan[x]

Plot[f[x],{x,0,2}]

What did we do

Arithemetic +, -, /, *, !
Expand, Factor, Apart, Together
= , ==, :=
Boolean functions (PrimeQ)
Formulas into functions
Manipulate 
(Check HW 1 pdf for the first week’s functions to learn)
HW from Ch1 and Ch 2.1