Einführung in Mathematica

Clemens Heuberger, TU Graz, http://www.opt.math.tu-graz.ac.at/~cheub, mailto:clemens.heuberger@tugraz.at

Dieses und andere Files finden sich auf http://www.opt.math.tu-graz.ac.at/~cheub/MapleMathematica/

Grundlegendes

Beenden von Befehlen

4 + 1

4 + 1;

Zugriff auf berechnete Ergebnisse

2 + 3

Sqrt[%]

Sqrt[%%]

N[%]

Variable, Zuweisungen

a = 2 + 3

c = Sqrt[a]

N[c]

a = 10

c

Clear[a, c]

Elementare Funktionen und Konstanten

Pi

N[Pi]

E

N[E]

I

I^2

Cos[Pi]

Sin[Pi]

Tan[Pi]

Cot[Pi]

Exp[Pi] - E^Pi

Log[E^2]

Ln[E^2]

Log[10, 100]

Ausdrücke, Regeln, und Funktionen

Ausdrücke

f = 1 + Sqrt[x]

f[1]

f /. x -> 5

Regeln, Substituieren von Werten

f /. x -> y + 1

f /. {x -> y + 1, y -> z + 1}

f //. x -> y + 1

f //. {x -> y + 1, y -> z + 1}

Funktionen

Clear[f]

f[x_] = 1 + Sqrt[x]

f[1]

f[5]

5 // f

Mittelwert[x_, y_] = (x + y)/2

Mittelwert[3, 5]

Listen, Mengen

Liste

li = {a, b, c, d}

li[[1]]

li[[3]]

li[[-1]]

li[[{1, 3}]]

Map[g, li]

?f

Map[f, li]

Length[li]

li2 = Table[i, {i, -2, 2}]

Max[li2]

Table[i, {i, 1, 4}]

Range[4]

Range[-2, 2]

Range[-3, 3, 2]

Listen von Listen, Matrizen

A = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}

TableForm[A]

MatrixForm[A]

X = Table[x[i], {i, 3}]

A . X // MatrixForm

A[[1, 2]]

A[[2, {2, 3}]]

A[[2]]

A[[2, 3]] = 8

A

Mengen

g[x_] = x^2

li2

Map[g, li2]

Map[#^2 &, li2]

qu = Union[%]

Intersection[qu, li2]

Union[qu, li2]

Complement[qu, li2]

Algebraische Umformungen

Polynome

Clear[X]

f = (X + Y)^10 - (X + Y^2)^5

Expand[f]

Collect[f, X]

Collect[f, X, Factor]

Factor[f]

Coefficient[f, X, 5]

Coefficient[f, X^5]

Exponent[f, X]

Exponent[f, X, Min]

Exponent[f, X, h]

Transzendente Funktionen

Sin[x]^2 + Cos[x]^2

Simplify[%]

Log[1 + Sqrt[2]] - ArcSinh[1]

Simplify[%]

FullSimplify[%]

Log[27  n]

Expand[%]

Simplify[%]

FullSimplify[%]

Expand[Log[27  n], Trig -> True]

PowerExpand[Log[27  n]]

PowerExpand[Log[2  n - Sqrt[2] n]]

Plots

Plot[1 + x^2, {x, -4, 4}]

Plot[1/x, {x, -4, 4}]

?? Plot

Mathematisches

Ableitungen

D[1 + x^2, x]

f[x_] = 1 + x^2

Clear[f]

f[x_] = 1 + x^2

D[f, x]

D[f[x], x]

f'[x]

Clear[f]

f[x_, y_] = x^2 + 3  x y + y^2

f'[x, y]

Derivative[1, 0][f][x, y]

Derivative[0, 1][f][x, y]

Derivative[1, 1][f][x, y]

Derivative[2, 0][f][x,  y]

Reihen

e1 = Series[Sin[x], {x, 0, 5}]

Coefficient[e1, x, 5]

f = x - x^3/6 + x^5/120 + x^6

e2 = Series[f, {x, 0, 5}]

e1 - e2

Series[Sin[x] - f, {x, 0, 5}]

e3 = Series[Sqrt[x^2 + 1], {x, Infinity, 5}]

e3*Log[x]

Series[Gamma[x], {x, Infinity, 5}]