# 2.8 Integration in Maple

```#
#
#                                                WORKSHEET#19
#
#                                               Integration in Maple
#
#
#
#
--------------------------------------------------------------------------------
> f:=1/(x^2+1);

1
f := ------
2
x  + 1
--------------------------------------------------------------------------------
> int(f,x);

arctan(x)
--------------------------------------------------------------------------------
> diff(",x);

1
------
2
x  + 1
--------------------------------------------------------------------------------
> Int(f,x);

/
|     1
|  ------ dx
|   2
/   x  + 1
--------------------------------------------------------------------------------
> Int(f,x)=int(f,x);

/
|     1
|  ------ dx = arctan(x)
|   2
/   x  + 1
--------------------------------------------------------------------------------
> Int(f,x)=int(f,x)+c;

/
|     1
|  ------ dx = arctan(x) + c
|   2
/   x  + 1
--------------------------------------------------------------------------------
> f:=1/sqrt(x^2-1);

1
f := -----------
2     1/2
(x  - 1)
--------------------------------------------------------------------------------
> int(f,x);

2     1/2
ln(x + (x  - 1)   )
--------------------------------------------------------------------------------
> diff(",x);

x
1 + -----------
2     1/2
(x  - 1)
---------------
2     1/2
x + (x  - 1)
--------------------------------------------------------------------------------
> simplify(");

1
-----------
2     1/2
(x  - 1)
--------------------------------------------------------------------------------
> f:=sqrt(1-x^2);

2 1/2
f := (1 - x )
--------------------------------------------------------------------------------
> int(f,x);

2 1/2
1/2 x (1 - x )    + 1/2 arcsin(x)
--------------------------------------------------------------------------------
> diff(",x);

2
2 1/2            x              1
1/2 (1 - x )    - 1/2 ----------- + -------------
2 1/2           2 1/2
(1 - x )      2 (1 - x )
--------------------------------------------------------------------------------
> simplify(");

2     1/2
I (x  - 1)
--------------------------------------------------------------------------------
> simplify("-f);

2     1/2         2 1/2
I (x  - 1)    - (1 - x )
--------------------------------------------------------------------------------
> simplify(",symbolic);

0
--------------------------------------------------------------------------------
> int(f,x=-1..1);

1/2 Pi
--------------------------------------------------------------------------------
> int(f,x=1..2);

1/2
I 3    + 1/2 arcsin(2) - 1/4 Pi
--------------------------------------------------------------------------------
> evalf((1/2)*arcsin(2));

.7853981635 - .6584789485 I
--------------------------------------------------------------------------------
> evalf("");

1.073571860 I
--------------------------------------------------------------------------------
> evalf(Pi/4);

.7853981635
--------------------------------------------------------------------------------
> subs(x=2,f);

1/2
(-3)
--------------------------------------------------------------------------------
> evalf(");

1.732050808 I
--------------------------------------------------------------------------------
> f:=1/sqrt(1-x^4);

1
f := -----------
4 1/2
(1 - x )
--------------------------------------------------------------------------------
> int(f,x);\

/
|       1
|  ----------- dx
|        4 1/2
/   (1 - x )
--------------------------------------------------------------------------------
> evalf(int(f,x=0..1));

1.311028778
--------------------------------------------------------------------------------
> evalf(Int(f,x=0..1));

1.311028777
--------------------------------------------------------------------------------
> Digits:=20:
--------------------------------------------------------------------------------
> evalf(int(f,x=0..1));

1.3110287771460599053
--------------------------------------------------------------------------------
> evalf(Int(f,x=0..1));

1.3110287771460599052
--------------------------------------------------------------------------------
> Digits:=10:
--------------------------------------------------------------------------------
> int(f,x=0..1);

3/2  1/2
Pi    2
1/4 -----------
2
GAMMA(3/4)
--------------------------------------------------------------------------------
> evalf(");

1.311028778
--------------------------------------------------------------------------------
> Int(f,x=0..1);

1
/
|       1
|  ----------- dx
|        4 1/2
/   (1 - x )
0
--------------------------------------------------------------------------------
> evalf(");

1.311028777
--------------------------------------------------------------------------------
> f:=(x^2+x+1)/(x^4-1);\

2
x  + x + 1
f := ----------
4
x  - 1
--------------------------------------------------------------------------------
> partialfrac(");

2
x  + x + 1
partialfrac(----------)
4
x  - 1
--------------------------------------------------------------------------------
> ?partialfrac
Try one of the following topics:

{parse, parfrac, parametric, parity, parallel, parampass, parameter, partition}
--------------------------------------------------------------------------------
> parfrac(f);

2
x  + x + 1
parfrac(----------)
4
x  - 1
--------------------------------------------------------------------------------
> ?parfrac
--------------------------------------------------------------------------------
> convert(f,parfrac,x);

3           1              x
--------- - --------- - 1/2 ------
4 (x - 1)   4 (x + 1)        2
x  + 1
--------------------------------------------------------------------------------
> int(",x);

2
3/4 ln(x - 1) - 1/4 ln(x + 1) - 1/4 ln(x  + 1)
--------------------------------------------------------------------------------
> diff(",x);

3           1              x
--------- - --------- - 1/2 ------
4 (x - 1)   4 (x + 1)        2
x  + 1
--------------------------------------------------------------------------------
> f:=1/(x^3-1);

1
f := ------
3
x  - 1
--------------------------------------------------------------------------------
> g:=int(f,x);

2                 1/2                       1/2
g := 1/3 ln(x - 1) - 1/6 ln(x  + x + 1) - 1/3 3    arctan(1/3 (2 x + 1) 3   )
--------------------------------------------------------------------------------
> plot(g,x=1..4);
--------------------------------------------------------------------------------
#

** Maple V Graphics **

--------------------------------------------------------------------------------
> limit(g,x,right);
Error, (in limit) invalid arguments

--------------------------------------------------------------------------------
> ?limit
--------------------------------------------------------------------------------
> limit(g,x=1,right);

- infinity
--------------------------------------------------------------------------------
> limit(g,x=1,left);

- infinity
--------------------------------------------------------------------------------
> g(-2);

2
1/3 ln(x - 1)(-2) - 1/6 ln(x  + x + 1)(-2)

1/2                       1/2
- 1/3 3    arctan(1/3 (2 x + 1) 3   )(-2)
--------------------------------------------------------------------------------
> subs(x=-2,g);

1/2           1/2
1/3 ln(-3) - 1/6 ln(3) - 1/3 3    arctan(- 3   )
--------------------------------------------------------------------------------
> evalf(");

.7877018364 + 1.047197551 I
--------------------------------------------------------------------------------
> ln(-3);

ln(-3)
--------------------------------------------------------------------------------
> evalf(");

1.098612289 + 3.141592654 I
--------------------------------------------------------------------------------
> subs(x=2.0,g);

1/2                     1/2
1/3 ln(1.0) - 1/6 ln(7.00) - 1/3 3    arctan(1.666666667 3   )
--------------------------------------------------------------------------------
> evalf(");

-1.038687215
--------------------------------------------------------------------------------
> limit(g,x=infinity);

1/2
- 1/6 3    Pi
--------------------------------------------------------------------------------
> evalf(");

-.9068996827
--------------------------------------------------------------------------------
> int(f,x=0..2);

2
/
|     1
|  ------ dx
|   3
/   x  - 1
0
--------------------------------------------------------------------------------
> evalf(");
Error, (in evalf/int) unable to handle singularity

--------------------------------------------------------------------------------
> int(f,x=0..0.9);

1/2
- 1.520747795 + 1.047197551 I + 1/18 3    Pi - 1/3 I Pi
--------------------------------------------------------------------------------
> evalf(");

-1.218447901
--------------------------------------------------------------------------------
> evalf(Int(f,x=0..0.9));

-1.218447901
--------------------------------------------------------------------------------
> int(f,x=2..infinity);

1/2                       1/2             1/2
- 1/6 3    Pi + 1/6 ln(7) + 1/3 3    arctan(5/3 3   )
--------------------------------------------------------------------------------
> evalf(");

.1317875321
--------------------------------------------------------------------------------
> g:=int(exp(-x^2),x);

1/2
g := 1/2 Pi    erf(x)
--------------------------------------------------------------------------------
> diff(g,x);

2
exp(- x )
--------------------------------------------------------------------------------
> subs(x=0,g);

1/2
1/2 Pi    erf(0)
--------------------------------------------------------------------------------
> erf(0);

0
--------------------------------------------------------------------------------
> ?erf
--------------------------------------------------------------------------------
> int(exp(-x^2),x=0..infinity);

1/2
1/2 Pi
> erf(infinity);

1
--------------------------------------------------------------------------------
> int((sin(x))^4,x);

3
- 1/4 sin(x)  cos(x) - 3/8 cos(x) sin(x) + 3/8 x
--------------------------------------------------------------------------------
> diff(",x);

2       2             4             2             2
- 3/4 sin(x)  cos(x)  + 1/4 sin(x)  + 3/8 sin(x)  - 3/8 cos(x)  + 3/8
--------------------------------------------------------------------------------
> simplify(");

2             4
- 2 cos(x)  + 1 + cos(x)
--------------------------------------------------------------------------------
> simplify("-(sin(x))^4);

0
--------------------------------------------------------------------------------
> int(sin(x)/x,x);

Si(x)
> ?Si
--------------------------------------------------------------------------------
> Si(0);

0
--------------------------------------------------------------------------------
> Si(infinity);

1/2 Pi
--------------------------------------------------------------------------------
> Int(sin(x)/x,x=0..infinity)=Si(infinity);

infinity
/
|      sin(x)
|      ------ dx = 1/2 Pi
|         x
/
0
--------------------------------------------------------------------------------
> f:='f':
--------------------------------------------------------------------------------
> L(f)=Int(exp(-s*t)*f(t),t=0..infinity);

infinity
/
|
L(f) =    |      exp(- s t) f(t) dt
|
/
0
--------------------------------------------------------------------------------
> int(exp(-s*t),t=0..infinity);

exp(- s t)
limit          - ---------- + 1/s
t -> infinity-        s
--------------------------------------------------------------------------------
> assume(s>0);
--------------------------------------------------------------------------------
> int(exp(-s*t),t=0..infinity);

1
----
s~
--------------------------------------------------------------------------------
Originally s, renamed s~:
is assumed to be: RealRange(Open(0),infinity)

--------------------------------------------------------------------------------
> Int(exp(-s*t)*t^(1/2),t=0..infinity)=int(exp(-s*t)*t^(1/2),t=0..infinity);

infinity
/                                 1/2
|                   1/2          Pi
|      exp(- s~ t) t    dt = 1/2 -----
|                                  3/2
/                                 s~
0
--------------------------------------------------------------------------------
> Int(exp(-s*t)*exp(t),t=0..infinity)=int(exp(-s*t)*exp(t),t=0..infinity);

infinity
/
|                                               exp(t) exp(- s~ t)      1
|      exp(- s~ t) exp(t) dt = limit          - ------------------ + ------
|                              t -> infinity-         s~ - 1         s~ - 1
/
0
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
> Int(exp(-s*t)*exp(t),t=0..infinity)=int(exp(-s*t)*exp(t),t=0..infinity);

infinity
/
|                                 1
|      exp(- s~ t) exp(t) dt = ------
|                              s~ - 1
/
0
--------------------------------------------------------------------------------
Originally s, renamed s~:
is assumed to be: RealRange(Open(1),infinity)

--------------------------------------------------------------------------------
> s:='s':
--------------------------------------------------------------------------------
> ?laplace
--------------------------------------------------------------------------------
> laplace(1,t,s);

1/s
--------------------------------------------------------------------------------
> laplace(t^(1/2),t,s);laplace(t*exp(t),t,s);laplace(exp(a*t),t,s);\
laplace(sin(b*t),t,s);

1/2
Pi
1/2 -----
3/2
s

1
--------
2
(s - 1)

1
-----
s - a

b
-------
2    2
s  + b
--------------------------------------------------------------------------------
> ?invlaplace
--------------------------------------------------------------------------------
> invlaplace(s/(s^2+b^2),s,t);

cos(b t)
--------------------------------------------------------------------------------
> invlaplace(1/(s-1)^3,s,t);invlaplace(1/sqrt(s^2+b^2),s,t);\
invlaplace(exp(-s^2),s,t);

2
1/2 t  exp(t)

BesselJ(0, b t)

2
invlaplace(exp(- s ), s, t)
--------------------------------------------------------------------------------

```