Računamo z Mathematico

V tem zvezku najdete primere računov v Mathematici. Če želite izvedeti več o neki funkciji, postavite kurzor nanjo in pritisnite F1. Dokumenaticija vsebuje nadaljne primere in reference na sorodne funkcije.

Frontend in Kernel

a

a+5

a+6

b=7

b+5

b=3

b+5

Osnovno poenostavljanje izrazov

2+2

10+30

To je neko besedilo, lahko (x^2)+(Sqrt[(1/(1+(x^2)))]) pišemo v besedilo.

2+2

16/60

(2^20000)

(Sqrt[2])

N[(Sqrt[2]),1000]

N[Pi,1000]

FactorInteger[2048023480293482309400]

FactorInteger[100]

x+x+y+x+y+x

(x^2)-(y^2)

Factor[(x^2)-(y^2)]

Expand[(((x-y))^2)(((x+(y^2)))^4)]

Factor[2 (x^4)+7 (x^2) y-4 (x^3) y-14 x (y^2)+2 (x^2) (y^2)+7 (y^3)-(x^2) z+2 x y z-(y^2) z+6 (x^4) (z^2)+21 (x^2) y (z^2)-12 (x^3) y (z^2)-42 x (y^2) (z^2)+6 (x^2) (y^2) (z^2)+21 (y^3) (z^2)-3 (x^2) (z^3)+6 x y (z^3)-3 (y^2) (z^3)+6 (x^4) (z^4)+21 (x^2) y (z^4)-12 (x^3) y (z^4)-42 x (y^2) (z^4)+6 (x^2) (y^2) (z^4)+21 (y^3) (z^4)-3 (x^2) (z^5)+6 x y (z^5)-3 (y^2) (z^5)+2 (x^4) (z^6)+7 (x^2) y (z^6)-4 (x^3) y (z^6)-14 x (y^2) (z^6)+2 (x^2) (y^2) (z^6)+7 (y^3) (z^6)-(x^2) (z^7)+2 x y (z^7)-(y^2) (z^7)]

Simplify[(1/(x^2))+(2/x)+1]

Sin[x]/Cos [x]

Factor[x^2+2xy+y^2]

Factor[x^2+2x y+y^2]

(1/(x^2))+(2/x)+1//Simplify

Together[(1/(x+1))+((x^2)/(1-(x^2)))-(1/(x-1))]

Simplify[(Sqrt[(x^2)])]

FullSimplify[(Sqrt[(x^2)])]

FullSimplify[(Sqrt[(x^2)]),Assumptions->{x∈Reals}]

Prepisovalna pravila in vzorci

a+(b^2)/.{b->(1+x)}

a+(b^2)/.{a->7,b->(1+x)}

a+(b^2)/.{a->b,b->a}

(a^2)+(b^2)+(((c+d))^2)/.{((x_)^2)->(((1+x))^3)}

3*Sin[0.001]*Cos[π/13]+Sin[π/5]/.{Sin[α_]/;Abs[α]<(10^(-2))->α}

(a^2)+(b^3)+(c^4)/.{k_Integer->k+1}

{1,2,3,4,5,6}/.{{x_,xs___}->{xs,x}}

Defincije spremenljivk in funkcij

a=5

f[x_]:=(x^2)+13x-2

f[3]

3 // f

g[x_,y_]:=Sin[(Sqrt[(x^2)+3(y^2)])]

ClearAll[a,f]

a

f[3]

Linearna algebra

a={{1,2,4},{1,3,9},{1,4,16}}

v={1,0,2}

a.v

a//MatrixForm

Transpose[a]//MatrixForm

Inverse[a]//MatrixForm

Det[a]

Eigenvalues[a]

Eigenvalues[a]//N

b=(({{Cos[t], -Sin[t], 0}, {Sin[t], Cos[t], 0}, {0, 0, y}}))

a.b//MatrixForm

Eigenvalues[b]

Eigenvectors[b]

Risanje grafov

Plot[Sin[x],{x,-5,5}]

Plot[{Sin[x], -Sin[x],Sin[x]*Cos[16 x]},{x,-5,5},PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0],RGBColor[0.5,0.5,0.5]},
AspectRatio->Automatic]

Table[(x^k),{k,0,10}]

Plot[Table[(x^k),{k,0,10}],{x,0,1}]

f[x_,y_]:=Sin[(x^2)+2(((y-x))^2)]+Cos[3 x+4y]

Plot3D[f[x,y],{x,-2,2},{y,-2,2}]

Plot3D[f[x,y],{x,-2,2},{y,-2,2},Mesh->False]

DensityPlot[f[x,y],{x,-2,2},{y,-2,2}]

ContourPlot[f[x,y],{x,-2,2},{y,-2,2}]

VectorPlot[Evaluate@Grad[f[x,y],{x,y}],{x,-1,1},{y,-1,1}]

pic=Plot3D[f[x,y],{x,-2,2},{y,-2,2},Mesh->False]

Export["~/Desktop/pic.pdf",pic]

Export["~/Desktop/pic.gif",pic]

Limite

Limit[x *Log[x],x->0]

Limit[(Sqrt[(x^2)-3x+1])-(Sqrt[(x^2)+7x+15]),x->∞]

Vsote

Sum[(2^k),{k,0,n}]

Sum[(k^2),{k,0,n}]

Sum[(1/(k^2)),{k,1,∞}]

Sum[((a-k)/(k^3)),{k,1,∞}]

Odvodi in integrali

D[Sin[x],x]

D[Sin[Exp[2(x^3)+7]/Log[x]],x]

D[f[x,y],y]

Integrate[Sin[x],x]

Integrate[(1/(1+(x^4))),x]

Integrate[(1/(1+(x^4))),{x,0,1}]

Integrate[((Sin[x])/x),{x,0,∞}]

Integrate[((Sin[x])/x),{x,1,2}]

NIntegrate[((Sin[x])/x),{x,1,2}]

NIntegrate[((Sin[x])/x),{x,1,2},WorkingPrecision->30]

Enačbe

Solve[(x^2)+x+1==0,x]

Solve[a (x^2)+b x+ c==0,x]

Solve[(x^5)+2x==1,x]

NSolve[(x^5)+2x==1,x]

Solve[{(x^2)+(y^2)==a,(x^2)-(y^2)==b},{x,y}]

(h=Table[1/(i+j),{i,1,10},{j,1,10}])//MatrixForm

w=LinearSolve[h,Table[1,{k,1,10}]]

h.w

Diferencialne enačbe

DSolve[{x''[t]+x[t]==0,x[0]==0,x'[0]==1},x[t],t]

DSolve[{x'[t]==Sin[t]+x[t]},x[t],t]

DSolve[{x''[t]+2x[t]==0,x[0]==0,x'[0]==1},x,t]

solution=First@NDSolve[{x''[t]+2x[t]==0,x[0]==0,x'[0]==1},x,{t,0,3}]

Plot[x[t]/.solution,{t,0,3}]

Potenčne vrste in aproksimacije

Series[Sin[x],{x,0,10}]

s=Series[(m/(((x-y))^2)),{x,0,5}]

Normal[s]

Series[(m/(((x-y))^2)),{x,∞,5}]

((Series[Sin[(x^2)],{x,0,6}])/(Series[(1/(x^2)),{x,0,6}]))