ZCubes/How to Apply Evaluate Algebraic Functions

From ZCubes Wiki
Jump to navigation Jump to search

How to Evaluate Algebraic Functions


In ZCubes you can evaluate Algebraic expressions by calling the ALGEBRA function and passing the expression as a parameter. These can be then converted to functions and executed for set of parameter values.

Video


Evaluate Algebraic Functions















EXAMPLES


Algebraic experssions such as (a+b)^2, (a+b)*(a-b), (a+b)^3 etc can be calculated using a pre-defined function 'ALGEBRA' in ZCubes.

E.g 1] To calculate (a+b)^2


ALGEBRA("(a+b)^2")


displays the result as


E.g 2] To calculate (a+b)*(a-b)


ALGEBRA("(a+b)*(a-b)")


displays the result as Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle a^2-b^2}


E.g 3] To calculate the array of values such as 3^2, 3^3, 3^4 etc., the ZCubes function 'FUNCT' can be used as:

FunctionArray= FUNCT("[x^2,x^3,x^4]");

FunctionArray(3)


displays the result as 9 27 81


E.g 4] The expansion of algebraic expressions such as (a+b),(a+b)^2,(a+b)^3 and so on till (a+b)^10 can be executed in ZCubes using EXPAND command as -


(1..10)@(x=>EXPAND("(a+b)^"+x))


displays the result as -


1 a+b
2 2*a*b+a^2+b^2
3 3*a*b^2+a^3+b^3+3*a^2*b
4 4*a*b^3+a^4+b^4+6*a^2*b^2+4*a^3*b
5 5*a*b^4+a^5+b^5+10*a^2*b^3+10*a^3*b^2+5*a^4*b
6 6*a*b^5+a^6+b^6+15*a^2*b^4+20*a^3*b^3+15*a^4*b^2+6*a^5*b
7 7*a*b^6+a^7+b^7+21*a^2*b^5+35*a^3*b^4+35*a^4*b^3+21*a^5*b^2+7*a^6*b
8 8*a*b^7+a^8+b^8+28*a^2*b^6+56*a^3*b^5+70*a^4*b^4+56*a^5*b^3+28*a^6*b^2+8*a^7*b
9 9*a*b^8+a^9+b^9+36*a^2*b^7+84*a^3*b^6+126*a^4*b^5+126*a^5*b^4+84*a^6*b^3+36*a^7*b^2+9*a^8*b
10 10*a*b^9+a^10+b^10+45*a^2*b^8+120*a^3*b^7+210*a^4*b^6+252*a^5*b^5+210*a^6*b^4+120*a^7*b^3+45*a^8*b^2+10*a^9*b





© Copyright 1996-2020, ZCubes, Inc.