Integration
Let's do some integration examples:
axiom
integrate(%e**x, x)
Type: Union(Expression(Integer),...)
load_package SPECFN; | reduce |
on ROUNDED,ADJPREC; | reduce |
Ei(1.00000000000000000001);
*** precision increased to 21 | reduce |
Can Reduce compute Ei in arbitrary precision?
See http://www.uni-koeln.de/REDUCE/3.6/doc/specfn/
Also http://homepages.inf.ed.ac.uk/mtoussai/publications/toussaint-99-mexico.pdf
Reset
off ROUNDED,ADJPREC; | reduce |
int(cos(x),x,0,pi);
*** ci already defined as operator
*** si already defined as operator | reduce |
axiom
integrate(x^2/sqrt(4-x^2),x)
Type: Union(Expression(Integer),...)
axiom
integrate(exp(-a*x**2),x=0..%plusInfinity)
Type: Union(fail: failed,...)
The following won't "work", see CommonMistakes?:
axiom
integrate(exp(-a::PositiveInteger*x**2),x=0..%plusInfinity)
Cannot convert from type Variable(a) to PositiveInteger for value
a
axiom
integrate((x^3+x^2+2)/(x*(x^2-1)^2), x)
Type: Union(Expression(Integer),...)
axiom
integrate(2*x/sin(x)^2,x)
Type: Union(Expression(Integer),...)
Comparing Axiom and Reduce:
axiom
integrate(sin(1/x),x)
Type: Union(Expression(Integer),...)
Hell, why does the following blow MathAction??:
\begin{reduce}
load_package algint;
int(sin(1/x),x);
\end{reduce}
A different problem, where Axiom has to give up:
axiom
integrate(sqrt(sin(1/x)),x)
>> Error detected within library code:
integrate: implementation incomplete (constant residues)
However, in Reduce:
Again, why does the following blow MathAction??:
\begin{reduce}
load_package algint;
int(sqrt(sin(1/x)),x);
\end{reduce}
axiom
integrate(exp(-x^2),x)
Type: Union(Expression(Integer),...)
axiom
integrate(sin(x)/x,x)
Type: Union(Expression(Integer),...)
axiom
differentiate(%,x)
Type: Expression(Integer)
axiom
integrate(sin(1/x),x=%minusInfinity..%plusInfinity,"noPole")
>> Error detected within library code:
integrate: pole in path of integration
axiom
integrate(2*x/sin(x)^2,x=1/2..1);
Type: Union(pole: potentialPole,...)
axiom
integrate(sin(x),x=0..%pi/2)
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
axiom
integrate(atan(x/a)/x,x)
Type: Union(Expression(Integer),...)
axiom
integrate(1/(a+z^3), z=0..1,"noPole")
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
axiom
integrate(x^3+x^2/4+x,x)
Type: Polynomial(Fraction(Integer))
You cannot integrate Expression Float
axiom
integrate(50*%e^(-0.02*t),t)
There are 11 exposed and 8 unexposed library operations named
integrate having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op integrate
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
integrate with argument type(s)
Expression(Float)
Variable(t)
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
But symbolic integration works with integer expressions
axiom
integrate(50*%e^(-0.02*t)::Expression Fraction Integer,t)
Type: Union(Expression(Fraction(Integer)),...)
axiom
integrate(exp(cos(x)),x)
Type: Union(Expression(Integer),...)
axiom
integrate(sin(x),x)
integrate(%,x)
>> Error detected within library code:
Sorry - cannot handle that integrand yet
axiom
integrate(a/h - c*h/12 + (b/h)*r + (c/h)*r^2,r)
Type: Union(Expression(Integer),...)
axiom
integrate(exp(-(a+b*t)^2/2),t)
Type: Union(Expression(Integer),...)
axiom
integrate(exp(-(a+b*t)^2/t),t)
Type: Union(Expression(Integer),...)
axiom
integrate(exp(-1/t),t)
Type: Union(Expression(Integer),...)
axiom
integrate(exp(-1/t),t=1..x)
Type: Union(pole: potentialPole,...)
Unfortunately, there is currently no easy way to make "assumptions" about
variables. Thus, The following won't work:
\begin{axiom}
assume(x, real)
integrate(exp(-1/t),t=1..x)
\end{axiom}
axiom
integrate(t*exp(-(a+b*t)^2/2),t)
Type: Union(Expression(Integer),...)
axiom
integrate(1/(a+z^3), z=0..1,"noPole")
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
From the ReduceProblem? (what does axiom do?):
axiom
int(1/sqrt(2*PI)*exp(-1/2*log(x)**2),x,0,INFINITY);
There are 35 exposed and 22 unexposed library operations named *
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op *
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named *
with argument type(s)
PositiveInteger
Domain
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
Well, you should use Axiom syntax. Note that
PI
is a domain, spelled out:
PositiveInteger
in Axiom, the constant
is denoted
%pi
. Furthermore,
the operation you want is called
integrate
. Finally, infinity is denoted
%infinity
, but in fact, I wouldn't know how to do such integrals in Axiom
anyway. Thus, the best I get is:
axiom
integrate(1/sqrt(2*%pi)*exp(-1/2*log(x)**2),x=0..k)
Type: Union(pole: potentialPole,...)
If you would get a result, you could use limit afterwards, of course.
- Area under the curve:
axiom
integrate(1/x,x=1..%plusInfinity)
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
- Volume under that curve:
axiom
integrate(%pi*((1/x)^2), x=1..%plusInfinity)
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
Curve has an infinite area...but a finite volume (I think I did this correctly)!
axiom
integrate(1/x,x)
Type: Union(Expression(Integer),...)
axiom
integrate(sqrt(x),x)
Type: Union(Expression(Integer),...)
axiom
integrate(sqrt(x^3+x),x)
Type: Union(Expression(Integer),...)
axiom
integrate(( a*sin( m + n*t + o*t*t/2 ) )/( n + ot ) + ( b*cos( m + n*t + o*t*t/2 ) )/( n + ot ), t)
Type: Union(Expression(Integer),...)
axiom
integrate(( a*cos( m + n*t + o*t*t/2 ) )- ( b*sin( m + n*t + o*t*t/2 ) ), t)
Type: Union(Expression(Integer),...)
axiom
integrate(-2*(3-3*t)^2*(3*t),t)
Type: Polynomial(Fraction(Integer))
integrate(1/(1+x**2),x=-u..u)
axiom
integrate(1/(1+x**2),x=-u..u)
Type: Union(pole: potentialPole,...)
axiom
integrate(x**6*exp(-x**2), x=0..%plusInfinity)
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
integrate(1/sqrt(1/x+1),x)
axiom
integrate(1/sqrt(1/x+1),x)
Type: Union(Expression(Integer),...)
integrate(sin(sin x), x)
integrate(a/2
(1-cos(bt)),t)
integrate(tan(arctan(x)/3),x)
integrate(tan(arctan(x)/3),x);
integrate(x, x)
axiom
integrate(x, x)
Type: Polynomial(Fraction(Integer))
axiom
integrate((1/(2*z))*z^2), z)
Line 1: integrate((1/(2*z))*z^2), z)
...........................A
Error A: Improper syntax.
1 error(s) parsing
axiom
integrate((1/(2*z))*z^2, z)
Type: Union(Expression(Integer),...)
axiom
simplify((1/(2*z))*z^2)
Type: Expression(Integer)
axiom
integrate((1/(2*z))*z^2, z)
Type: Union(Expression(Integer),...)
integrate(ln(x),x)
integrate(1/x,x)
axiom
integrate(0**0,x)
Type: Polynomial(Fraction(Integer))
axiom
integrate( ln(y)^3/(y*(y-1)),y)
There are no library operations named ln
Use HyperDoc Browse or issue
)what op ln
to learn if there is any operation containing " ln " in its name.
Cannot find a definition or applicable library operation named ln
with argument type(s)
Variable(y)
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
axiom
integrate( log(y)^3/(y*(y-1)),y)
Type: Union(Expression(Integer),...)
axiom
integrate(exp(-x^2),x=0..%plusInfinity)
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
integrate(x*
2exp(-x^2),x=0..%plusInfinity)
No ; after command or else output is supressed.
axiom
integrate(exp(%i*2*%pi*f*t), t=0..T)
Type: Union(f1: OrderedCompletion
?(Expression(Complex(Integer))),
...)
int(exp(sin(x)),x); | reduce |
axiom
integrate(exp(sin(x)),x)
Type: Union(Expression(Integer),...)
axiom
integrate(sqrt(x+sqrt(1+x^2))/x,x)
Type: Union(Expression(Integer),...)