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

## Integration

Let's do some integration examples:

fricas
integrate(%e^x, x)
 (1)
Type: Union(Expression(Integer),...)

 int(cos(x),x,0,pi); reduce

fricas
integrate(x^2/sqrt(4-x^2),x)
 (2)
Type: Union(Expression(Integer),...)

Below FriCAS gives up because sign of a is unknown:

fricas
integrate(exp(-a*x^2),x=0..%plusInfinity)
 (3)
Type: Union(fail: failed,...)

The following won't "work", see CommonMistakes:

fricas
integrate(exp(-a::PositiveInteger*x^2),x=0..%plusInfinity)
Cannot convert from type Variable(a) to PositiveInteger for value
a

fricas
integrate((x^3+x^2+2)/(x*(x^2-1)^2), x)
 (4)
Type: Union(Expression(Integer),...)

fricas
integrate(2*x/sin(x)^2,x)
 (5)
Type: Union(Expression(Integer),...)

Comparing Axiom and Reduce:

fricas
integrate(sin(1/x),x)
 (6)
Type: Union(Expression(Integer),...)

 int(sin(1/x),x); reduce

 load_package algint; int(sin(1/x),x); reduce

A different problem, where Axiom has to give up:

fricas
integrate(sqrt(sin(1/x)),x)
>> Error detected within library code:
integrate: implementation incomplete (constant residues)

In Reduce:

 load_package algint; int(sqrt(sin(1/x)),x); reduce

fricas
integrate(exp(-x^2),x)
 (7)
Type: Union(Expression(Integer),...)

fricas
integrate(sin(x)/x,x)
 (8)
Type: Union(Expression(Integer),...)
fricas
differentiate(%,x)
 (9)
Type: Expression(Integer)

fricas
integrate(sin(1/x),x=%minusInfinity..%plusInfinity,"noPole")
>> Error detected within library code:
integrate: pole in path of integration

fricas
integrate(2*x/sin(x)^2,x=1/2..1)
 (10)
Type: Union(pole: potentialPole,...)

fricas
integrate(sin(x),x=0..%pi/2)
 (11)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
integrate(atan(x/a)/x,x)
 (12)
Type: Union(Expression(Integer),...)

fricas
integrate(1/(a+z^3), z=0..1,"noPole")
 (13)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
integrate(x^3+x^2/4+x,x)
 (14)
Type: Polynomial(Fraction(Integer))

You cannot integrate Expression Float

fricas
integrate(50*%e^(-0.02*t),t)
There are 12 exposed and 10 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

fricas
integrate(50*%e^(-0.02*t)::Expression Fraction Integer,t)
 (15)
Type: Union(Expression(Fraction(Integer)),...)

fricas
integrate(exp(cos(x)),x)
 (16)
Type: Union(Expression(Integer),...)

fricas
integrate(sin(x),x)
 (17)
Type: Union(Expression(Integer),...)
fricas
integrate(%,x)
 (18)
Type: Union(Expression(Integer),...)

fricas
integrate(a/h - c*h/12 + (b/h)*r + (c/h)*r^2,r)
 (19)
Type: Union(Expression(Integer),...)

fricas
integrate(exp(-(a+b*t)^2/2),t)
 (20)
Type: Union(Expression(Integer),...)

fricas
integrate(exp(-(a+b*t)^2/t),t)
 (21)
Type: Union(Expression(Integer),...)

fricas
integrate(exp(-1/t),t)
 (22)
Type: Union(Expression(Integer),...)

fricas
integrate(exp(-1/t),t=1..x)
 (23)
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}


fricas
integrate(t*exp(-(a+b*t)^2/2),t)
 (24)
Type: Union(Expression(Integer),...)

fricas
integrate(1/(a+z^3), z=0..1,"noPole")
 (25)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

From the ReduceProblem?:

fricas
integrate(1/sqrt(2*%pi)*exp(-1/2*log(x)^2),x=0..%plusInfinity)
 (26)
Type: Union(fail: failed,...)
fricas
integrate(1/sqrt(2*%pi)*exp(-1/2*log(x)^2),x)
 (27)
Type: Union(Expression(Integer),...)

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:
fricas
integrate(1/x,x=1..%plusInfinity)
 (28)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
Paradox Part2:
Thu, 10 Feb 2005 17:47:59 -0600 replyVolume under that curve:
fricas
integrate(%pi*((1/x)^2), x=1..%plusInfinity)
 (29)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

Curve has an infinite area...but a finite volume (I think I did this correctly)!

fricas
integrate(1/x,x)
 (30)
Type: Union(Expression(Integer),...)
fricas
integrate(sqrt(x),x)
 (31)
Type: Union(Expression(Integer),...)
fricas
integrate(sqrt(x^3+x),x)
 (32)
Type: Union(Expression(Integer),...)

a turning moving body --unknown, Sun, 19 Jun 2005 20:16:03 -0500 reply
fricas
integrate(( a*sin( m + n*t + o*t*t/2 ) )/( n + ot ) + ( b*cos( m + n*t + o*t*t/2 ) )/( n + ot ), t)
 (33)
Type: Union(Expression(Integer),...)

a turning accelerating body --unknown, Sun, 19 Jun 2005 23:16:48 -0500 reply
fricas
integrate(( a*cos( m + n*t + o*t*t/2 ) )- ( b*sin( m + n*t + o*t*t/2 ) ), t)
 (34)
Type: Union(Expression(Integer),...)

fricas
integrate(-2*(3-3*t)^2*(3*t),t)
 (35)
Type: Polynomial(Fraction(Integer))

fricas
integrate(1/(1+x^2),x=-u..u)
 (36)
Type: Union(pole: potentialPole,...)
fricas
integrate(1/(1+x^2),x=-u..u, "noPole")
 (37)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
integrate(x^6*exp(-x^2), x=0..%plusInfinity)
 (38)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
integrate(1/sqrt(1/x+1),x)
 (39)
Type: Union(Expression(Integer),...)

fricas
integrate(sin(sin x), x)
 (40)
Type: Union(Expression(Integer),...)

fricas
integrate(a/2*(1-cos(b*t)),t)
 (41)
Type: Union(Expression(Integer),...)

yet another test that shall work but not in maple ? --unknown, Thu, 09 Mar 2006 09:21:47 -0600 reply
fricas
integrate(tan(atan(x)/3),x)
 (42)
Type: Union(Expression(Integer),...)

fricas
integrate(x, x)
 (43)
Type: Polynomial(Fraction(Integer))
fricas
simplify((1/(2*z))*z^2)
 (44)
Type: Expression(Integer)
fricas
integrate((1/(2*z))*z^2, z)
 (45)
Type: Union(Expression(Integer),...)
fricas
integrate(log(x),x)
 (46)
Type: Union(Expression(Integer),...)
fricas
integrate(1/x,x)
 (47)
Type: Union(Expression(Integer),...)
fricas
integrate(0^0,x)
 (48)
Type: Polynomial(Fraction(Integer))

from fr.sci.maths --unknown, Tue, 09 May 2006 09:58:11 -0500 reply
fricas
integrate( log(y)^3/(y*(y-1)),y)
 (49)
Type: Union(Expression(Integer),...)

fricas
integrate(exp(-x^2),x=0..%plusInfinity)
 (50)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

fricas
integrate(x^2*exp(-x^2),x=0..%plusInfinity)
 (51)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)

No ; after command or else output is supressed.
fricas
integrate(exp(%i*2*%pi*f*t), t=0..T)
 (52)
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

fricas
integrate(exp(sin(x)),x)
 (53)
Type: Union(Expression(Integer),...)

An integral which Maxima can't do, but Axiom can --amca01, Tue, 05 Jan 2010 15:08:53 -0800 reply
fricas
integrate(sqrt(x+sqrt(1+x^2))/x,x)
 (54)
Type: Union(Expression(Integer),...)

 Subject:   Be Bold !! ( 14 subscribers )
Please rate this page: