Yacas knows some trigonometric identities, so it can simplify to exact results even if N is not used. This is the case when the arguments are of the form Pi, Pi/2 etcetera.
In> Sin(1) Out> Sin(1); In> N(Sin(1),20) Out> 0.84147098480789650665; In> Sin(Pi/4) Out> Sqrt(2)/2; |
In> Exp(2) Out> Exp(2); In> Ln(%) Out> 2; |
In> Sqrt(16) Out> 4; In> Sqrt(15) Out> Sqrt(15); In> N(Sqrt(15)) Out> 3.8729833462; |
In> Abs(-2) Out> 2; In> Sign(-2) Out> -1; |
Complex(x,y) is the internal representation of a complex number in Yacas.
Arg returns the angle a for which the complex number is amp*(Cos(angle) + I*Sin(angle)). As such it returns an angle from -Pi to +Pi.
In> z := 2+3*I Out> Complex(2,3); In> Re(z) Out> 2; In> Im(z) Out> 3; In> Arg(Exp(I*Pi/3)) Out> Pi/3; |
In> 10! Out> 3628800; In> Bin(10,4) Out> 210; In> (10!)/((6!)*(4!)) Out> 210; In> (3/2)! Out> (3*Sqrt(Pi))/4; |
Iteration can either proceed over the elements of a list passed in, or by evaluating 'body' by iterating variable 'var' from value 'from' upto 'to'. 'to' should be greater than or equal to from.
In> Sum(i,1,3,i) Out> 6; In> Sum({1,2,3}) Out> 6; In> Sum(1 .. 3) Out> 6; In> Average(1 .. 3) Out> 2; In> Factorize(i,1,3,i) Out> 6; In> Factorize({1,2,3}) Out> 6; In> Factorize(1 .. 3) Out> 6; |
In> Min(2,3) Out> 2; In> Max(2,3) Out> 3; In> Min(5 .. 15) Out> 5; In> Max(5 .. 15) Out> 15; |
In> IsRational(a) Out> False; In> IsRational(a/b) Out> True; In> Numer(a/b) Out> a; In> Denom(a/b) Out> b; |
In> Commutator(2,3) Out> 0; In> m1:=Identity(3) Out> {{1,0,0},{0,1,0},{0,0,1}}; In> m1[1][2] := a Out> True; In> m2:=Identity(3) Out> {{1,0,0},{0,1,0},{0,0,1}}; In> m2[2][2] := a Out> True; In> Commutator(m1,m2) Out> {{0,a^2-a,0},{0,0,0},{0,0,0}}; |
In> Taylor(x,0,9)Sin(x) 3 5 7 9 x x x x x - -- + --- - ---- + ------ 6 120 5040 362880 Out> |
In> exp1 := Taylor(x,0,7)Sin(x) 3 5 7 x x x x - -- + --- - ---- 6 120 5040 Out> In> exp2 := InverseTaylor(x,0,8)ArcSin(x) 5 7 3 x x x --- - ---- - -- + x 120 5040 6 Out> In> Simplify(exp1-exp2) 0 Out> |
This function is used to determine the taylor series expansion of a function: if g(var)=var, then h(f(var))=var, so h will be the inverse of f.
In> f(x):=Eval(Expand((1+x)^4)) Out> True; In> g(x) := x^2 Out> True; In> h(y):=Eval(ReversePoly(f(x),g(x),x,y,8)) Out> True; In> BigOh(h(f(x)),x,8) Out> x^2; In> h(x) Out> (-2695*(x-1)^7)/131072+(791*(x-1)^6)/32768+(-119*(x-1)^5)/4096+(37*(x-1)^4)/1024+(-3*(x-1)^3)/64+(x-1)^2/16; |
In> BigOh(1+x+x^2+x^3,x,2) Out> x+1; |
In> Newton(Sin(x),x,3,0.0001) Out> 3.1415926535; |
In> D(x)Sin(x*y) Out> y*Cos(x*y); In> D({x,y,z})Sin(x*y) Out> {y*Cos(x*y),x*Cos(x*y),0}; In> D(x,2)Sin(x*y) Out> -Sin(x*y)*y^2; In> D(x){Sin(x),Cos(x)} Out> {Cos(x),-Sin(x)}; |
In> Diverge({x*y,x*y,x*y},{x,y,z}) Out> {y,x,0}; In> Curl({x*y,x*y,x*y},{x,y,z}) Out> {x,-y,y-x}; |
In> Integrate(x,a,b)Cos(x) Out> Sin(b)-Sin(a); In> Integrate(x)Cos(x) Out> Sin(x)+C9; |
In> a*b*a^2/b-a^3 Out> (b*a^3)/b-a^3; In> Simplify(a*b*a^2/b-a^3) Out> 0; |
In> RadSimp(Sqrt(9+4*Sqrt(2))) Out> 1+Sqrt(8); In> RadSimp(Sqrt(5+2*Sqrt(6))+Sqrt(5-2*Sqrt(6))) Out> Sqrt(12); In> RadSimp(Sqrt(14+3*Sqrt(3+2*Sqrt(5-12*Sqrt(3-2*Sqrt(2)))))) Out> 3+Sqrt(2); |
In> {1.2,3.123,4.5} Out> {1.2,3.123,4.5}; In> Rationalize(%) Out> {6/5,3123/1000,9/2}; |
In> Solve(a+x*y==z,x) Out> (z-a)/y; In> Solve({a*x+y==0,x+z==0},{x,y}) Out> {{-z,z*a}}; |
In> SuchThat(a+b*x,x) Out> (-a)/b; In> SuchThat(Cos(a)+Cos(b)^2,Cos(b)) Out> (-Cos(a))^(1/2); In> Expand(a*x+b*x+c,x) Out> c+(a+b)*x; In> SuchThat(%,x) Out> (-c)/(a+b); |
In> Subst(Cos(b),c)(Sin(a)+Cos(b)^2/c) 2 c Sin( a ) + -- c Out> In> Eliminate(Cos(b),c,Sin(a)+Cos(b)^2/c) Sin( a ) + c Out> |
In> PSolve(b*x+a,x) Out> -a/b; In> PSolve(c*x^2+b*x+a,x) Out> {(Sqrt(b^2-4*c*a)-b)/(2*c),(-(b+Sqrt(b^2-4*c*a)))/(2*c)}; |
In> Pi() Out> 3.14159265358979323846; In> Precision(40) Out> True; In> Pi() Out> 3.1415926535897932384626433832795028841971; |
In> VarList(Sin(x)) Out> {x}; In> VarList(x+a*y) Out> {x,a,y}; |
You can also specify a direction for the limit, Left or Right. Specifying Right will take the limit from positive Infinity, and Left will take the limit from -Infinity.
In> Limit(x,0) Sin(x)/x Out> 1; In> Limit(x,0) (Sin(x)-Tan(x))/(x^3) Out> -1/2; In> Limit(x,0)1/x Out> Undefined; In> Limit(x,0,Left)1/x Out> -Infinity; In> Limit(x,0,Right)1/x Out> Infinity; |
It also tries to simplify the resulting expression as much as possible, trying to combine all like terms.
This function is used in for instance Integrate, to bring down the expression into a simpler form that can be integrated easily.
In> TrigSimpCombine(Cos(a)^2+Sin(a)^2) 1 Out> In> TrigSimpCombine(Cos(a)^2-Sin(a)^2) Cos( 2 * a ) Out> In> TrigSimpCombine(Cos(a)^2*Sin(b)) Sin( b ) Sin( -2 * a + b ) Sin( -2 * a - b ) -------- + ----------------- - ----------------- 2 4 4 Out> |
This routine uses the Lagrange interpolant formula to build up the polynomial.
In> LagrangeInterpolant({x1,x2,x3},{y1,y2,y3},x) y1 * ( x - x2 ) * ( x - x3 ) y2 * ( x - x1 ) * ( x - x3 ) ---------------------------- + ---------------------------- ( x1 - x2 ) * ( x1 - x3 ) ( x2 - x1 ) * ( x2 - x3 ) y3 * ( x - x1 ) * ( x - x2 ) + ---------------------------- ( x3 - x1 ) * ( x3 - x2 ) Out> |
In> Fibonacci(4) Out> 3; In> Fibonacci(8) Out> 21; |