login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

# Edit detail for SandBoxSinCosRules revision 2 of 2

 1 2 Editor: test1 Time: 2013/04/25 19:00:09 GMT+0 Note:

changed:
-f:=operator 'f; e:=1+a*x**2+f(y)*x^3; eq:=[f(y)=r]; peq:=subst(e,eq)::(Polynomial Integer)=0;sol:=radicalSolve(peq,x);
f:=operator 'f; e:=1+a*x^2+f(y)*x^3; eq:=[f(y)=r]; peq:=subst(e,eq)::(Polynomial Integer)=0;sol:=radicalSolve(peq,x);


Sin and Cos Rules

fricas
x:=v1*sin(p1)+v2*sin(p2)
 (1)
Type: Expression(Integer)
fricas
y:= a0 + a1*x + a2*x^2 + a3*x^3
 (2)
Type: Expression(Integer)
fricas
sinCosProducts := rule
sin(x)*sin(y) == (cos(x-y) - cos(x+y))/2
cos(x)*cos(y) == (cos(x-y) + cos(x+y))/2
sin(x)*cos(y) == (sin(x-y) + sin(x+y))/2
sin(x)^2 == (1 - cos(2*x))/2
sin(x)^3 == sin(x)*(1 - cos(2*x))/2
 (3)
Type: Ruleset(Integer,Integer,Expression(Integer))
fricas
sinCosProducts(y)
 (4)
Type: Expression(Integer)

Integration

fricas
)clear completely
All user variables and function definitions have been cleared.
All )browse facility databases have been cleared.
Internally cached functions and constructors have been cleared.
)clear completely is finished.
integrate(%e ^(-x*x), x=%minusInfinity..%plusInfinity)
 (5)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
integrate(integrate(x+y, x),y)
 (6)
Type: Polynomial(Fraction(Integer))

fricas
integrate(exp(-b*h*sin(o))*sin(o),o=0..2*%pi)
 (7)
Type: Union(fail: failed,...)

Gosper's algorithm is implemented in Axiom

fricas
p:Polynomial Integer:=1+x+x^2
 (8)
Type: Polynomial(Integer)
fricas
sum(p,x=0..n)
 (9)
Type: Fraction(Polynomial(Integer))
fricas
e:=binomial(2*k,k)/4^k
 (10)
Type: Expression(Integer)
fricas
sum(e,k=0..n)
 (11)
Type: Expression(Integer)
fricas
sum(%,n=0..n)
 (12)
Type: Expression(Integer)
fricas
factor(4*n^2+8*n+3)
 (13)
Type: Factored(Polynomial(Integer))

Examples from Petkovsek, Wilf, Zeilberger

 exp(log(x)+log(y^-1)); reduce

Symbols, kernels, variables, expressions ... difficult to understand

fricas
e0:Expression Integer:=1+2*x^2+x
 (14)
Type: Expression(Integer)
fricas
kernels(e0)
 (15)
Type: List(Kernel(Expression(Integer)))
fricas
p0:=e0::(Polynomial Integer)
 (16)
Type: Polynomial(Integer)
fricas
variables(p0)
 (17)
Type: List(Symbol)
fricas
e1:Expression Integer:=x*sin(t)/cos(t)+1
 (18)
Type: Expression(Integer)
fricas
kernels(e1)
 (19)
Type: List(Kernel(Expression(Integer)))
fricas
solve(e1=0,x)
 (20)
Type: List(Equation(Expression(Integer)))
fricas
e2:UP(x,Expression Integer):=sin(t)/cos(t)*x
 (21)
Type: UnivariatePolynomial(x,Expression(Integer))

Expressions and substitution

fricas
f:=operator 'f; e:=1+a*x^2+f(y)*x^3; eq:=[f(y)=r]; peq:=subst(e,eq)::(Polynomial Integer)=0;sol:=radicalSolve(peq,x);
Type: List(Equation(Expression(Integer)))
fricas
--[(lhs(s)=subst(rhs(s),r=f(y))) for s in sol]
--As a list there is no output shown
--x1=subst (rhs(sol.1),r=f(y))
--x2=subst (rhs(sol.2),r=f(y))
x3=subst (rhs(sol.3),r=f(y))
 (22)
Type: Equation(Expression(Integer))

Parsing expressions ???

fricas
e:Expression Integer:=x*y
 (23)
Type: Expression(Integer)
fricas
isMult(e)
 (24)
Type: Union("failed",...)
fricas
e1:Expression Integer:=x
 (25)
Type: Expression(Integer)
fricas
isMult(e1)
 (26)
Type: Union(Record(coef: Integer,var: Kernel(Expression(Integer))),...)
fricas
isMult(e1*e)
 (27)
Type: Union("failed",...)