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

Edit detail for SandBox Integration revision 2 of 19

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Editor: amca01
Time: 2010/01/05 15:08:54 GMT-8
Note: An integral which Maxima can't do, but Axiom can

added:

From amca01 Tue Jan 5 15:08:53 -0800 2010
From: amca01
Date: Tue, 05 Jan 2010 15:08:53 -0800
Subject: An integral which Maxima can't do, but Axiom can
Message-ID: <20100105150853-0800@axiom-wiki.newsynthesis.org>

\begin{axiom}integrate(sqrt(x+sqrt(1+x^2))/x,x\end{axiom}

Integration

Let's do some integration examples:

axiom
integrate(%e**x, x)

\label{eq1}e^x(1)
Type: Union(Expression(Integer),...)

load_package SPECFN;
reduce

on ROUNDED,ADJPREC;
reduce

Ei(1.00000000000000000001);
*** precision increased to 21
reduce
\displaylines{\qdd
euler<em>constant
+1.31790215145440389489
\cr}
 
Ei(1.0);
reduce
\displaylines{\qdd
euler<em>constant
+1.31790215145440389486
\cr}
 
Ei(2.0);
reduce
\displaylines{\qdd
euler<em>constant
+4.37701869110035730277
\cr}
 

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
\displaylines{\qdd
0
\cr}
 

axiom
integrate(x^2/sqrt(4-x^2),x)

\label{eq2}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
-{{32}\ {\sqrt{-{x^2}+ 4}}}- 
\
\
\displaystyle
{8 \ {x^2}}+{64}
(2)
Type: Union(Expression(Integer),...)

axiom
integrate(exp(-a*x**2),x=0..%plusInfinity)

\label{eq3}\mbox{\tt "failed"}(3)
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)

\label{eq4}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left(-{5 \ {x^2}}+ 5 \right)}\ {\log \left({x + 1}\right)}}+{{\left({8 \ {x^2}}- 8 \right)}\ {\log \left({x}\right)}}+ 
\
\
\displaystyle
{{\left(-{3 \ {x^2}}+ 3 \right)}\ {\log \left({x - 1}\right)}}-{2 \  x}- 6 
(4)
Type: Union(Expression(Integer),...)

axiom
integrate(2*x/sin(x)^2,x)

\label{eq5}{\left(
\begin{array}{@{}l}
\displaystyle
{2 \ {\sin \left({x}\right)}\ {\log \left({{\sin \left({x}\right)}\over{{\cos \left({x}\right)}+ 1}}\right)}}-{2 \ {\sin \left({x}\right)}\ {\log \left({2 \over{{\cos \left({x}\right)}+ 1}}\right)}}- 
\
\
\displaystyle
{2 \  x \ {\cos \left({x}\right)}}
(5)
Type: Union(Expression(Integer),...)

Comparing Axiom and Reduce:

axiom
integrate(sin(1/x),x)

\label{eq6}\int^{
\displaystyle
x}{{\sin \left({1 \over \%I}\right)}\ {d \%I}}(6)
Type: Union(Expression(Integer),...)

int(sin(1/x),x);
reduce
\displaylines{\qdd
\int {\sin 
      \(\frac{1}{
              x}
       

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)

\label{eq7}{{\erf \left({x}\right)}\ {\sqrt{\pi}}}\over 2(7)
Type: Union(Expression(Integer),...)

axiom
integrate(sin(x)/x,x)

\label{eq8}Si \left({x}\right)(8)
Type: Union(Expression(Integer),...)
axiom
differentiate(%,x)

\label{eq9}{\sin \left({x}\right)}\over x(9)
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)

\label{eq10}1(10)
Type: Union(f1: OrderedCompletion(Expression(Integer)),...)

axiom
integrate(atan(x/a)/x,x)

\label{eq11}\int^{
\displaystyle
x}{{{\arctan \left({\%I \over a}\right)}\over \%I}\ {d \%I}}(11)
Type: Union(Expression(Integer),...)

axiom
integrate(1/(a+z^3), z=0..1,"noPole")

\label{eq12}{\left(
\begin{array}{@{}l}
\displaystyle
-{{\sqrt{3}}\ {\log{\left({{3 \ {a^2}\ {{\root{3}\of{a^2}}^2}}+{{\left(-{2 \ {a^3}}+{a^2}\right)}\ {\root{3}\of{a^2}}}+{a^4}-{2 \ {a^3}}}\right)}}}+{2 \ {\sqrt{3}}\ {\log \left({{{\root{3}\of{a^2}}^2}+{2 \  a \ {\root{3}\of{a^2}}}+{a^2}}\right)}}+ 
\
\
\displaystyle
{{12}\ {\arctan \left({{{2 \ {\sqrt{3}}\ {\root{3}\of{a^2}}}-{a \ {\sqrt{3}}}}\over{3 \  a}}\right)}}+{2 \  \pi}
(12)
Type: Union(f1: OrderedCompletion(Expression(Integer)),...)

axiom
integrate(x^3+x^2/4+x,x)

\label{eq13}{{1 \over 4}\ {x^4}}+{{1 \over{12}}\ {x^3}}+{{1 \over 2}\ {x^2}}(13)
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)

\label{eq14}-{{2500}\ {e^{\left(-{{1 \over{50}}\  t}\right)}}}(14)
Type: Union(Expression(Fraction(Integer)),...)

axiom
integrate(exp(cos(x)),x)

\label{eq15}\int^{
\displaystyle
x}{{e^{\cos \left({\%I}\right)}}\ {d \%I}}(15)
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)

\label{eq16}{{4 \  c \ {r^3}}+{6 \  b \ {r^2}}+{{\left(-{c \ {h^2}}+{{12}\  a}\right)}\  r}}\over{{12}\  h}(16)
Type: Union(Expression(Integer),...)

axiom
integrate(exp(-(a+b*t)^2/2),t)

\label{eq17}{{\erf \left({{{b \  t}+ a}\over{\sqrt{2}}}\right)}\ {\sqrt{\pi}}}\over{b \ {\sqrt{2}}}(17)
Type: Union(Expression(Integer),...)

axiom
integrate(exp(-(a+b*t)^2/t),t)

\label{eq18}\int^{
\displaystyle
t}{{e^{{-{{\%I^2}\ {b^2}}-{2 \  \%I \  a \  b}-{a^2}}\over \%I}}\ {d \%I}}(18)
Type: Union(Expression(Integer),...)

axiom
integrate(exp(-1/t),t)

\label{eq19}\int^{
\displaystyle
t}{{e^{\left(-{1 \over \%I}\right)}}\ {d \%I}}(19)
Type: Union(Expression(Integer),...)

axiom
integrate(exp(-1/t),t=1..x)

\label{eq20}potentialPole(20)
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)

\label{eq21}{-{a \ {\erf \left({{{b \  t}+ a}\over{\sqrt{2}}}\right)}\ {\sqrt{\pi}}}-{{\sqrt{2}}\ {e^{{-{{b^2}\ {t^2}}-{2 \  a \  b \  t}-{a^2}}\over 2}}}}\over{{b^2}\ {\sqrt{2}}}(21)
Type: Union(Expression(Integer),...)

axiom
integrate(1/(a+z^3), z=0..1,"noPole")

\label{eq22}{\left(
\begin{array}{@{}l}
\displaystyle
-{{\sqrt{3}}\ {\log{\left({{3 \ {a^2}\ {{\root{3}\of{a^2}}^2}}+{{\left(-{2 \ {a^3}}+{a^2}\right)}\ {\root{3}\of{a^2}}}+{a^4}-{2 \ {a^3}}}\right)}}}+{2 \ {\sqrt{3}}\ {\log \left({{{\root{3}\of{a^2}}^2}+{2 \  a \ {\root{3}\of{a^2}}}+{a^2}}\right)}}+ 
\
\
\displaystyle
{{12}\ {\arctan \left({{{2 \ {\sqrt{3}}\ {\root{3}\of{a^2}}}-{a \ {\sqrt{3}}}}\over{3 \  a}}\right)}}+{2 \  \pi}
(22)
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 \pi 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)

\label{eq23}potentialPole(23)
Type: Union(pole: potentialPole,...)

If you would get a result, you could use limit afterwards, of course.

Mathematical Paradox?
Thu, 10 Feb 2005 17:45:57 -0600 reply
Area under the curve:
axiom
integrate(1/x,x=1..%plusInfinity)

\label{eq24}+ \infty(24)
Type: Union(f1: OrderedCompletion(Expression(Integer)),...)
Paradox Part2:
Thu, 10 Feb 2005 17:47:59 -0600 reply
Volume under that curve:
axiom
integrate(%pi*((1/x)^2), x=1..%plusInfinity)

\label{eq25}\pi(25)
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)

\label{eq26}\log \left({x}\right)(26)
Type: Union(Expression(Integer),...)

axiom
integrate(sqrt(x),x)

\label{eq27}{2 \  x \ {\sqrt{x}}}\over 3(27)
Type: Union(Expression(Integer),...)

axiom
integrate(sqrt(x^3+x),x)

\label{eq28}\int^{
\displaystyle
x}{{\sqrt{{\%I^3}+ \%I}}\ {d \%I}}(28)
Type: Union(Expression(Integer),...)

a turning moving body --unknown, Sun, 19 Jun 2005 20:16:03 -0500 reply
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)

\label{eq29}\int^{
\displaystyle
t}{{{{a \ {\sin \left({{{{\%I^2}\  o}+{2 \  \%I \  n}+{2 \  m}}\over 2}\right)}}+{b \ {\cos \left({{{{\%I^2}\  o}+{2 \  \%I \  n}+{2 \  m}}\over 2}\right)}}}\over{ot + n}}\ {d \%I}}(29)
Type: Union(Expression(Integer),...)

a turning accelerating body --unknown, Sun, 19 Jun 2005 23:16:48 -0500 reply
axiom
integrate(( a*cos( m + n*t + o*t*t/2 ) )- ( b*sin( m + n*t +
o*t*t/2 ) ), t)

\label{eq30}\int^{
\displaystyle
t}{{\left(-{b \ {\sin \left({{{{\%I^2}\  o}+{2 \  \%I \  n}+{2 \  m}}\over 2}\right)}}+{a \ {\cos \left({{{{\%I^2}\  o}+{2 \  \%I \  n}+{2 \  m}}\over 2}\right)}}\right)}\ {d \%I}}(30)
Type: Union(Expression(Integer),...)

axiom
integrate(-2*(3-3*t)^2*(3*t),t)

\label{eq31}-{{{27}\over 2}\ {t^4}}+{{36}\ {t^3}}-{{27}\ {t^2}}(31)
Type: Polynomial(Fraction(Integer))

integrate(1/(1+x**2),x=-u..u)

axiom
integrate(1/(1+x**2),x=-u..u)

\label{eq32}potentialPole(32)
Type: Union(pole: potentialPole,...)

axiom
integrate(x**6*exp(-x**2), x=0..%plusInfinity)

\label{eq33}{\Gamma \left({7 \over 2}\right)}\over 2(33)
Type: Union(f1: OrderedCompletion(Expression(Integer)),...)

integrate(1/sqrt(1/x+1),x)

axiom
integrate(1/sqrt(1/x+1),x)

\label{eq34}{-{\log \left({{\sqrt{{x + 1}\over x}}+ 1}\right)}+{\log \left({{\sqrt{{x + 1}\over x}}- 1}\right)}+{2 \  x \ {\sqrt{{x + 1}\over x}}}}\over 2(34)
Type: Union(Expression(Integer),...)

integrate(sin(sin x), x)

integrate(a/2(1-cos(bt)),t)

yet another test that shall work but not in maple ? --unknown, Thu, 09 Mar 2006 09:21:47 -0600 reply
integrate(tan(arctan(x)/3),x)

integrate(tan(arctan(x)/3),x);

integrate(x, x)

axiom
integrate(x, x)

\label{eq35}{1 \over 2}\ {x^2}(35)
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)

\label{eq36}{z^2}\over 4(36)
Type: Union(Expression(Integer),...)

axiom
simplify((1/(2*z))*z^2)

\label{eq37}z \over 2(37)
Type: Expression(Integer)
axiom
integrate((1/(2*z))*z^2, z)

\label{eq38}{z^2}\over 4(38)
Type: Union(Expression(Integer),...)

integrate(ln(x),x)

integrate(1/x,x)

axiom
integrate(0**0,x)

\label{eq39}x(39)
Type: Polynomial(Fraction(Integer))

from fr.sci.maths --unknown, Tue, 09 May 2006 09:56:50 -0500 reply
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.

from fr.sci.maths --unknown, Tue, 09 May 2006 09:58:11 -0500 reply
axiom
integrate( log(y)^3/(y*(y-1)),y)

\label{eq40}\int^{
\displaystyle
y}{{{{\log \left({\%I}\right)}^3}\over{{\%I^2}- \%I}}\ {d \%I}}(40)
Type: Union(Expression(Integer),...)

axiom
integrate(exp(-x^2),x=0..%plusInfinity)

\label{eq41}{\sqrt{\pi}}\over 2(41)
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)

\label{eq42}{-{i \ {e^{\left(2 \  i \  T \  f \  \pi \right)}}}+ i}\over{2 \  f \  \pi}(42)
Type: Union(f1: OrderedCompletion(Expression(Complex(Integer))),...)

Axiom and Maxima not capable of this integrand --WinnieThePooh?, Tue, 29 May 2007 17:24:44 -0500 reply
int(exp(sin(x)),x)
reduce

An integral which Maxima can't do, but Axiom can --amca01, Tue, 05 Jan 2010 15:08:53 -0800 reply
axiom
integrate(sqrt(x+sqrt(1+x^2))/x,x
Line 1: integrate(sqrt(x+sqrt(1+x^2))/x,x .........A......................B Error A: Missing mate. Error B: syntax error at top level Error B: Possibly missing a ) 3 error(s) parsing