Sift+Enter : evaluation
1. Numerical calculations
2.3*10^70 : 2.3 10^70 or 2.3*^70
2 ^ 100 = 1267650600228229401496703205376
2 ^ 100 //N = 1.26765*10^30
1/3+1/7 = 10/21
1/3+1/7 //N = 1./3+1/7 = 0.47619
2. Funtions
Sqrt[x], Exp[x], Log[x], Lob[b,x],
Sin[x], Cos[x], Tan[x],ArcSin[x], ArcCos[x], ArcTan[x]
n!, Abs[x], Round[x], Mod[n,m], Random[]
ax[x1,...,xn], Min[x1,...,xn], FactorInteger[n]
Pi, E, Degree(=Pi/180), I(=Sqrt[-1]), Infinity
ex) Sin[30 Degree] = Sin[Pi/6]
N[Pi] = 3.14159, N[Pi,7] = 3.141593 : precision
N[Exp[Pi Sqrt[163]], 40], 2 6 = 12
Sqrt[-4] = 2 I, (4 + 3 I) / (2 - I) = 1+2 I
x+y I = x+iy
Re[], Im[], Conjugate[], Abs[], Arg[]
%, %%, %n(=Out[n])
3. Building up calculations
pi=N[Pi,10], pi^2
x=value, x=y=value, x=. (remove any value assigned to x)
x=2; y=3, x^2y=12, x^(2y)=64
x={1,3,5}, Exp[x] // N, x/(x+1), x[[2]]=Part[x,2], x[[{2,3}]]={2,3}
4. Algebraic manipulation
# replacement
1 + 2x /. x -> 3 = 7
1 + x + x^2 /. x -> 2 - y = 3+(2-y)^2-y
x -> 3 + y; x^2 - 9 /. %
(x + y) (x - y)^2 /. {x -> 3, y -> 1 - a}
t = 1 + x^2; t /. x -> 2; t /. x -> 5a; t /. x -> Pi //N
Expand[(x+2)(x-2)]; Factor[%]
e = (x - 1)^2 (2 + x) / ((1 + x) (x - 3)^2)
Expand[e]; ExpandAll[e]; Together[%]; Apart[%]
v = Expand[(3 + 2 x)^2 (x + 2 y)^2]
Collect[v, x]; Collect[v, y]
FactorTerms[v, y]
5. Calculus
Integrate[1/(x^3 - 1), x]; Plot[%, {x,1,2}]
Integrate[Exp[-x^2], {x, 0, Infinity}]
Integrate[ x^2 + y^2, {x, 0, 1}, {y, 0, x} ]
NIntegrate[f[x], {x, min, max}]
D[Log[x],x]; D[%,x]; Simplify[%]; FullSimplify[%]
D[x^2 Log[x + a], x]
D[(x+2y)^3, y, x]
D[Exp[f[x]]/(1+Exp[f[x]+1]),x]
D[ x^n, {x, 3} ] : differentiate 3 times
Dt[ x^n, x ] : total derivative (n can depend on x)
Dt[ x^n] : total derivative
DSolve[ y'[x] == a y[x] + 1, y[x], x ] : no boundary condition
DSolve[ {y'[x] == a y[x] + 1, y[0] == 0}, y[x], x ]
DSolve[ {x'[t] == y[t], y'[t] == x[t]}, {x[t], y[t]}, t ]
Sum[i,{i,1,n}]
Product[x + i, {i, 1, 4}]
Solve[y+2x==3-y, x]
Solve[{x^2 + y^2 == 1, x + 3 y == 0}, {x, y}] ; x + y /. %
Reduce[2*x>2, x]
FindRoot[ Cos[x] == x, {x, 1} ] : search for a solution starting x=1.
FindMinimum[ (x-3)(x+2), {x, -4} ]
Series[Exp[x+y], {x, x0, order}]
Limit[Log[x],{x->0}]
N[expr] : numerical value of an expression
NSum[f[i], {i, min, Infinity}]
NProduct[f[i], {i, min, Infinity}]
NSolve[lhs==rhs, x] : numerical approximation to the solutions of a polynomial equation
%n or Out[n] - the value of the nth output
InString[n] - the text of the nth input
In[n] - the nth input, for re-evaluation
6. Linear Algebra
Inverse[]
. : matrix multiply
# Making functions
f[x_] := x^2
Clear[f]
Do[ Print[i!], {i, 5} ]
Do[expr, {i, min, max, di}]
7. Factorial Related
n!=Gamma[n+1]
Binomail[n,m]
Multinomail[n1,n2,...,nk]
Pochhammer[a,n]=a(a-1)...(a+n-1)
8. Recurrence Equations
a(1)=1, a(n) = 3*a(n-1) + 1
RSolve[{a[n] == 3 a[n-1]+1, a[1]==1}, a[n], n]
RSolve[{a[n] == a[n-1] + a[n-2], a[1] == a[2] == 1}, a[n], n]
FortranForm[%]
CForm[%]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment