0% found this document useful (0 votes)
64 views153 pages

Practical File Name: Harshit Singh Course: B.SC (H) Mathematics Roll Number: 21BMAT100 Submitted To: Ms Rajni Gupta

This document contains a practical file submitted by Harshit Singh for the course B.Sc (H) Mathematics. It includes solving various first and second order differential equations using desolve and ode2 commands in Maple. The document plots the family of solutions obtained for different initial conditions.

Uploaded by

Harshit Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views153 pages

Practical File Name: Harshit Singh Course: B.SC (H) Mathematics Roll Number: 21BMAT100 Submitted To: Ms Rajni Gupta

This document contains a practical file submitted by Harshit Singh for the course B.Sc (H) Mathematics. It includes solving various first and second order differential equations using desolve and ode2 commands in Maple. The document plots the family of solutions obtained for different initial conditions.

Uploaded by

Harshit Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 153

Practical File

Name : Harshit Singh

Course : B.Sc (H) Mathematics

Roll Number : 21BMAT100

Submitted to : Ms Rajni Gupta


HARSHIT).wxmx 1 / 17

1 Plotting first order solution


families
Using both ode2 and
desolve.(Wherever possible)
(Take y(0)=k and k = -2,-1,0,1,2)
1.1 y' = x²
a:diff(y(x),x)=x²;
d 2
y( x ) = x
dx
1.1.1 Using Desolve Command
Gen_Sol1:desolve(a,y(x));
3
x
y( x ) = +y( 0 )
3
Sol1:ev(Gen_Sol1,y(0):makelist(k,k,−2,2));
3 3 3 3 3
y( x ) = x −2 ,
x
−1 ,
x
,
x
+1 ,
x
+2
3 3 3 3 3
1.1.2 Using ODE2 Command
Gen_Sol2:ode2(a,y(x),x);
Sol2:ev(Gen_Sol2,%c:makelist(k,k,−2,2));
3
x
y( x ) = +%c
3
3 3 3 3 3
y( x ) = x −2 ,
x
−1 ,
x
,
x
+1 ,
x
+2
3 3 3 3 3
1.1.3 Family of Solutions:
HARSHIT).wxmx 2 / 17

wxplot2d(rhs(Sol2),[x,−3,3],[axes,solid],
[ylabel,"Solutions"],[style,[linespoints,1,0.2,1,1],[linespoints,1,0.2,3,1],
[linespoints,1,0.2,4,1],[linespoints,1,0.2,5,1],[linespoints,1,0.2,2,1]]);

1.2 y' = 9.8 - 0.196y


b:diff(y(x),x)=9.8−0.196·y(x);
d
y( x ) = 9.8 −0.196 y( x )
dx
1.2.1 Using Desolve
Gen_Sol3:desolve(b,y(x));
rat: replaced -0.196 by -49/250 = -0.196
rat: replaced 9.8 by 49/5 = 9.8
rat: replaced -0.196 by -49/250 = -0.196
rat: replaced -9.8 by -49/5 = -9.8
rat: replaced 0.196 by 49/250 = 0.196
49 x

250
( 250 y( 0 ) − 12500 ) %e
y( x ) = +50
250
Sol3:ev(Gen_Sol3,y(0)=makelist(k,k,−2,2));
49 x 49 x
− −
250 250
y( x ) = [ 50 −52 %e , 50 −51 %e , 50 −50
49 x 49 x 49 x
− − −
250 250 250
%e , 50 −49 %e , 50 −48 %e ]
1.2.2 Using ode2
Gen_Sol4:ode2(b,y(x),x);
Sol4:ev(Gen_Sol4,%c=makelist(k,k,−2,2));
rat: replaced -9.8 by -49/5 = -9.8
rat: replaced 0.196 by 49/250 = 0.196
rat: replaced -9.8 by -49/5 = -9.8
HARSHIT).wxmx 3 / 17

rat: replaced 0.196 by 49/250 = 0.196


rat: replaced -9.8 by -49/5 = -9.8
rat: replaced 0.196 by 49/250 = 0.196
49 x
− 49 x
250
y( x ) = %e 250
50 %e +%c
49 x 49 x
− 49 x

250 250
y( x ) = [ %e 250 , %e
50 %e −2
49 x 49 x
49 x
− 49 x

250 250
250 , 50 ,%e 250 , %e
50 %e −1 50 %e +1
49 x
250 ]
50 %e +2
1.2.3 Family of solutions:
wxplot2d(rhs(Sol4),[x,−4,4],[axes,solid],[legend,"C=1","C=2","C=3","C=4","C
[title,"Family of Solutions"]);

1.3 y'cos(x) + ysin(x) = 2cos^(3)(x)sin(x) -


1
eqn3:diff(y(x),x)·cos(x) + y(x)·sin(x) = 2·cos(x)^(3)·sin(x)−1;
d 3
cos ( x ) y( x ) +y( x ) sin ( x ) = 2 cos ( x ) sin ( x ) −1
dx
1.3.1 Solving using desolve
Not possible to solve using desolve since it's an implicit
equation
1.3.2 Solving using ode2
soln32:ode2(eqn3,y(x),x);
HARSHIT).wxmx 4 / 17

1
y( x ) = cos( x ) − 2
−tan ( x ) + %c
tan ( x ) + 1
k:makelist(a,a,−2,2);
[ −2 ,−1 ,0 , 1 ,2 ]
fsoln32:ev(soln32,%c=k);
1
y( x ) = [ cos ( x ) − 2
−tan ( x ) −2 , cos ( x )
tan ( x ) + 1
1
− −tan ( x ) −1 , cos ( x )
2
tan ( x ) + 1
1
− −tan ( x ) , cos ( x )
2
tan ( x ) + 1
1
− −tan ( x ) + 1 , cos ( x )
2
tan ( x ) + 1
1
− −tan ( x ) + 2 ]
2
tan ( x ) + 1
1.3.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln32),[x,−10,10]);

2 Plotting Second Order Solution


Families using both ode2 and
desolve.
Take any 4 − 5 values of constants
used in initial conditions.
2.1 y''+3y'+2y=0, y(0)=a,y'(0)=1
HARSHIT).wxmx 5 / 17

eqn41:diff(y(x),x,2)+3·diff(y(x),x)+2·y(x)=0;
2
d d
y( x ) + 3 y( x ) +2 y( x ) = 0
2 dx
dx
2.1.1 Solving using desolve
soln41:desolve(eqn41,y(x));
−x d
y( x ) = %e y( x ) +2 y( 0 ) +%e − 2 x
dx
x=0
d
− y( x ) −y( 0 )
dx
x=0
a:makelist(a,a,−2,2);
[ −2 ,−1 ,0 , 1 ,2 ]
fsoln41:ev(soln41, y(0)=a, diff(y(x),x)=1);
−2 x −x −x −x −2 x
y( x ) = [ %e −3 %e ,−%e , %e −%e ,3
−x −2 x −x −2 x
%e −2 %e , 5 %e −3 %e ]
2.1.2 Solving using ode2
eqn42:'diff(y,x,2)+3·'diff(y,x)+2·y=0;
2
d d
y +3 y +2 y =0
2 dx
dx
soln42:ode2(eqn42,y,x);
−x −2 x
y =%k1 %e +%k2 %e
fsoln42:y(x)=makelist(rhs((ic2(soln42, x=0, y=a, diff(y,x)=1))),a,−2,2);
−2 x −x −x −x −2 x
y( x ) = [ %e −3 %e ,−%e , %e −%e ,3
−x −2 x −x −2 x
%e −2 %e , 5 %e −3 %e ]
2.1.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln42),[x,−2,2]);
HARSHIT).wxmx 6 / 17

2.2 y''+3y'+2y=0, y(0)=1,y'(0)=b


eqn51:diff(y(x),x,2)+3·diff(y(x),x)+2·y(x)=0;
2
d d
y( x ) + 3 y( x ) +2 y( x ) = 0
2 dx
dx
2.2.1 Solving using desolve
soln51:desolve(eqn51,y(x));
−x d
y( x ) = %e y( x ) +2 y( 0 ) +%e − 2 x
dx
x=0
d
− y( x ) −y( 0 )
dx
x=0
b:makelist(b,b,−2,2);
[ −2 ,−1 ,0 , 1 ,2 ]
fsoln51:ev(soln51, y(0)=1, diff(y(x),x)=b);
−2 x −x −x −2 x −x
y( x ) = [ %e , %e , 2 %e −%e , 3 %e −2
−2 x −x −2 x
%e , 4 %e −3 %e ]
2.2.2 Solving using ode2
eqn52:'diff(y,x,2)+3·'diff(y,x)+2·y=0;
2
d d
y +3 y +2 y =0
2 dx
dx
soln52:ode2(eqn52,y,x);
−x −2 x
y =%k1 %e +%k2 %e
fsoln52:y(x)=makelist(rhs((ic2(soln52, x=0, y=1, diff(y,x)=b))),b,−2,2);
−2 x −x −x −2 x −x
y( x ) = [ %e , %e , 2 %e −%e , 3 %e −2
HARSHIT).wxmx 7 / 17

−2 x −x −2 x
%e , 4 %e −3 %e ]
2.2.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln52),[x,−1,1]);

2.3 y''+y'-6y=0, y(0) = a, y'(0) = b


eqn61:diff(y(x),x,2)+diff(y(x),x)−6·y(x)=0;
2
d d
y( x ) + y( x ) −6 y( x ) = 0
2 dx
dx
2.3.1 Solving using desolve
soln61:desolve(eqn61,y(x));
2x d
%e y( x ) + 3 y( 0 )
dx
x=0
y( x ) = −
5
−3 x d
%e y( x ) − 2 y( 0 )
dx
x=0

5
a:makelist(a,a,−2,2);
[ −2 ,−1 ,0 , 1 ,2 ]
b:−7;
−7
fsoln61:ev(soln61, y(0)=a, diff(y(x),x)=b);
−3 x 2x
3 %e 13 %e −3 x 2x
y( x ) = [ − , %e −2 %e ,
5 5
−3 x 2x −3 x 2x −3 x
7 %e 7 %e 9 %e 4 %e 11 %e
− , − , −
5 5 5 5 5
HARSHIT).wxmx 8 / 17

2x
%e
]
5
2.3.2 Solving using ode2
eqn62:'diff(y,x,2)+'diff(y,x)−6·y=0;
2
d d
y+ y −6 y =0
2 dx
dx
soln62:ode2(eqn62,y,x);
2x −3 x
y =%k1 %e +%k2 %e
fsoln62:y(x)=makelist(rhs((ic2(soln62, x=0, y=a, diff(y,x)=−7))),a,−2,2);
−3 x 2x
3 %e 13 %e −3 x 2x
y( x ) = [ − , %e −2 %e ,
5 5
−3 x 2x −3 x 2x −3 x
7 %e 7 %e 9 %e 4 %e 11 %e
− , − , −
5 5 5 5 5
2x
%e
]
5
2.3.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln62),[x,−1,1]);

2.4 y''-y=0, y(0)=1,y'(0)=1


eqn71:diff(y(x),x,2)−y(x)=0;
2
d
y( x ) −y( x ) = 0
2
dx
2.4.1 Solving using desolve
soln71:desolve(eqn71,y(x));
HARSHIT).wxmx 9 / 17

x d
%e y( x ) + y( 0 )
dx
x=0
y( x ) = −
2
−x d
%e y( x ) − y( 0 )
dx
x=0

2
fsoln71:ev(soln71, y(0)=1, diff(y(x),x)=1);
x
y( x ) = %e
2.4.2 Solving using ode2
eqn72:'diff(y,x,2)−y=0;
2
d
y −y =0
2
dx
soln72:ode2(eqn72,y,x);
x −x
y =%k1 %e +%k2 %e
fsoln72:y(x)=rhs((ic2(soln72, x=0, y=1, diff(y,x)=1)));
x
y( x ) = %e
2.4.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln72),[x,−3,3]);

3 Plotting Third Order Solution


Families. Take any 3−4 values of
constants
used in initial conditions.
HARSHIT).wxmx 10 / 17

3.1 y''' − 5y'' + 8y' − 4y = 0 , y(0) = c1, y'(0)


= c2, y''(0) = c3
eqn81: diff(y(x),x,3)− 5·diff(y(x),x,2)+ 8·diff(y(x),x)−4·y(x)=0;
3 2
d d d
y( x ) −5 y( x ) +8 y( x ) −4 y( x ) = 0
3 2 dx
dx dx
3.1.1 Solving using desolve
soln81: desolve(eqn81,y(x));
x
y( x ) = %e
2
d d
y( x ) −4 d x y( x ) +4 y( 0 ) +x %e 2 x
2
dx x=0
x=0
2
d 2x
y( x ) +%e
2
dx
x=0
2
d d
− y( x ) +4 d x y( x ) −3 y( 0 ) −3 x %e 2 x
2
dx x=0
x=0
d 2x
y( x ) +2 y( 0 ) x %e
dx
x=0
c1:makelist(a,a,1,5);
c2:7;
c3:−5;
[ 1 ,2 , 3 ,4 , 5 ]
7
−5
fsoln81:ev(soln81, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
2x 2x x 2x
y( x ) = [−24 x %e +30 %e −29 %e ,−22 x %e
2x x 2x 2x x
+27 %e −25 %e ,−20 x %e +24 %e −21 %e ,−18
2x 2x x 2x 2x
x %e +21 %e −17 %e ,−16 x %e +18 %e −13
HARSHIT).wxmx 11 / 17

x
%e ]
3.1.2 Solving using ode2
Not possible since it's a third degree equation
3.1.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln81),[x,2,5]);

3.2 y''' − 12y'' + 48y' − 64y = 12 - 32e^(-8x)


+2e^(4x) , y(0) = c1, y'(0) = c2, y''(0) = c3
eqn91: diff(y(x),x,3)− 12·diff(y(x),x,2)+ 48·diff(y(x),x)−64·y(x)=12 − 32·%e^(
3 2
d d d
y( x ) −12 y( x ) +48 y( x ) −64 y( x )
3 2 dx
dx dx
4x −8 x
=2 %e −32 %e +12
3.2.1 Solving using desolve
soln91: desolve(eqn91,y(x));
2 4x
y( x ) = x %e
2
d d
3 y( x ) −24 d x y( x ) +48 y( 0 ) +1 / 18 +
2
dx x=0
x=0
2
2 4x d
x %e y( x )
2
dx
x=0
+
3
4x d
x %e 36 d x y( x ) − 144 y( 0 ) − 19
x=0

54
HARSHIT).wxmx 12 / 17

2 4x d 4x d
8 x %e y( x ) x %e y( x )
dx dx
x=0 x=0
+ +
3 3
3 4x 2 4x 2 4x 4x
x %e 16 y( 0 ) x %e x %e 4 y( 0 ) x %e
+ + −
3 3 9 3
4x 4x −8 x
19 x %e ( 432 y( 0 ) + 73 ) %e %e 3
− + + −
108 432 54 16
c1:1;
c2:makelist(a,a,2,7);
c3:−5;
1
[ 2 ,3 , 4 ,5 , 6, 7 ]
−5
fsoln91:ev(soln91, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
3 4x 2 4x 4x
x %e 7 x %e 91 x %e
y( x ) = [ − − +
3 3 36
4x −8 x 3 4x 2 4x
505 %e %e 3 x %e 19 x %e
+ − , − −
432 54 16 3 3
4x 4x −8 x 3 4x
55 x %e 505 %e %e 3 x %e
+ + − , −
36 432 54 16 3
2 4x 4x 4x −8 x
31 x %e 19 x %e 505 %e %e 3
− + + − ,
3 36 432 54 16
3 4x 2 4x 4x 4x
x %e 43 x %e 17 x %e 505 %e
− + + +
3 3 36 432
−8 x 3 4x 2 4x 4x
%e 3 x %e 55 x %e 53 x %e
− , − + +
54 16 3 3 36
4x −8 x 3 4x 2 4x
505 %e %e 3 x %e 67 x %e
+ − , − +
432 54 16 3 3
4x 4x −8 x
89 x %e 505 %e %e 3
+ + − ]
36 432 54 16
HARSHIT).wxmx 13 / 17

3.2.2 Solving using ode2


Not possible since it's a third degree equation
3.2.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln91),[x,2,5]);

3.3 y''' + y' = 0 , y(0) = 0, y'(0) = 1, y''(0) = 2


eqn101: diff(y(x),x,3)+ diff(y(x),x)=0;
3
d d
y( x ) + y( x ) = 0
3 dx
dx
3.3.1 Solving using desolve
soln101: desolve(eqn101,y(x));
2 2
d d
y( x ) = −cos( x ) y( x ) + y( x ) +
2 2
dx dx
x=0 x=0
d
sin ( x ) d x y( x ) +y( 0 )
x=0

3.3.1.1 General solution


c1:makelist(a,a,1,5);
c2:7;
c3:−5;
[ 1 ,2 , 3 ,4 , 5 ]
7
−5
fsoln101g:ev(soln101, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
y( x ) = [ 7 sin( x ) + 5 cos( x ) −4 ,7 sin ( x ) + 5 cos ( x ) −3 ,
7 sin ( x ) + 5 cos( x ) −2 ,7 sin ( x ) + 5 cos( x ) −1 ,7 sin ( x ) + 5
HARSHIT).wxmx 14 / 17

cos ( x ) ]
3.3.1.2 Particular solution
c1:0;
c2:1;
c3:2;
0
1
2
fsoln101p:ev(soln101, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
y( x ) = sin ( x ) −2 cos ( x ) + 2
3.3.2 Solving using ode2
Not possible since it's a third degree equation
3.3.3 Plotting the family of Solutions
3.3.3.1 General Solution
wxplot2d(rhs(fsoln101g),[x,−5,5]);

3.3.3.2 Particular solution


wxplot2d(rhs(fsoln101p),[x,−5,5]);

3.4 y''' -3y'' + 3y' -y = 0


eqn111: diff(y(x),x,3)−3·diff(y(x),x,2)+3·diff(y(x),x)−y(x)=0;
3 2
d d d
y( x ) −3 y( x ) +3 y( x ) −y( x ) = 0
3 2 dx
dx dx
HARSHIT).wxmx 15 / 17

3.4.1 Solving using desolve


soln111: desolve(eqn111,y(x));
2
2 x d
x %e y( x )
2
dx
x=0
y( x ) = +
2
x d
x %e y( x ) − y( 0 )
dx 2 x d
x=0
−x %e y( x ) +
2 dx
x=0

x d
x %e y( x ) 2 x x
dx
x=0 y( 0 ) x %e y( 0 ) x %e
+ − +y( 0 )
2 2 2
x
%e
3.4.1.1 General Soln
c1:makelist(a,a,1,7);
c2:4;
c3:9;
[ 1 ,2 , 3 ,4 , 5, 6 ,7 ]
4
9
fsolng:ev(soln111, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
2 x
2 x x x 3 x %e x
y( x ) = [x %e +3 x %e +%e , +2 x %e +
2
2 x
x 2 x x x 5 x %e x 2
2 %e , 2 x %e +x %e +3 %e , +4 %e , 3 x
2
2 x
x x x 7 x %e x x 2
%e −x %e +5 %e , −2 x %e +6 %e , 4 x
2
x x x
%e −3 x %e +7 %e ]
3.4.1.2 Particular Soln 1, c1=2, c2=-1, c3=7
HARSHIT).wxmx 16 / 17

c1:2;
c2:−1;
c3:7;
2
−1
7
fsolnp1:ev(soln111, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
2 x x x
y( x ) = 6 x %e −8 x %e +3 %e
3.4.1.3 Particular Soln 2, c1=3, c2=-5, c3=-1
c1:3;
c2:−5;
c3:−1;
3
−5
−1
fsolnp2:ev(soln111, y(0)=c1, diff(y(x),x)=c2, diff(y(x),x,2)=c3);
2 x x x
y( x ) = 6 x %e −8 x %e +3 %e
3.4.2 Solving using ode2
Not possible since it's a third degree equation
3.4.3 Plotting the family of Solutions
3.4.3.1 General Solution
wxplot2d(rhs(fsolng),[x,−5,5]);

3.4.3.2 Particular Solution 1


wxplot2d(rhs(fsolnp1),[x,−3,2]);
HARSHIT).wxmx 17 / 17

3.4.3.3 Particular Solution 2


wxplot2d(rhs(fsolnp2),[x,−2,2]);
Harshit_Singh_Practical02.wxm 1 / 3

1 Plot exponential growth and


decay model .
Also, find the population in 2022
and iundicate
the graph of both growthand
decay model.
(Take per capita birth rate =
0.027,
per capita death rate = 0.010 and
initial
population 5.3 million at base
year 2000.)

1.1 Exponential Growth Model


p:0.027$; /*per capita birth rate*/
q:0.010$; /*per capita death rate*/
k:p−q; /*growth rate*/
0.017
DE:diff(x(t),t)=k·x(t);
d
x( t ) =0.017 x( t )
dt
Sol:desolve(DE,x(t));
rat: replaced 0.017 by 17/1000 = 0.017
rat: replaced -0.017 by -17/1000 = -0.017
17 t
1000
x( t ) =x( 0 ) %e
Harshit_Singh_Practical02.wxm 2 / 3

T:ev(Sol,x(0)=5.3);
17 t
1000
x( t ) =5.3 %e
p:ev(Sol,x(0)=5.3,t=22),numer; /*Population in the year 2022*/
x( 22 ) =7.703746897421317
wxplot2d([rhs(T),[discrete,[[0,5.3],[22,rhs(p)]]]],[t,0,40],
[title,"Population Model : Growth Model"],[xlabel,"Time"],
[style,[lines],[points,2,5,1]],[label,["Population in 2000",0,5.20],
["Population in 2022",22,rhs(p)−0.3]],
[legend,"Population throughout(in millions)","Popoulation in specific years"

1.2 Exponential Decay Model


a:0.027$; /*per capita death rate*/
b:0.010$; /*per capita birth rate*/
c:b−a; /*growth rate*/
−0.017
DE:diff(x(t),t)=c·x(t);
d
x( t ) =−0.017 x( t )
dt
Sol:desolve(DE,x(t));
rat: replaced -0.017 by -17/1000 = -0.017
rat: replaced 0.017 by 17/1000 = 0.017
17 t

1000
x( t ) =x( 0 ) %e
T:ev(Sol,x(0)=5.3);
17 t

1000
x( t ) =5.3 %e
p:ev(Sol,x(0)=5.3,t=22),numer;
Harshit_Singh_Practical02.wxm 3 / 3

x( 22 ) =3.646277632693591
wxplot2d([rhs(T),[discrete,[[0,5.3],[22,rhs(p)]]]],
[t,0,40],[title,"Population Model : Decay Model"],
[xlabel,"Time"],[style,[lines],[points,2,5,1]],
[label,["Population in 2000",0,5.20],
["Population in 2022",22,rhs(p)−0.3]],
[legend,"Population throughout (in millions)","Popoulation in specific years"
Harshit_Prac3.wxm 1 / 10

C(t) --> Concentration of pollutants in the lake at any


time t.
M(t) --> Mass of the pollutants in the lake at any time t
.
Cin(t) --> Initial Concentration of the pollutants in the
lake at any time t.
F --> Rate of inflow and outflow of the polluted
water in the lake.(Rate in = rate out,
(v=constant volume rate)since volume of the lake is
assumed to be constant.)
dM/dt = F*Cin(t) - F*(M/V) */Balance Law/*

1 Lake pollution model


1.1 Constant Flow and constant
pollution concentration inflow.
With Constant flow and constant pollution conc inflow
C(t)= conc of pollutants at time t
F=48 constant flow rate
V=28 constant volume of rate
Cin=3
C_in:3$;
V:28$;
F:48$;

eq:diff(C(t),t)=(F/V)·(C_in−C(t));
d 12 ( 3 − C ( t ) )
C( t ) =
dt 7
Gen_Sol:desolve(eq,C(t));
Harshit_Prac3.wxm 2 / 10

12 t

7
( 7 C ( 0 ) − 21 ) %e
C( t ) = +3
7
Sol:ev(Gen_Sol,C(0)=makelist(k,k,1,5));
12 t 12 t 12 t
− − −
7 7 7
C( t ) =[ 3−2 %e , 3−%e , 3, %e +3 ,
12 t

7
2 %e +3 ]
wxplot2d(rhs(Sol),[t,0,6],[y,0,5],
[title,"Constant flow and constant pollution inflow"],
[ylabel,"Concentration of Polutant(kg/m³)"],[legend,false]);

Observations:
1) As t->∞ , C(t) -> 3
1.2 Seasonal flow and Constant
Pollution
Concentration inflow
kill(all)$
here,
F=1+0.5sin(2πt)
V=28
Cin=3
C(0)=1
C_in:3$;
V:28$;
F(t):=1+(0.5)·sin(2·π·t)$;

eq2:'diff(C,t)=(F(t)/V)·(C_in−C);
Harshit_Prac3.wxm 3 / 10

d ( 3 − C ) ( 0.5 sin ( 2 π t ) + 1 )
C=
dt 28
Gen_Sol2:ode2(eq2,C,t);
rat: replaced -0.05357142857142857 by -3/56 = -0.05357142857142857
rat: replaced 0.01785714285714286 by 1/56 = 0.01785714285714286
rat: replaced -0.05357142857142857 by -3/56 = -0.05357142857142857
rat: replaced 0.01785714285714286 by 1/56 = 0.01785714285714286
rat: replaced -0.05357142857142857 by -3/56 = -0.05357142857142857
rat: replaced 0.01785714285714286 by 1/56 = 0.01785714285714286
cos ( 2 π t )
2 t−

− cos ( 2 π t )
56 t / 28 −
C =%e 112 π
3 %e +%c
Sol2:ic1(Gen_Sol2,t=0,C=1);
t 1
− −
28 112 π
C =−%e
cos ( 2 π t ) 1
t / 28 +
112 π 112 π
2 %e −3 %e
limit(Sol2,t,∞);
C =3
wxplot2d([rhs(Sol2),3],[t,0,150],[y,0,5],
[title,"Seasonal flow and constant pollution conc"],
[style,[lines,5,4,1],[lines,5,6,1]],[legend,false],
[legend," Solution graph ","constant 3"],
[xlabel,"t=time"],[ylabel,"C(t)=conc of pollutants"]);

;
Harshit_Prac3.wxm 4 / 10

O bservations:
1) As t tends to infinity,the concentration of pollutants
approaches the initial
concentration
of pollutant, i.e. , as t→∞, C(t)→Cin=3.
1.3 Constant Flow and seasonal pollution
Conc. inflow.
kill(all)$;

F=48
V=28
Cin=1+0.5sin(2πt)
C(0)=1
C_in(t):=1+0.5·(sin(2·π·t))$;
F:48$;
V:28$;

eq3:'diff(C,t)=(F/V)·(C_in(t)−C);
d 12 ( 0.5 sin ( 2 π t ) − C + 1 )
C=
dt 7
Gen_Sol3:ode2(eq3,C,t);
rat: replaced -0.8571428571428571 by -6/7 = -0.8571428571428571
rat: replaced -0.8571428571428571 by -6/7 = -0.8571428571428571
rat: replaced -0.8571428571428571 by -6/7 = -0.8571428571428571
12 t

7
C =%e (
12 t
7 12 sin ( 2 π t ) 12 t
6 %e − 2 π cos ( 2 π t )
7 7
+ 7 %e
2 144
4π +
49
+%c )
7
Sol3:ic1(Gen_Sol3,t=0,C=1);
Harshit_Prac3.wxm 5 / 10

12 t 12 t 12 t

7 7 7
C = %e (18 %e sin ( 2 π t ) −21 π %e
12 t
7
cos ( 2 π t ) + 49 π 2 +36 %e +21 π) /
wxplot2d([rhs(Sol3)],[t,0,5],[y,0,2],[legend," Solution graph "],
[title,"constant flow and seasonal pollution"],
[xlabel,"t=time"],[ylabel,"C(t)=conc of pollutants"]
,[style,[lines,5,7,1]]);

Observation :
1) AS t-> ∞ , C(t) oscilates
1.4 Seasonal flow and seasonal pollution
conc. inflow
F=cos t
Cin=sin t
V=28
C(0)=1
C_in(t):=sin(t)$;
F(t):=cos(t)$;
V:28$;
eq4:'diff(C,t)=(F(t)/V)·(C_in(t)−C);
d cos ( t ) ( sin ( t ) − C )
C=
dt 28
Gen_Sol4:ode2(eq4,C,t);
sin ( t ) sin ( t )

28 28
C =%e %e ( 28 sin ( t ) − 784 )
+%c
28
Sol4:ic1(Gen_Sol4,t=0,C=1);
Harshit_Prac3.wxm 6 / 10

sin ( t )
− sin ( t ) sin ( t )
28
C =%e 28 28
%e sin ( t ) −28 %e +29
wxplot2d([rhs(Sol4),3],[t,0,150],[y,0.98,1.07],[axes,solid],
[title,"seasonal Flow and seasonal pollution conc inflow"]
,[legend,false],
[style,[lines,1,1,1],[lines,1,2,1]]);

2 DRUG ASSIMILATION MODEL


2.1 SINGLE COLD PILL CASE
X(t): amt of drug at time in gi tract at t
y(t): amt of drug in blood stream at time t
dx/dt=-k1*x,x(0)=xo.
dy/dt=k1x-k2y,y(0)=0.
cold pill is made up of decongestant and antihistamine.
decongestant antihistamine
k1: 1.3860/hr 0.6931/hr
k2: 0.1386/hr 0.0231/hr
x(t)=xoe^-k1*t,xo value will be provided
this x(t) will be used in dy/dt equation.
after the subs to x(t) we get y(t)=k1*xo[e^-k1t
-e^-k2t]/k2-k1
kill(all);
done
eq1:'diff(x, t)=−k1·x;
d
x =−k1 x
dt
solw3:ode2(eq1, x,t);
− k1 t
x =%c %e
Harshit_Prac3.wxm 7 / 10

w4:ic1(solw3,x=1,t=0);/*x(0)=1*/
− k1 t
x =%e
j:rhs(w4);
− k1 t
%e
n:ev(w4, k1=1.3860);
− 1.386 t
x =%e
u:rhs(n);
− 1.386 t
%e
z:ev(w4, k1=.6931);
− 0.6931 t
x =%e
l:rhs(z);
− 0.6931 t
%e
wxplot2d([u,l] ,[t,0,10],[style,[lines,2],[lines,5]],
[title,"single cold pill case"],
[xlabel,"t in hrs"],[ylabel,"drug in gi tract "]
,[legend,"decongestant level","histamine level"]);

As t→∞, the amount of drugs in the GI tract become


zero, with
decongestant becoming zero first.
eq2:'diff(y, t)=k1·j−k2·y;
d − k1 t
y =k1 %e −k2 y
dt
soly:ode2(eq2,y,t);
− k2 t k2 t − k1 t
y =%e k1 %e
+%c
k2 − k1
a1:ic1(soly,y=0,t=0);
Harshit_Prac3.wxm 8 / 10

k2 t k1 t − k2 t − k1 t
( k1 %e − k1 %e ) %e
y=
k2 − k1
r2:ev(a1,k1=1.3680,k2=0.1386);
− 1.5066 t
y =−0.8134049129656743 %e
0.1386 t 1.368 t
1.368 %e −1.368 %e
t2:rhs(r2);
− 1.5066 t
−0.8134049129656743 %e
0.1386 t 1.368 t
1.368 %e −1.368 %e
r3:ev(a1,k1=0.6931,k2=0.0231);
− 0.7162000000000001 t
y =−1.492537313432836 %e
0.0231 t 0.6931 t
0.6931 %e −0.6931 %e
t3:rhs(r3);
− 0.7162000000000001 t
−1.492537313432836 %e
0.0231 t 0.6931 t
0.6931 %e −0.6931 %e
wxplot2d([t2,t3] ,[t,0,100],[style,[lines,2],[lines,5]],
[title,"single cold pill case"],
[xlabel,"t in hrs"],[ylabel,"drug in blood stream "],
[legend,"decongestant level","anti histamine level"]);

As t→∞, the amount of drugs in the blood stream


become zero, with decongestant
becoming zero first.
2.2 a course of cold pill
kill(all);
done
Harshit_Prac3.wxm 9 / 10

eq1:'diff(x, t)=I−k1·x;
d
x =I −k1 x
dt
solw3:ode2(eq1, x,t);
− k1 t k1 t
x =%e I %e
+%c
k1
w4:ic1(solw3,x=0,t=0);/*x(0)=0*/
− k1 t k1 t
%e ( I %e −I)
x=
k1
j:ev(w4, I=1);
− k1 t k1 t
%e ( %e −1)
x=
k1
o:rhs(j);
− k1 t k1 t
%e ( %e −1)
k1
n:ev(w4, I=1,k1=1.3860);
− 1.386 t 1.386 t
x =0.7215007215007215 %e %e −1
u:rhs(n);
− 1.386 t 1.386 t
0.7215007215007215 %e %e −1
z:ev(j, k1=.6931);
− 0.6931 t 0.6931 t
x =1.4427932477276 %e %e −1
l:rhs(z);
− 0.6931 t 0.6931 t
1.4427932477276 %e %e −1
wxplot2d([u,l] ,[t,0,10],[style,[lines,2],[lines,5]],
[title," a course of cold pill case"],
[xlabel,"t in hrs"],[ylabel,"drug in gi tract "],
[legend,"decongestant level"," anti histamine level"]);
Harshit_Prac3.wxm 10 / 10

As t→∞, the amount of drugs in the GI tract become


constant,
with antihistamine more
than decongestant.
eq2:'diff(y, t)=k1·o−k2·y;
d − k1 t k1 t
y =%e %e −1 −k2 y
dt
soly:ode2(eq2,y,t);
k2
Is −2 equal to −1 ?
k1
a1:ic1(soly,y=0,t=0);
r2:ev(a1,k1=1.3680,k2=0.1386);
t2:rhs(r2);
r3:ev(a1,k1=0.6931,k2=0.0231);
t3:rhs(r3);
wxplot2d([t2,t3] ,[t,0,500],[style,[lines,2],[lines,5]],
[title,"a course of cold pill case"],
[xlabel,"t in hrs"],[ylabel,"drug in blood stream "],
[legend,"decongestant level","anti histamine level"]);
As t→∞, the amount of drugs in the GI tract become
constant,
with antihistamine more than decongestant.
Practical 4 - Harshit Singh.wxmx 1 / 17

Practical - 4

1 Runge-Kutta Questions

1.1 dy/dx=x, y(0)=0

➔ eqn:'diff(y,x)=x;
d
(eqn) y =x
dx

➔ sol:rk(rhs(eqn),y,0,[x,0,20,0.1])$
wxplot2d([discrete,sol],[x,0,20],[style,[points,2,3,2]]);
(%t3)

(%o3)
Practical 4 - Harshit Singh.wxmx 2 / 17

1.2 dx/dt=4-x^2-4*y^2 x(0)=-1.25


dy/dt=1-x^2+y^2 y(0)=0.75

➔ kill(all)$

➔ eqn1:'diff(x,t)=4−x^2−4·y^2;
d
(eqn1) x = − 4 y 2 − x2 + 4
dt

➔ eqn2:'diff(y,t)=1−x^2+y^2;
d
(eqn2) y = y 2 − x2 + 1
dt

➔ sol:rk([rhs(eqn1),rhs(eqn2)],
[x,y],[−1.25,0.75],[t,0,5,0.1])$

➔ solx:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
soly:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$

➔ wxplot2d([[discrete,solx],[discrete,soly]],
[style,[points,2,2,1],[points,2,5,1]],[legend,"x","y"]);

(%t6)

(%o6)
Practical 4 - Harshit Singh.wxmx 3 / 17

2 Predator - Prey Model (using RK method)

2.1 Basic Lotka-Volterra model

x(t)= density of prey at time t


y(t)= density of predator at time t

dx/dt=b1*x-c1*x*y x(0)=200
dy/dt=c2*x*y-b2*y y(0)=80

b1=1, b2=0.5,
c1=0.01, c2=0.005

➔ eqn3:'diff(x,t)=x−0.01·x·y;
d
(eqn3) x = x − 0.01 x y
dt

➔ eqn4:'diff(y,t)=0.005·x·y−0.5·y;
d
(eqn4) y = 0.005 x y − 0.5 y
dt

➔ sol:rk([rhs(eqn3),rhs(eqn4)],[x,y],[200,80],[t,0,50,0.1])$

➔ solx:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
soly:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$
Practical 4 - Harshit Singh.wxmx 4 / 17

➔ wxplot2d([[discrete,solx],[discrete,soly]],
[style,[points,1.5,6,1],[points,1.5,1,1]],
[legend,"Prey","Predator"],[title,"Basic Lotka−Volterra model"]);
(%t27)

(%o27)

Conclusion:

The density of prey and predator oscillates and doesnt change


over time where prey population oscillates at a higher amplitude.
Practical 4 - Harshit Singh.wxmx 5 / 17

2.2 Density Dependent Growth Model


(Prey with density dependent)

x(t) = density of prey at time t


y(t)= density of predator at time t

dx/dt = b1x(1-x/k)-c1xy
dy/dt = c2xy-a2y

k = 1000 (Carrying capacity)


b1=1 a2=0.5
c1=0.01 c2=0.005

➔ kill(all)$

➔ eqn5:'diff(x,t)=x·(1−x/500)−0.01·x·y;
d x
(eqn5) x= 1− x − 0.01 x y
dt 500

➔ eqn6:'diff(y,t)=0.005·x·y−0.5·y;
d
(eqn6) y = 0.005 x y − 0.5 y
dt

➔ sol:rk([rhs(eqn5),rhs(eqn6)],[x,y],[200,200],[t,0,500,0.1])$

➔ solx:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
soly:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$
Practical 4 - Harshit Singh.wxmx 6 / 17

➔ wxplot2d([[discrete,solx],[discrete,soly]],
[style,[points,1.5,3,1],[points,1.5,5,1]],
[legend,"Prey","Predator"],[title,"Density Dependent Growth Mode"]);
(%t6)

(%o6)

Conclusion:

The density of prey and predator oscillates where


prey population oscillates at a higher amplitude,
but as t→∞, the density seems to become stable
Practical 4 - Harshit Singh.wxmx 7 / 17

2.3 Effect of DDT (on both Prey & Predators)

x(t) = density of prey at time t


y(t)= density of predator at time t

dx/dt = b1x-c1xy-p1x x(0)=200


dy/dt = c2xy-a2y-p2y y(0)=80

b1=1 a2=0.5
c1=0.01 c2=0.005
p1=p2=0.1

➔ kill(all)$

➔ eqn7:'diff(x,t)=x−0.01·y·x−0.1·x;
d
(eqn7) x = 0.9 x − 0.01 x y
dt

➔ eqn8:'diff(y,t)=0.005·x·y−0.5·y−0.1·y;
d
(eqn8) y = 0.005 x y − 0.6 y
dt

➔ sol:rk([rhs(eqn7),rhs(eqn8)],[x,y],[200,80],[t,0,50,0.1])$

➔ solx:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
soly:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$;
Practical 4 - Harshit Singh.wxmx 8 / 17

➔ wxplot2d([[discrete,solx],[discrete,soly]],
[style,[points,1.5,3,1],[points,1.5,5,1]],
[legend,"Prey","Predator"],[title,"Effect of DDT on both Prey & Predators"]);

(%t6)

(%o6)

Conclusion:

The density of prey and predator oscillates and doesnt change over time
where prey population oscillates at a higher amplitude,
DDT has lead to the deaths of predators which in
turn lead to the increase in density of prey
Practical 4 - Harshit Singh.wxmx 9 / 17

2.4 Two Prey and One Predator

x1(t) = density of prey-1 at time t


x2(t) = density of prey-2 at time t
y(t) = density of predator at time t

dx1/dt = b1*x1-c1*x1*y x1(0)=150


dx2/dt = b2*x - c2*x2*y x2(0)=130
dy/dt= d1*x1*y+d2*x2*y-a*y y(0)=80

b1=1.32 b2=1.3
a=0.5 c1=c2=0.01
d1=d2=0.005

➔ kill(all)$

➔ eqn7:'diff(x1,t)=1.32·x1 −0.01·x1·y;
d
(eqn7) x1 = 1.32 x1 − 0.01 x1 y
dt

➔ eqn8:'diff(x2,t)=1.3·x2−0.01·x2·y;
d
(eqn8) x2 = 1.3 x2 − 0.01 x2 y
dt

➔ eqn9:'diff(y,t)=0.005·x1·y+0.005·x2·y−0.5·y;
d
(eqn9) y = 0.005 x2 y + 0.005 x1 y − 0.5 y
dt

➔ sol:rk([rhs(eqn7),rhs(eqn8),rhs(eqn9)],[x1,x2,y],[150,130,80],[t,0,50,0.1])$

➔ solx1:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
solx2:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$
soly:makelist([sol[i][1],sol[i][4]],i,1,length(sol))$
Practical 4 - Harshit Singh.wxmx 10 / 17

➔ wxplot2d([[discrete,solx1],[discrete,solx2],[discrete,soly]],
[style,[points,1.5,2,1],[points,1.5,6,1],[points,1.5,5,1]],
[legend,"Prey − 1","Prey − 2","Predator"],[title,"Two Prey and One Predator"]);

(%t8)

(%o8)

Conclusion:

The density of prey 1 & 2 and predator oscillates where


predator population oscillates at a higher amplitude.
As t→∞,
i) the density of prey - 1 increases over time,
ii) the density of prey - 2 decreses over time,
iii) the density of predator doesnt change over time.
Practical 4 - Harshit Singh.wxmx 11 / 17

3 Battle Model

3.1 Basic Battle Model

R(t)= No. of soldiers in the red army


B(t)= No. of soldiers in the blue army

dR/dt = -a1B R(0)=66


dB/dt = -a2R B(0)=18

a1=0.0544 a2=0.0106

➔ kill(all)$

➔ eqn10:'diff(R,t)=−0.0544·B;
d
(eqn10) R = − 0.0544 B
dt

➔ ode2(eqn10,R,t);
rat: replaced 0.0544 by 34/625 = 0.0544
rat: replaced 0.0544 by 34/625 = 0.0544
rat: replaced 0.0544 by 34/625 = 0.0544
34 B t
(%o50) R = %c −
625

➔ eqn11:'diff(B,t)=−0.0106·R;
d
(eqn11) B = − 0.0106 R
dt

➔ sol:rk([rhs(eqn10),rhs(eqn11)],[R,B],[66,18],[t,0,30,0.1])$

➔ solR:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
solB:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$
Practical 4 - Harshit Singh.wxmx 12 / 17

➔ wxplot2d([[discrete,solR],[discrete,solB]],
[style,[points,1.5,2,1],[points,1.5,1,1]],
[legend,"Red army","Blue army"],[title,"Basic Battle Model"]);
(%t91)

(%o91)

Conclusion:

Both army soldiers decrease over time.


Red army wins the battle
Practical 4 - Harshit Singh.wxmx 13 / 17

3.2 Guerilla warfare


(Red army is using Random fire and
Blue Army is using aimed fire)

R(t)= No. of soldiers in the red army aimed weapons


B(t)= No. of soldiers in the blue army uses random weapons

dR/dt = -a1B R(0)=45


dB/dt = -c2RB B(0)=60

a1=0.0544 c2=0.0106

➔ kill(all)$

➔ eqn12:'diff(R,t)=−0.0544·B;
d
(eqn12) R = − 0.0544 B
dt

➔ eqn13:'diff(B,t)=−0.0106·R·B;
d
(eqn13) B = − 0.0106 B R
dt

➔ sol:rk([rhs(eqn12),rhs(eqn13)],[R,B],[45,60],[t,0,10,0.1])$

➔ solR:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
solB:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$
Practical 4 - Harshit Singh.wxmx 14 / 17

➔ wxplot2d([[discrete,solR],[discrete,solB]],
[style,[points,1.5,2,1],[points,1.5,1,1]],
[legend,"Red army","Blue army"],[title,"Guerilla warfare"]);
(%t22)

(%o22)

Conclusion:

Blue army soldiers decreases at a faster rate than red army soldiers
since red army is using aimed fire while blue army is using random fire.
Blue Army wins the battle.
Practical 4 - Harshit Singh.wxmx 15 / 17

3.3 Trench Warfare

R(t)= No. of soldiers in the red army


B(t)= No. of soldiers in the blue army

dR/dt = -a1BR R(0)=45


dB/dt = -c2RB B(0)=60

a1=0.0544 c2=0.0106

➔ kill(all)$

➔ eqn14:'diff(R,t)=−0.0544·B·R;
d
(eqn14) R = − 0.0544 B R
dt

➔ eqn15:'diff(B,t)=−0.0106·R·B;
d
(eqn15) B = − 0.0106 B R
dt

➔ sol:rk([rhs(eqn14),rhs(eqn15)],[R,B],[45,60],[t,0,5,0.1])$

➔ solR:makelist([sol[i][1],sol[i][2]],i,1,length(sol))$
solB:makelist([sol[i][1],sol[i][3]],i,1,length(sol))$
Practical 4 - Harshit Singh.wxmx 16 / 17

➔ wxplot2d([[discrete,solR],[discrete,solB]],
[style,[points,1.5,2,1],[points,1.5,1,1]],
[legend,"Red army","Blue army"],[title,"Trench Warfare"]);
(%t6)

(%o6)

Conclusion:

Red army soldiers decreases to 0 over a period of time.


Blue army wins the battle.
Harshit_SINGH_practical05.wxm 1 / 12

kill(all)$

1 Plot only
1.1 a[n+1] = a[n] - 2/a[n] , where a[1] = 3
a(n):=if(n=1) then 3 else a(n−1)−2/a(n−1)$;
p:makelist(a(n),n,1,10);
wxplot2d([discrete,p],
[x,0,11],[y,−20,10],[style,[points,3,1,1]],
[title,"a[n+1] = a[n] - 2/a[n]"],
[axes,solid],[box,false]);
7 31 79 841361 702598448239
[ 3,, , ,− ,− ,−
3 21 651 51429 43270354869
489899932246872378186799
,−
30401684185710258125691
238153418812834816232368837706144350526229411439
/
14893783022770266903288757599701650570818953109
,−
56273401346782784513505851274507688527779467060269107348384
/
35470053459292962781087378219966631200937696132574998571636
,−
314153320528799249239462062284[130 digits]03025249955088738485
/
199602055410663397651472955181[129 digits]45672030593730462376
]
Harshit_SINGH_practical05.wxm 2 / 12
Harshit_SINGH_practical05.wxm 3 / 12

kill(all)$
1.2 a[n] = a[n-1] + a[n-2] , where a[1]=1
and a[2]=1
a(n):=if(n=1 or n=2) then 1 else a(n−1)+a(n−2);
a ( n ) :=if n =1 or n =2 then 1 else a( n −1 ) +
a ( n −2 )
H:makelist(a(n),n,1,10);
[ 1 ,1 , 2 ,3 , 5, 8 ,13 , 21 , 34 , 55 ]
wxplot2d([discrete,H],
[x,0,11],[y,−1,57],[style,[points,5,1,1]],
[title,"a[n] = a[n-1] + a[n-2]"],
[axes,solid],[box,false]);
Harshit_SINGH_practical05.wxm 4 / 12

kill(all)$
1.3 a[n] = 2*a[n-1] * (1-a[n-1]) , where
a[1]=12
a(n):=if(n=1 ) then 12 else 2·a(n−1)·(1−a(n−1));
a ( n ) :=if n =1 then 12 else 2 a ( n −1 ) ( 1 −a ( n −1 ) )
T:makelist(a(n),n,1,5);
[ 12 ,−264 , −139920 , −39155492640 , −
3066305207840499324480 ]
wxplot2d([discrete,T],
[x,0,6],[style,[points,4,1,1]],
[title,"a[n] = 2*a[n-1] * (1-a[n-1])"]);;
Harshit_SINGH_practical05.wxm 5 / 12

kill(all)$
1.4 a[n] = a[n-1] - 2 , where a[1]=1
a(n):=if(n=1) then 1 else a(n−1)−2;
a ( n ) :=if n =1 then 1 else a( n −1 ) −2
Q:makelist(a(n),n,1,10);
[ 1 ,−1 ,−3 ,−5 ,−7 ,−9 ,−11 , −13 , −15 , −17 ]
wxplot2d([discrete,Q],
[x,0,11],[style,[points,3,1,7]],
[title,"a[n] = 2*a[n-1] * (1-a[n-1])"]);
Harshit_SINGH_practical05.wxm 6 / 12

kill(all)$
1.5 Ask the user to enter two numbers
and then create a fibonacci seq.
p:read("Enter the first element of the sequence : ");
o:read("Enter the second element of the sequence : ");
v(n):= if n=1 then p else if n = 2 then o else v(n−1)+v(n−2)$;
wxplot2d([discrete,makelist([n,v(n)],n,1,10)],[style,[points,5,1,1]],
[xlabel,"n"],[ylabel,"h(n)"],[title,"h(n)"],[axes,solid],[y,0,30]);

Enter the first element of the sequence : 2;


2
Enter the second element of the sequence : 3;
3
Harshit_SINGH_practical05.wxm 7 / 12

kill(all)$

2 Plot and study convergence.


2.1 1/n
a(n):=1/n$
fpprintprec:4$
r:makelist([n,a(n)],n,1,50),numer;
[ [ 1 ,1 ] ,[ 2 ,0.5 ] , [ 3 ,0.3333 ] , [ 4 ,0.25 ] ,[ 5 ,0.2 ] ,
[ 6 ,0.1667 ] , [ 7 ,0.1429 ] , [ 8 ,0.125 ] , [ 9 ,0.1111 ] , [ 10 , 0.1 ] ,
[ 11 , 0.09091 ] , [ 12 , 0.08333 ] , [ 13 , 0.07692 ] , [ 14 , 0.07143 ] ,
[ 15 , 0.06667 ] , [ 16 , 0.0625 ] ,[ 17 , 0.05882 ] , [ 18 , 0.05556 ] ,
[ 19 , 0.05263 ] , [ 20 , 0.05 ] , [ 21 , 0.04762 ] , [ 22 , 0.04545 ] ,
[ 23 , 0.04348 ] , [ 24 , 0.04167 ] , [ 25 , 0.04 ] , [ 26 , 0.03846 ] ,
[ 27 , 0.03704 ] , [ 28 , 0.03571 ] , [ 29 , 0.03448 ] , [ 30 , 0.03333 ] ,
[ 31 , 0.03226 ] , [ 32 , 0.03125 ] , [ 33 , 0.0303 ] ,[ 34 , 0.02941 ] ,
[ 35 , 0.02857 ] , [ 36 , 0.02778 ] , [ 37 , 0.02703 ] , [ 38 , 0.02632 ] ,
[ 39 , 0.02564 ] , [ 40 , 0.025 ] , [ 41 , 0.02439 ] , [ 42 , 0.02381 ] ,
[ 43 , 0.02326 ] , [ 44 , 0.02273 ] , [ 45 , 0.02222 ] , [ 46 , 0.02174 ] ,
[ 47 , 0.02128 ] , [ 48 , 0.02083 ] , [ 49 , 0.02041 ] , [ 50 , 0.02 ] ]
wxplot2d([discrete,r],[style,[points,2,1,1]],
[xlabel,"n"],[ylabel,"a(n)"],[title,"a(n)=1/n"]);

Observations :
1) The given sequence seems to converge to 0.

2) The given sequence is decreasing.


limit(1/n,n,∞);
0
Thus we can observe that 1/n indeed converges to 0
Harshit_SINGH_practical05.wxm 8 / 12

2.2 sin n/n


a:makelist(sin(n)/n,n,1,40);
sin ( 2 ) sin ( 3 ) sin ( 4 ) sin ( 5 ) sin ( 6 )
[ sin( 1 ) , , , , , ,
2 3 4 5 6
sin ( 7 ) sin ( 8 ) sin ( 9 ) sin ( 10 ) sin ( 11 ) sin ( 12 )
, , , , , ,
7 8 9 10 11 12
sin ( 13 ) sin ( 14 ) sin ( 15 ) sin ( 16 ) sin ( 17 ) sin ( 18 )
, , , , , ,
13 14 15 16 17 18
sin ( 19 ) sin ( 20 ) sin ( 21 ) sin ( 22 ) sin ( 23 ) sin ( 24 )
, , , , , ,
19 20 21 22 23 24
sin ( 25 ) sin ( 26 ) sin ( 27 ) sin ( 28 ) sin ( 29 ) sin ( 30 )
, , , , , ,
25 26 27 28 29 30
sin ( 31 ) sin ( 32 ) sin ( 33 ) sin ( 34 ) sin ( 35 ) sin ( 36 )
, , , , , ,
31 32 33 34 35 36
sin ( 37 ) sin ( 38 ) sin ( 39 ) sin ( 40 )
, , , ]
37 38 39 40
wxplot2d([discrete,a],[x,0,60],[y,−1,1],
[style,[points,3,1,1]],[title,"sin(n/n)"]);

Observation:

It seems that the sequence sin(n)/n converges to 0 as n


---> ∞.
limit((sin(n)/n),n,∞);
0
Thus we can observe that sin(n/n) indeed converges to
0
Harshit_SINGH_practical05.wxm 9 / 12

2.3 n*(-1)^n
c(n):= n·(−1)^(n)$;
makelist([n,c(n)],n,1,40);
[ [ 1 ,−1 ] , [ 2 ,2 ] ,[ 3 ,−3 ] , [ 4 ,4 ] ,[ 5 ,−5 ] , [ 6 ,6 ] ,[ 7 ,−7 ] ,
[ 8 ,8 ] ,[ 9 ,−9 ] , [ 10 , 10 ] ,[ 11 , −11 ] ,[ 12 , 12 ] ,[ 13 , −13 ] ,
[ 14 , 14 ] ,[ 15 , −15 ] ,[ 16 , 16 ] ,[ 17 , −17 ] ,[ 18 , 18 ] ,[ 19 , −19 ] ,
[ 20 , 20 ] ,[ 21 , −21 ] ,[ 22 , 22 ] ,[ 23 , −23 ] ,[ 24 , 24 ] ,[ 25 , −25 ] ,
[ 26 , 26 ] ,[ 27 , −27 ] ,[ 28 , 28 ] ,[ 29 , −29 ] ,[ 30 , 30 ] ,[ 31 , −31 ] ,
[ 32 , 32 ] ,[ 33 , −33 ] ,[ 34 , 34 ] ,[ 35 , −35 ] ,[ 36 , 36 ] ,[ 37 , −37 ] ,
[ 38 , 38 ] ,[ 39 , −39 ] ,[ 40 , 40 ] ]
wxplot2d([discrete,makelist([n,c(n)],n,1,20)],[style,[points,2,1,1]],
[xlabel,"n"],[ylabel,"c(n)"],[title,"c(n)"],[axes,solid]);

Observations:
1) The sequence is not convergent.
2) The given sequence is infinitely oscillatory.
Harshit_SINGH_practical05.wxm 10 / 12

2.4 (-1)^n
d:makelist((−1)^n,n,1,10);
[ −1 ,1 , −1 ,1 , −1 ,1 , −1 ,1 , −1 ,1 ]
wxplot2d([discrete,d],[x,0,10],[y,−1.5,1.5],
[style,[points,3,1,1]],[title,"(-1)^n"]);

Observation:

It seems that (-1)^n does not converge it takes value


betweem -1 and 1.
Harshit_SINGH_practical05.wxm 11 / 12

2.5 n/(n+1)
f:makelist(n/(n+1),n,1,10);
1 2 3 4 5 6 7 8 9 10
, , , , , , , , ,
2 3 4 5 6 7 8 9 10 11
wxplot2d([discrete,f],[x,0,17],[y,0,1.5],
[style,[points,2,1,1]],[title,"n/(n+1)"]);

Observation:

It seems that the sequence n/(n+1) converges to 1 as n


tends to ∞.

limit(n/(n+1),n,∞);
1
Thus we can observe that n/(n+1) indeed converges to 1
Harshit_SINGH_practical05.wxm 12 / 12

2.6 (-1)^n/n
g:makelist((−1)^n/n,n,1,10);
1 1 1 1 1 1 1 1 1
−1 , ,− , ,− , ,− , ,− ,
2 3 4 5 6 7 8 9 10
wxplot2d([discrete,g],[x,0,12],[y,−1.5,1.5],
[style,[points,2,1,1]],[title,"(-1)^n/n"]);

Observation:

It seems that the sequence(-1)^n/n converges to 0 as n


tends to ∞.
limit((−1)^n/n,n,∞);
0
Thus we can observe that (-1)^n/n indeed converges to
0
Harshit_Singh_Prac06.wxmx 1 / 2

kill(all)$

1 | [0.5^(1/n)] - 1 | < 10^(-3)


block(
f(n):=abs(((0.5)^(1/n))−1),
for a:1 while (a>=1) do
if (f(a)<10^(−3)) then
( print("The inequality holds for all n greater than",a),
return () )
)$

The inequality holds for all n greater than 693


2 | n^(1/n) - 1 | < 10^(-3)
block(
f(n):=abs(n^(1/n)−1),
for a:1 while (a>=1) do
if (f(a)<10^(−3)) then
( print("The inequality holds for all n greater than",a),
return() )
)$

The inequality holds for all n greater than 1


Harshit_Singh_Prac06.wxmx 2 / 2

3 0.9^n < 10^(-3)


block(f(n):=(0.9)^n,
for a:1 while (a>=1) do
if (f(a)<10^(−3)) then
( print("The inequality holds for all n greater than",a),
return() ) )$

The inequality holds for all n greater than 66

4 2^n / (n!) < 10^(-7)


block(
f(n):=(2^n)/factorial(n),
for a:1 while (a>=1) do
if( f(a)<10^(−7)) then
(print("The inequality holds for all n greater than",a),
return() )
)$
The inequality holds for all n greater than 15
HrashitSinghPrac7.wxm 1 / 19

1 a(n)=1/n
a(n):=1/n;
1
a ( n ) :=
n
pts:makelist([n,a(n)],n,1,50);
1 1 1 1 1 1
[ [ 1 ,1 ] , 2 , , 3, , 4, , 5, , 6, , 7,
2 3 4 5 6 7
1 1 1 1 1 1
, 8, , 9, , 10 , , 11 , , 12 , , 13 , ,
8 9 10 11 12 13
1 1 1 1 1
14 , , 15 , , 16 , , 17 , , 18 , ,
14 15 16 17 18
1 1 1 1 1
19 , , 20 , , 21 , , 22 , , 23 , ,
19 20 21 22 23
1 1 1 1 1
24 , , 25 , , 26 , , 27 , , 28 , ,
24 25 26 27 28
1 1 1 1 1
29 , , 30 , , 31 , , 32 , , 33 , ,
29 30 31 32 33
1 1 1 1 1
34 , , 35 , , 36 , , 37 , , 38 , ,
34 35 36 37 38
1 1 1 1 1
39 , , 40 , , 41 , , 42 , , 43 , ,
39 40 41 42 43
1 1 1 1 1
44 , , 45 , , 46 , , 47 , , 48 , ,
44 45 46 47 48
1 1
49 , , 50 , ]
49 50
wxplot2d([discrete,pts],[style,[points,4,1,1]] );
HrashitSinghPrac7.wxm 2 / 19

From graph, we observe that the given sequence seems


to be bounded between 0 and 1.

Therefore by BWT, it should have a monotonic


convergent subsequence.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
1 1 1 1 1 1
[ 1, , 2, , 3, , 4, , 5, , 6, ,
2 4 6 8 10 12
1 1 1 1 1 1
7, , 8, , 9, , 10 , , 11 , , 12 , ,
14 16 18 20 22 24
1 1 1 1 1
13 , , 14 , , 15 , , 16 , , 17 , ,
26 28 30 32 34
1 1 1 1 1
18 , , 19 , , 20 , , 21 , , 22 , ,
36 38 40 42 44
1 1 1 1 1
23 , , 24 , , 25 , , 26 , , 27 , ,
46 48 50 52 54
1 1 1 1 1
28 , , 29 , , 30 , , 31 , , 32 , ,
56 58 60 62 64
1 1 1 1 1
33 , , 34 , , 35 , , 36 , , 37 , ,
66 68 70 72 74
1 1 1 1 1
38 , , 39 , , 40 , , 41 , , 42 , ,
76 78 80 82 84
1 1 1 1 1
43 , , 44 , , 45 , , 46 , , 47 , ,
86 88 90 92 94
1 1 1
48 , , 49 , , 50 , ]
96 98 100
wxplot2d([discrete,sub],[style,[points,4,1,1]] );
HrashitSinghPrac7.wxm 3 / 19

The subsequence seems to be monotonically decreasing.


It seems to converge to 0 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
0
Hence the subsequence indeed converges. Thus, BWT is
verified.

2 a(n)=1/n^2
a(n):=1/n²;
1
a ( n ) :=
2
n
pts:makelist([n,a(n)],n,1,50);
1 1 1 1 1
[ [ 1 ,1 ] , 2 , , 3, , 4, , 5, , 6, ,
4 9 16 25 36
1 1 1 1 1
7, , 8, , 9, , 10 , , 11 , ,
49 64 81 100 121
1 1 1 1 1
12 , , 13 , , 14 , , 15 , , 16 , ,
144 169 196 225 256
1 1 1 1 1
17 , , 18 , , 19 , , 20 , , 21 , ,
289 324 361 400 441
1 1 1 1 1
22 , , 23 , , 24 , , 25 , , 26 , ,
484 529 576 625 676
1 1 1 1 1
27 , , 28 , , 29 , , 30 , , 31 , ,
729 784 841 900 961
1 1 1 1
32 , , 33 , , 34 , , 35 , ,
1024 1089 1156 1225
HrashitSinghPrac7.wxm 4 / 19

1 1 1 1
36 , , 37 , , 38 , , 39 , ,
1296 1369 1444 1521
1 1 1 1
40 , , 41 , , 42 , , 43 , ,
1600 1681 1764 1849
1 1 1 1
44 , , 45 , , 46 , , 47 , ,
1936 2025 2116 2209
1 1 1
48 , , 49 , , 50 , ]
2304 2401 2500
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be bounded between 0 and 1.

Therefore by BWT, it should have a monotonic


convergent subsequence.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
1 1 1 1 1
[ 1, , 2, , 3, , 4, , 5, ,
4 16 36 64 100
1 1 1 1 1
6, , 7, , 8, , 9, , 10 , ,
144 196 256 324 400
1 1 1 1 1
11 , , 12 , , 13 , , 14 , , 15 , ,
484 576 676 784 900
1 1 1 1
16 , , 17 , , 18 , , 19 , ,
1024 1156 1296 1444
1 1 1 1
20 , , 21 , , 22 , , 23 , ,
1600 1764 1936 2116
1 1 1 1
24 , , 25 , , 26 , , 27 , ,
2304 2500 2704 2916
HrashitSinghPrac7.wxm 5 / 19

1 1 1 1
28 , , 29 , , 30 , , 31 , ,
3136 3364 3600 3844
1 1 1 1
32 , , 33 , , 34 , , 35 , ,
4096 4356 4624 4900
1 1 1 1
36 , , 37 , , 38 , , 39 , ,
5184 5476 5776 6084
1 1 1 1
40 , , 41 , , 42 , , 43 , ,
6400 6724 7056 7396
1 1 1 1
44 , , 45 , , 46 , , 47 , ,
7744 8100 8464 8836
1 1 1
48 , , 49 , , 50 , ]
9216 9604 10000
wxplot2d([discrete,sub],[style,[points,4,1,1]] );

The subsequence seems to be monotonically decreasing.


It seems to converge to 0 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
0
Hence the subsequence indeed converges. Thus, BWT is
verified.

3 a(n)=(-1)^n
a(n):=(−1)^n;
n
a ( n ) :=( −1 )
pts:makelist([n,a(n)],n,1,50);
[ [ 1 ,−1 ] , [ 2 ,1 ] ,[ 3 ,−1 ] , [ 4 ,1 ] ,[ 5 ,−1 ] , [ 6 ,1 ] ,[ 7 ,−1 ] ,
[ 8 ,1 ] ,[ 9 ,−1 ] , [ 10 , 1 ] , [ 11 , −1 ] , [ 12 , 1 ] , [ 13 , −1 ] , [ 14 , 1 ] ,
HrashitSinghPrac7.wxm 6 / 19

[ 15 , −1 ] , [ 16 , 1 ] , [ 17 , −1 ] , [ 18 , 1 ] , [ 19 , −1 ] , [ 20 , 1 ] , [ 21 , −1 ]
, [ 22 , 1 ] , [ 23 , −1 ] , [ 24 , 1 ] , [ 25 , −1 ] , [ 26 , 1 ] , [ 27 , −1 ] , [ 28 , 1 ] ,
[ 29 , −1 ] , [ 30 , 1 ] , [ 31 , −1 ] , [ 32 , 1 ] , [ 33 , −1 ] , [ 34 , 1 ] , [ 35 , −1 ]
, [ 36 , 1 ] , [ 37 , −1 ] , [ 38 , 1 ] , [ 39 , −1 ] , [ 40 , 1 ] , [ 41 , −1 ] , [ 42 , 1 ] ,
[ 43 , −1 ] , [ 44 , 1 ] , [ 45 , −1 ] , [ 46 , 1 ] , [ 47 , −1 ] , [ 48 , 1 ] , [ 49 , −1 ]
, [ 50 , 1 ] ]
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be bounded between -1 and 1.

Therefore by BWT, it should have a monotonic


convergent subsequence.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n−1)],n,1,50);
[ [ 1 ,−1 ] , [ 2 ,−1 ] , [ 3 ,−1 ] , [ 4 ,−1 ] , [ 5 ,−1 ] , [ 6 ,−1 ] ,
[ 7 ,−1 ] , [ 8 ,−1 ] , [ 9 ,−1 ] , [ 10 , −1 ] , [ 11 , −1 ] , [ 12 , −1 ] ,
[ 13 , −1 ] , [ 14 , −1 ] , [ 15 , −1 ] , [ 16 , −1 ] , [ 17 , −1 ] , [ 18 , −1 ] ,
[ 19 , −1 ] , [ 20 , −1 ] , [ 21 , −1 ] , [ 22 , −1 ] , [ 23 , −1 ] , [ 24 , −1 ] ,
[ 25 , −1 ] , [ 26 , −1 ] , [ 27 , −1 ] , [ 28 , −1 ] , [ 29 , −1 ] , [ 30 , −1 ] ,
[ 31 , −1 ] , [ 32 , −1 ] , [ 33 , −1 ] , [ 34 , −1 ] , [ 35 , −1 ] , [ 36 , −1 ] ,
[ 37 , −1 ] , [ 38 , −1 ] , [ 39 , −1 ] , [ 40 , −1 ] , [ 41 , −1 ] , [ 42 , −1 ] ,
[ 43 , −1 ] , [ 44 , −1 ] , [ 45 , −1 ] , [ 46 , −1 ] , [ 47 , −1 ] , [ 48 , −1 ] ,
[ 49 , −1 ] , [ 50 , −1 ] ]
wxplot2d([discrete,sub],[style,[points,4,1,1]] );
HrashitSinghPrac7.wxm 7 / 19

The subsequence seems to be constant. It seems to


converge to it's value -1 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n−1), n, ∞);
−1
Hence the subsequence indeed converges. Thus, BWT is
verified.

4 a(n)=((-1)^n)/n^2
a(n):=((−1)^n)/n^2;
n
(−1)
a ( n ) :=
2
n
pts:makelist([n,a(n)],n,1,50);
1 1 1 1
[ [ 1 ,−1 ] , 2 , , 3 ,− , 4, , 5 ,− ,
4 9 16 25
1 1 1 1 1
6, , 7 ,− , 8, , 9 ,− , 10 , ,
36 49 64 81 100
1 1 1 1
11 , − , 12 , , 13 , − , 14 , ,
121 144 169 196
1 1 1 1
15 , − , 16 , , 17 , − , 18 , ,
225 256 289 324
1 1 1 1
19 , − , 20 , , 21 , − , 22 , ,
361 400 441 484
1 1 1 1
23 , − , 24 , , 25 , − , 26 , ,
529 576 625 676
1 1 1 1
27 , − , 28 , , 29 , − , 30 , ,
729 784 841 900
HrashitSinghPrac7.wxm 8 / 19

1 1 1 1
31 , − , 32 , , 33 , − , 34 , ,
961 1024 1089 1156
1 1 1 1
35 , − , 36 , , 37 , − , 38 , ,
1225 1296 1369 1444
1 1 1 1
39 , − , 40 , , 41 , − , 42 , ,
1521 1600 1681 1764
1 1 1 1
43 , − , 44 , , 45 , − , 46 , ,
1849 1936 2025 2116
1 1 1 1
47 , − , 48 , , 49 , − , 50 , ]
2209 2304 2401 2500
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be bounded between -1 and 1.

Therefore by BWT, it should have a monotonic


convergent subsequence.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
1 1 1 1 1
[ 1, , 2, , 3, , 4, , 5, ,
4 16 36 64 100
1 1 1 1 1
6, , 7, , 8, , 9, , 10 , ,
144 196 256 324 400
1 1 1 1 1
11 , , 12 , , 13 , , 14 , , 15 , ,
484 576 676 784 900
1 1 1 1
16 , , 17 , , 18 , , 19 , ,
1024 1156 1296 1444
1 1 1 1
20 , , 21 , , 22 , , 23 , ,
1600 1764 1936 2116
HrashitSinghPrac7.wxm 9 / 19

1 1 1 1
24 , , 25 , , 26 , , 27 , ,
2304 2500 2704 2916
1 1 1 1
28 , , 29 , , 30 , , 31 , ,
3136 3364 3600 3844
1 1 1 1
32 , , 33 , , 34 , , 35 , ,
4096 4356 4624 4900
1 1 1 1
36 , , 37 , , 38 , , 39 , ,
5184 5476 5776 6084
1 1 1 1
40 , , 41 , , 42 , , 43 , ,
6400 6724 7056 7396
1 1 1 1
44 , , 45 , , 46 , , 47 , ,
7744 8100 8464 8836
1 1 1
48 , , 49 , , 50 , ]
9216 9604 10000
wxplot2d([discrete,sub],[style,[points,4,1,1]] );

The subsequence seems to be monotonically decreasing.


It seems to converge to 0 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
0
Hence the subsequence indeed converges. Thus, BWT is
verified.

5 a(n)=2^n
a(n):=2^n;
n
a ( n ) :=2
pts:makelist([n,a(n)],n,1,50);
HrashitSinghPrac7.wxm 10 / 19

[ [ 1 ,2 ] ,[ 2 ,4 ] ,[ 3 ,8 ] ,[ 4 ,16 ] , [ 5 ,32 ] , [ 6 ,64 ] , [ 7 ,128 ] ,


[ 8 ,256 ] , [ 9 ,512 ] , [ 10 , 1024 ] , [ 11 , 2048 ] , [ 12 , 4096 ] ,
[ 13 , 8192 ] , [ 14 , 16384 ] , [ 15 , 32768 ] , [ 16 , 65536 ] ,
[ 17 , 131072 ] ,[ 18 , 262144 ] ,[ 19 , 524288 ] ,[ 20 , 1048576 ] ,
[ 21 , 2097152 ] , [ 22 , 4194304 ] , [ 23 , 8388608 ] ,
[ 24 , 16777216 ] , [ 25 , 33554432 ] , [ 26 , 67108864 ] ,
[ 27 , 134217728 ] ,[ 28 , 268435456 ] ,[ 29 , 536870912 ] ,
[ 30 , 1073741824 ] , [ 31 , 2147483648 ] , [ 32 , 4294967296 ] ,
[ 33 , 8589934592 ] , [ 34 , 17179869184 ] , [ 35 , 34359738368 ]
, [ 36 , 68719476736 ] , [ 37 , 137438953472 ] ,
[ 38 , 274877906944 ] ,[ 39 , 549755813888 ] ,
[ 40 , 1099511627776 ] , [ 41 , 2199023255552 ] ,
[ 42 , 4398046511104 ] , [ 43 , 8796093022208 ] ,
[ 44 , 17592186044416 ] , [ 45 , 35184372088832 ] ,
[ 46 , 70368744177664 ] , [ 47 , 140737488355328 ] ,
[ 48 , 281474976710656 ] , [ 49 , 562949953421312 ] ,
[ 50 , 1125899906842624 ] ]
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be unbounded.

It should have a monotonic subsequence. The


subsequence may or may not converge.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
[ [ 1 ,4 ] ,[ 2 ,16 ] , [ 3 ,64 ] , [ 4 ,256 ] , [ 5 ,1024 ] ,[ 6 ,4096 ] ,
[ 7 ,16384 ] , [ 8 ,65536 ] , [ 9 ,262144 ] , [ 10 , 1048576 ] ,
HrashitSinghPrac7.wxm 11 / 19

[ 11 , 4194304 ] , [ 12 , 16777216 ] , [ 13 , 67108864 ] ,


[ 14 , 268435456 ] ,[ 15 , 1073741824 ] , [ 16 , 4294967296 ] ,
[ 17 , 17179869184 ] , [ 18 , 68719476736 ] ,
[ 19 , 274877906944 ] ,[ 20 , 1099511627776 ] ,
[ 21 , 4398046511104 ] , [ 22 , 17592186044416 ] ,
[ 23 , 70368744177664 ] , [ 24 , 281474976710656 ] ,
[ 25 , 1125899906842624 ] , [ 26 , 4503599627370496 ] ,
[ 27 , 18014398509481984 ] , [ 28 , 72057594037927936 ] ,
[ 29 , 288230376151711744 ] , [ 30 , 1152921504606846976 ]
, [ 31 , 4611686018427387904 ] ,
[ 32 , 18446744073709551616 ] ,
[ 33 , 73786976294838206464 ] ,
[ 34 , 295147905179352825856 ] ,
[ 35 , 1180591620717411303424 ] ,
[ 36 , 4722366482869645213696 ] ,
[ 37 , 18889465931478580854784 ] ,
[ 38 , 75557863725914323419136 ] ,
[ 39 , 302231454903657293676544 ] ,
[ 40 , 1208925819614629174706176 ] ,
[ 41 , 4835703278458516698824704 ] ,
[ 42 , 19342813113834066795298816 ] ,
[ 43 , 77371252455336267181195264 ] ,
[ 44 , 309485009821345068724781056 ] ,
[ 45 , 1237940039285380274899124224 ] ,
[ 46 , 4951760157141521099596496896 ] ,
[ 47 , 19807040628566084398385987584 ] ,
[ 48 , 79228162514264337593543950336 ] ,
[ 49 , 316912650057057350374175801344 ] ,
[ 50 , 1267650600228229401496703205376 ] ]
wxplot2d([discrete,sub],[style,[points,4,1,1]] );
HrashitSinghPrac7.wxm 12 / 19

The subsequence seems to be monotonically increasing.


It seems to diverge to ∞ as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
und
Hence the subsequence indeed diverges.

6 a(n)=(-1)/n
a(n):=(−1)/n;
−1
a ( n ) :=
n
pts:makelist([n,a(n)],n,1,50);
1 1 1 1
[ [ 1 ,−1 ] , 2 ,− , 3 ,− , 4 ,− , 5 ,− ,
2 3 4 5
1 1 1 1 1
6 ,− , 7 ,− , 8 ,− , 9 ,− , 10 , − ,
6 7 8 9 10
1 1 1 1
11 , − , 12 , − , 13 , − , 14 , − ,
11 12 13 14
1 1 1 1
15 , − , 16 , − , 17 , − , 18 , − ,
15 16 17 18
1 1 1 1
19 , − , 20 , − , 21 , − , 22 , − ,
19 20 21 22
1 1 1 1
23 , − , 24 , − , 25 , − , 26 , − ,
23 24 25 26
1 1 1 1
27 , − , 28 , − , 29 , − , 30 , − ,
27 28 29 30
1 1 1 1
31 , − , 32 , − , 33 , − , 34 , − ,
31 32 33 34
HrashitSinghPrac7.wxm 13 / 19

1 1 1 1
35 , − , 36 , − , 37 , − , 38 , − ,
35 36 37 38
1 1 1 1
39 , − , 40 , − , 41 , − , 42 , − ,
39 40 41 42
1 1 1 1
43 , − , 44 , − , 45 , − , 46 , − ,
43 44 45 46
1 1 1 1
47 , − , 48 , − , 49 , − , 50 , − ]
47 48 49 50
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be bounded between -1 and 0.

Therefore by BWT, it should have a monotonic


convergent subsequence.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
1 1 1 1 1
[ 1 ,− , 2 ,− , 3 ,− , 4 ,− , 5 ,− ,
2 4 6 8 10
1 1 1 1 1
6 ,− , 7 ,− , 8 ,− , 9 ,− , 10 , − ,
12 14 16 18 20
1 1 1 1
11 , − , 12 , − , 13 , − , 14 , − ,
22 24 26 28
1 1 1 1
15 , − , 16 , − , 17 , − , 18 , − ,
30 32 34 36
1 1 1 1
19 , − , 20 , − , 21 , − , 22 , − ,
38 40 42 44
1 1 1 1
23 , − , 24 , − , 25 , − , 26 , − ,
46 48 50 52
HrashitSinghPrac7.wxm 14 / 19

1 1 1 1
27 , − , 28 , − , 29 , − , 30 , − ,
54 56 58 60
1 1 1 1
31 , − , 32 , − , 33 , − , 34 , − ,
62 64 66 68
1 1 1 1
35 , − , 36 , − , 37 , − , 38 , − ,
70 72 74 76
1 1 1 1
39 , − , 40 , − , 41 , − , 42 , − ,
78 80 82 84
1 1 1 1
43 , − , 44 , − , 45 , − , 46 , − ,
86 88 90 92
1 1 1 1
47 , − , 48 , − , 49 , − , 50 , − ]
94 96 98 100
wxplot2d([discrete,sub],[style,[points,4,1,1]] );

The subsequence seems to be monotonically increasing.


It seems to converge to 0 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
0
Hence the subsequence indeed converges. Thus, BWT is
verified.

7 a(n)={1, 1/2, 2, 1/3, 3, 1/4, 4, .....}


kill(all);
done
a(n):= if(mod(n,2)=1) then (n+1)/2 else 2/(n+2);
n+1 2
a ( n ) :=if mod ( n , 2 ) =1 then else
2 n+2
pts:makelist([n,a(n)],n,1,50);
HrashitSinghPrac7.wxm 15 / 19

1 1 1
[ [ 1 ,1 ] , 2 , , [ 3 ,2 ] , 4 , , [ 5 ,3 ] , 6 , , [ 7 ,4 ] ,
2 3 4
1 1 1 1
8, , [ 9 ,5 ] , 10 , , [ 11 , 6 ] , 12 , , [ 13 , 7 ] , 14 , ,
5 6 7 8
1 1 1
[ 15 , 8 ] , 16 , , [ 17 , 9 ] , 18 , , [ 19 , 10 ] , 20 , ,
9 10 11
1 1 1
[ 21 , 11 ] , 22 , , [ 23 , 12 ] , 24 , , [ 25 , 13 ] , 26 , ,
12 13 14
1 1 1
[ 27 , 14 ] , 28 , , [ 29 , 15 ] , 30 , , [ 31 , 16 ] , 32 , ,
15 16 17
1 1 1
[ 33 , 17 ] , 34 , , [ 35 , 18 ] , 36 , , [ 37 , 19 ] , 38 , ,
18 19 20
1 1 1
[ 39 , 20 ] , 40 , , [ 41 , 21 ] , 42 , , [ 43 , 22 ] , 44 , ,
21 22 23
1 1 1
[ 45 , 23 ] , 46 , , [ 47 , 24 ] , 48 , , [ 49 , 25 ] , 50 , ]
24 25 26
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be unbounded.

It should have a monotonic subsequence. The


subsequence may or may not converge.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
1 1 1 1 1 1
[ 1, , 2, , 3, , 4, , 5, , 6, ,
2 3 4 5 6 7
1 1 1 1 1 1
7, , 8, , 9, , 10 , , 11 , , 12 , ,
8 9 10 11 12 13
HrashitSinghPrac7.wxm 16 / 19

1 1 1 1 1
13 , , 14 , , 15 , , 16 , , 17 , ,
14 15 16 17 18
1 1 1 1 1
18 , , 19 , , 20 , , 21 , , 22 , ,
19 20 21 22 23
1 1 1 1 1
23 , , 24 , , 25 , , 26 , , 27 , ,
24 25 26 27 28
1 1 1 1 1
28 , , 29 , , 30 , , 31 , , 32 , ,
29 30 31 32 33
1 1 1 1 1
33 , , 34 , , 35 , , 36 , , 37 , ,
34 35 36 37 38
1 1 1 1 1
38 , , 39 , , 40 , , 41 , , 42 , ,
39 40 41 42 43
1 1 1 1 1
43 , , 44 , , 45 , , 46 , , 47 , ,
44 45 46 47 48
1 1 1
48 , , 49 , , 50 , ]
49 50 51
wxplot2d([discrete,sub],[style,[points,4,1,1]] );

The subsequence seems to be monotonically decreasing.


It seems to converge to 0 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
0
Hence the subsequence indeed converges.

8 a(n)={1, 2, 3, 1, 2, 3, 1, .....}
kill(all);
done
a(n):= if(mod(n,3)=1) then 1 elseif (mod(n,3)=2) then 2 else 3;
HrashitSinghPrac7.wxm 17 / 19

a ( n ) :=if mod ( n , 3 ) =1 then 1 elseif mod ( n , 3 ) =2


then 2 else 3
pts:makelist([n,a(n)],n,1,50);
[ [ 1 ,1 ] ,[ 2 ,2 ] ,[ 3 ,3 ] ,[ 4 ,1 ] ,[ 5 ,2 ] ,[ 6 ,3 ] ,[ 7 ,1 ] ,[ 8 ,2 ] ,
[ 9 ,3 ] ,[ 10 , 1 ] , [ 11 , 2 ] , [ 12 , 3 ] , [ 13 , 1 ] , [ 14 , 2 ] , [ 15 , 3 ] , [ 16 , 1 ]
, [ 17 , 2 ] , [ 18 , 3 ] , [ 19 , 1 ] , [ 20 , 2 ] , [ 21 , 3 ] , [ 22 , 1 ] , [ 23 , 2 ] ,
[ 24 , 3 ] , [ 25 , 1 ] , [ 26 , 2 ] , [ 27 , 3 ] , [ 28 , 1 ] , [ 29 , 2 ] , [ 30 , 3 ] ,
[ 31 , 1 ] , [ 32 , 2 ] , [ 33 , 3 ] , [ 34 , 1 ] , [ 35 , 2 ] , [ 36 , 3 ] , [ 37 , 1 ] ,
[ 38 , 2 ] , [ 39 , 3 ] , [ 40 , 1 ] , [ 41 , 2 ] , [ 42 , 3 ] , [ 43 , 1 ] , [ 44 , 2 ] ,
[ 45 , 3 ] , [ 46 , 1 ] , [ 47 , 2 ] , [ 48 , 3 ] , [ 49 , 1 ] , [ 50 , 2 ] ]
wxplot2d([discrete,pts],[style,[points,4,1,1]] );

From graph, we observe that the given sequence seems


to be bounded between 1 and 3.

Therefore by BWT, it should have a monotonic


convergent subsequence.

Now, we try to find such a subsequence.


sub:makelist([n,a(3·n)],n,1,50);
[ [ 1 ,3 ] ,[ 2 ,3 ] ,[ 3 ,3 ] ,[ 4 ,3 ] ,[ 5 ,3 ] ,[ 6 ,3 ] ,[ 7 ,3 ] ,[ 8 ,3 ] ,
[ 9 ,3 ] ,[ 10 , 3 ] , [ 11 , 3 ] , [ 12 , 3 ] , [ 13 , 3 ] , [ 14 , 3 ] , [ 15 , 3 ] , [ 16 , 3 ]
, [ 17 , 3 ] , [ 18 , 3 ] , [ 19 , 3 ] , [ 20 , 3 ] , [ 21 , 3 ] , [ 22 , 3 ] , [ 23 , 3 ] ,
[ 24 , 3 ] , [ 25 , 3 ] , [ 26 , 3 ] , [ 27 , 3 ] , [ 28 , 3 ] , [ 29 , 3 ] , [ 30 , 3 ] ,
[ 31 , 3 ] , [ 32 , 3 ] , [ 33 , 3 ] , [ 34 , 3 ] , [ 35 , 3 ] , [ 36 , 3 ] , [ 37 , 3 ] ,
[ 38 , 3 ] , [ 39 , 3 ] , [ 40 , 3 ] , [ 41 , 3 ] , [ 42 , 3 ] , [ 43 , 3 ] , [ 44 , 3 ] ,
[ 45 , 3 ] , [ 46 , 3 ] , [ 47 , 3 ] , [ 48 , 3 ] , [ 49 , 3 ] , [ 50 , 3 ] ]
wxplot2d([discrete,sub],[style,[points,4,1,1]] );
HrashitSinghPrac7.wxm 18 / 19

The subsequence seems to be constant. It seems to


converge to it's value 3 as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(n), n, infinity);
3
Hence the subsequence indeed converges. Thus, BWT is
verified.

9 a(n)=((-1)^n)*n
a(n):=((−1)^n)·n;
n
a ( n ) :=( −1 ) n
pts:makelist([n,a(n)],n,1,50);
[ [ 1 ,−1 ] , [ 2 ,2 ] ,[ 3 ,−3 ] , [ 4 ,4 ] ,[ 5 ,−5 ] , [ 6 ,6 ] ,[ 7 ,−7 ] ,
[ 8 ,8 ] ,[ 9 ,−9 ] , [ 10 , 10 ] ,[ 11 , −11 ] ,[ 12 , 12 ] ,[ 13 , −13 ] ,
[ 14 , 14 ] ,[ 15 , −15 ] ,[ 16 , 16 ] ,[ 17 , −17 ] ,[ 18 , 18 ] ,[ 19 , −19 ] ,
[ 20 , 20 ] ,[ 21 , −21 ] ,[ 22 , 22 ] ,[ 23 , −23 ] ,[ 24 , 24 ] ,[ 25 , −25 ] ,
[ 26 , 26 ] ,[ 27 , −27 ] ,[ 28 , 28 ] ,[ 29 , −29 ] ,[ 30 , 30 ] ,[ 31 , −31 ] ,
[ 32 , 32 ] ,[ 33 , −33 ] ,[ 34 , 34 ] ,[ 35 , −35 ] ,[ 36 , 36 ] ,[ 37 , −37 ] ,
[ 38 , 38 ] ,[ 39 , −39 ] ,[ 40 , 40 ] ,[ 41 , −41 ] ,[ 42 , 42 ] ,[ 43 , −43 ] ,
[ 44 , 44 ] ,[ 45 , −45 ] ,[ 46 , 46 ] ,[ 47 , −47 ] ,[ 48 , 48 ] ,[ 49 , −49 ] ,
[ 50 , 50 ] ]
wxplot2d([discrete,pts],[style,[points,4,1,1]] );
HrashitSinghPrac7.wxm 19 / 19

From graph, we observe that the given sequence seems


to be unbounded.

It should have a monotonic subsequence. The


subsequence may or may not converge.

Now, we try to find such a subsequence.


sub:makelist([n,a(2·n)],n,1,50);
[ [ 1 ,2 ] ,[ 2 ,4 ] ,[ 3 ,6 ] ,[ 4 ,8 ] ,[ 5 ,10 ] , [ 6 ,12 ] , [ 7 ,14 ] ,
[ 8 ,16 ] , [ 9 ,18 ] , [ 10 , 20 ] ,[ 11 , 22 ] ,[ 12 , 24 ] ,[ 13 , 26 ] ,[ 14 , 28 ]
, [ 15 , 30 ] ,[ 16 , 32 ] ,[ 17 , 34 ] ,[ 18 , 36 ] ,[ 19 , 38 ] ,[ 20 , 40 ] ,
[ 21 , 42 ] ,[ 22 , 44 ] ,[ 23 , 46 ] ,[ 24 , 48 ] ,[ 25 , 50 ] ,[ 26 , 52 ] ,
[ 27 , 54 ] ,[ 28 , 56 ] ,[ 29 , 58 ] ,[ 30 , 60 ] ,[ 31 , 62 ] ,[ 32 , 64 ] ,
[ 33 , 66 ] ,[ 34 , 68 ] ,[ 35 , 70 ] ,[ 36 , 72 ] ,[ 37 , 74 ] ,[ 38 , 76 ] ,
[ 39 , 78 ] ,[ 40 , 80 ] ,[ 41 , 82 ] ,[ 42 , 84 ] ,[ 43 , 86 ] ,[ 44 , 88 ] ,
[ 45 , 90 ] ,[ 46 , 92 ] ,[ 47 , 94 ] ,[ 48 , 96 ] ,[ 49 , 98 ] ,[ 50 , 100 ] ]
wxplot2d([discrete,sub],[style,[points,4,1,1]] );

The subsequence seems to be monotonically increasing.


It seems to diverge to ∞ as n tends to ∞.

We can confirm it by finding limit of the subsequence.


limit(a(2·n), n, infinity);
infinity
Hence the subsequence indeed diverges.
Practical 8 - Harshit Singh.wxm 1 / 12

Practical 8
Study of convergence/divergence of
infinite series of real numbers by
plotting
their sequence of partial sum.
1 ∑1/n
(%i3) s(i):=sum(1/n,n,1,i);
i

1
(%o3) s ( i ) :=
n

n=1

1.1 graph:1

(%i4) f:makelist(s(i),i,1,50)$
Practical 8 - Harshit Singh.wxm 2 / 12

(%i5) wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/n"]);
(%t5)

(%o5)

1.2 graph:2

(%i6) g:makelist(s(i),i,1,100)$
Practical 8 - Harshit Singh.wxm 3 / 12

(%i7) wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/n"]);
(%t7)

(%o7)

1.3 observation:

From the above graphs it seems that ∑ 1/n tends to ∞ as n tends to ∞


We can check it by predefined limit function.

(%i13) sum(1/n,n,1,inf),simpsum:true;
sum: sum is divergent.
-- an error. To debug this try: debugmode(true);

1.4 conclusion:

∑ 1/n indeed is divergent series.


Practical 8 - Harshit Singh.wxm 4 / 12

➔ kill(all)$

2 ∑1/(n^2)
➔ s(i):=sum(1/n^2,n,1,i);

2.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/n^2"]);

2.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/n^2"]);

2.3 observation:

From the above graphs it seems that ∑ 1/n^2 tends to 1.65 as n tends to ∞
We can check it by predefined limit function.

➔ sum(1/n^2,n,1,inf),numer,simpsum:true;

2.4 conclusion:

∑ 1/n^2 indeed is a convergent series.


Practical 8 - Harshit Singh.wxm 5 / 12

➔ kill(all)$

3 ∑1/3^n
➔ s(i):=sum(1/3^n,n,1,i);

3.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/3^n"]);

3.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/3^n"]);

3.3 observation:

From the above graphs it seems that ∑ 1/3^n tends to 0.5 as n tends to ∞
We can check it by predefined limit function.

➔ sum(1/3^n,n,1,inf),numer,simpsum:true;

3.4 conclusion:

∑ 1/3^n indeed is a convergent series.


Practical 8 - Harshit Singh.wxm 6 / 12

➔ kill(all)$

4 ∑1/n!
➔ s(i):=sum(1/n!,n,1,i);

4.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/n!"]);

4.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑1/n!"]);

4.3 observation:

From the above graphs it seems that ∑ 1/n! tends to 1.73 as n tends to ∞

4.4 conclusion:

∑ 1/n! indeed is convergent series.


Practical 8 - Harshit Singh.wxm 7 / 12

5 ∑2^n
➔ s(i):=sum(2^n,n,1,i);

5.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑2^n"]);

5.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"],[title, "∑2^n"]);

5.3 observation:

From the above graphs it seems that ∑ 2^n tends to ∞ as n tends to ∞


We can check it by predefined limit function.

➔ sum(2^n,n,1,inf),simpsum:true;

5.4 conclusion:

∑ 2^n indeed is divergent series.


Practical 8 - Harshit Singh.wxm 8 / 12

6 ∑-1^n
➔ s(i):=sum((−1)^n,n,1,i);

6.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"]);

6.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"]);

6.3 conclusion:

The series oscillates between 0 and 1.


Practical 8 - Harshit Singh.wxm 9 / 12

7 ∑n!/n^n
➔ s(i):=sum(n!/n^n,n,1,i);

7.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"]);

7.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"]);

7.3 observation:

From the above graphs it seems that the above series tends to 1.89as n tends to

Practical 8 - Harshit Singh.wxm 10 / 12

8 ∑cos(1/n)
➔ s(i):=sum(cos(1/n),n,1,i);

8.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"]);

8.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"]);

8.3 observation:

From the above graphs it seems that series tends to ∞ as n tends to ∞


Practical 8 - Harshit Singh.wxm 11 / 12

9 ∑(-1)^2n/(2n)!
➔ s(i):=sum((−1)^2·n/(2·n)!,n,1,i);

9.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"]);

9.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"]);

9.3 observation:

From the above graphs it seems that the above series tends to 0.59as n tends to

Practical 8 - Harshit Singh.wxm 12 / 12

10 ∑1/√n+√(n+1)
➔ s(i):=sum(1/sqrt(n)+sqrt(n+1),n,1,i);

10.1 graph:1

➔ f:makelist(s(i),i,1,50)$

➔ wxplot2d([discrete,f],[style,[points,4,2,7]],[x,0,50
],[xlabel,"n"],[ylabel,"a(n)"]);

10.2 graph:2

➔ g:makelist(s(i),i,1,100)$

➔ wxplot2d([discrete,g],[style,[points,4,3,7]],[x,0,100
],[xlabel,"n"],[ylabel,"a(n)"]);

10.3 observation:

From the above graphs it seems that the above series tends to ∞ as n tends to

Practical 9 - Harshit Singh.wxmx 1 / 25

Practical - 9
Cauchy’s Root Test by plotting n^th
roots

1 ∑1/n
(%i1) u(n):=1/n$

(%i2) k:makelist(u(n),n,1,30)$

(%i3) wxplot2d([discrete,k],[style,[points,6,4,2]]);
(%t3)

(%o3)

Observartion:
u(n)≥0 for all n
Therefore we can use CNRT
Practical 9 - Harshit Singh.wxmx 2 / 25

(%i4) v(n):=u(n)^(1/n)$

(%i5) l:makelist(v(n),n,1,2000)$

(%i6) wxplot2d([discrete,l],[style,[points,5,3,5]]);
(%t6)

(%o6)

Observation:
It seems to converge to 1.
We can check it using the pre defined limit function.

(%i7) limit(v(n),n,inf);
(%o7) 1

As u(n) ≥ 0 & limit v(n) = 1,


By using CNRT,
behaiour of Σu(n) is uncertain

Therefore using the SOPS method.

(%i8) j:makelist(sum(1/n,n,1,i),i,1,300)$
Practical 9 - Harshit Singh.wxmx 3 / 25

(%i9) wxplot2d([discrete,j],[style,[points,2,3,2]]);
(%t9)

(%o9)

It seems that ∑ 1/n tends to ∞ as n tends to ∞


We can check it by predefined fun.

(%i18) sum(1/n,n,1,inf),simpsum:true;
sum: sum is divergent.
-- an error. To debug this try: debugmode(true);

Conclusion:
The ∑ 1/n is divergent series.
Practical 9 - Harshit Singh.wxmx 4 / 25

2 ∑1/n^2
➔ kill(all)$
u(n):=1/n^2;
k:makelist(u(n),n,1,30)$
1
(%o1) u ( n ) :=
n2

➔ wxplot2d([discrete,k],[style,[points,9,2,4]]);
(%t3)

(%o3)

Observartion:
u(n)≥0 for all n
Therefore we can use CNRT

➔ v(n):=u((n))^(1/n);
/
(%o4) v ( n ) := u ( n ) 1 n

➔ l:makelist(v(n),n,1,2000)$
Practical 9 - Harshit Singh.wxmx 5 / 25

➔ wxplot2d([discrete,l],[style,[points,4,3,5]]);
(%t6)

(%o6)

Observation:
It seems to converge to 1.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o7) 1

As u(n) ≥ 0 & limit v(n) = 1,


By using CNRT,
behaiour of Σu(n) is uncertain

Therefore using the SOPS method.

➔ k:makelist(sum(1/n^2,n,1,i),i,1,400)$
Practical 9 - Harshit Singh.wxmx 6 / 25

➔ wxplot2d([discrete,k],[style,[points,2,4,2]]);
(%t9)

(%o9)

It seems that ∑ 1/n tends to 1.65 as n tends to ∞


We can check it by predefined function.

➔ sum(1/n^2,n,1,inf),numer,simpsum:true;
(%o10) 1.644934066848227

Conclusion:
The ∑ 1/n^2 is a convergent series
Practical 9 - Harshit Singh.wxmx 7 / 25

3 ∑1/n!
➔ kill(all)$
u(n):=1/n!;
k:makelist(u(n),n,1,30)$
1
(%o1) u ( n ) :=
n!

➔ wxplot2d([discrete,k],[style,[points,3,3,3]]);
(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use CNRT

➔ v(n):=u(n)^(1/n)$

➔ l:makelist(v(n),n,150)$
Practical 9 - Harshit Singh.wxmx 8 / 25

➔ wxplot2d([discrete,l],[style,[points,6,3,5]]);
(%t20)

(%o20)

Observation:
It seems to converge to 0.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o20) 1

As u(n)≥0 & limit v(n)=0<1,


By using CNRT,
Σu(n) is cgt.
Practical 9 - Harshit Singh.wxmx 9 / 25

4 ∑(-1)^n
➔ kill(all)$
u(n):=(−1)^n;
k:makelist(u(n),n,1,30)$
(%o1) u ( n ) := ( − 1 ) n

➔ wxplot2d([discrete,k],[x,0,35],[style,[points,2,2]]);
(%t3)

(%o3)

Observartion: u(n)≤0 for some n


Therefore we can not use CNRT

Therefore taking modulus:

➔ v(n):=abs(u(n));
(%o4) v ( n ) := u ( n )

➔ m:makelist((v(n))^(1/n),n,1,50),numer$
Practical 9 - Harshit Singh.wxmx 10 / 25

➔ wxplot2d([discrete,m],[y,0,2],[style,[points,3,2,4]]);
(%t6)

(%o6)

Observation:
It seems to converge to 1.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o7) 1

As |u(n)| is convergent to 1, CNRT fails.


Therefore, using SOPS:
Practical 9 - Harshit Singh.wxmx 11 / 25

➔ k:makelist(sum(u(i),i,1,n),n,1,35)$
wxplot2d([discrete,k],[x,0,36],[y,−2,1],[style,[points,2,2]]);
(%t9)

(%o9)

Conclusion:

The series oscillates between -1 & 0 as n → ∞


Practical 9 - Harshit Singh.wxmx 12 / 25

5 ∑1/√n
➔ kill(all)$
u(n):=1/√(n);
k:makelist(u(n),n,1,30)$
1
(%o1) u ( n ) :=
n

➔ wxplot2d([discrete,k],[x,0,35],[style,[points,2,2]]);
(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use CNRT

➔ v(n):=u(n)^(1/n);
/
(%o4) v ( n ) := u ( n ) 1 n

➔ l:makelist(v(n),n,1,200)$
Practical 9 - Harshit Singh.wxmx 13 / 25

➔ wxplot2d([discrete,l],[x,0,100],[style,[points,3,3,5]]);
(%t6)

(%o6)

Observation:
It seems to converge to 1.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o7) 1

As u(n)≥0 & limit v(n)=1,


By using CNRT,
behaiour of Σu(n) is uncertain
Practical 9 - Harshit Singh.wxmx 14 / 25

➔ k:makelist(sum(u(i),i,1,n),n,1,60)$
wxplot2d([discrete,k],[x,0,61],[y,−2,15],[style,[points,2,2]]);
(%t9)

(%o9)

It seems that ∑ 1/√n tends to ∞ as n tends to ∞

Conclusion:

The ∑ 1/√n is divergent.


Practical 9 - Harshit Singh.wxmx 15 / 25

6 ∑ (-1)^n/5^n
➔ kill(all)$
u(n):=(−1)^n/5^n;
k:makelist(u(n),n,1,30)$
( −1)n
(%o1) u ( n ) :=
5n

➔ wxplot2d([discrete,k],[x,0,35],[style,[points,2,2,3]]);
(%t3)

(%o3)

Observartion: u(n)<0 for some n


Therefore we can not use CNRT

Therefore taking modulus:

➔ v(n):=abs(u(n));
(%o4) v ( n ) := u ( n )
Practical 9 - Harshit Singh.wxmx 16 / 25

➔ m:makelist((v(n)^(1/n)),n,1,50)$

➔ wxplot2d([discrete,m],[y,0,0.5],[style,[points,3,2,4]]);
(%t6)

(%o6)

Observation:
It seems to converge to 1/5.
We can check it using the pre define limit fn.

➔ limit(v(n)^(1/n),n,inf);
1
(%o7)
5

Conclusion:

As |u(n)| is convergent to 1/5<1,


By CNRT,
∑u(n) tends to 0
Practical 9 - Harshit Singh.wxmx 17 / 25

7 ∑ 7^n
➔ kill(all)$
u(n):=7^n;
k:makelist(sum(u(i),i,1,n),n,1,30)$
(%o1) u ( n ) := 7 n

➔ wxplot2d([discrete,k],[style,[points,2,2]]);
(%t3)

(%o3)

Observartion: u(n)>0 for all n


Therefore we can use CNRT

➔ v(n):=u(n)^(1/n);
/
(%o4) v ( n ) := u ( n ) 1 n

➔ l:makelist(v(n),n,1,100)$
Practical 9 - Harshit Singh.wxmx 18 / 25

➔ wxplot2d([discrete,l],[style,[points,1,3,5]]);
(%t6)

(%o6)

Onbservation:
It seems to converge to 7.
We can check it using the pre define limit function.

➔ limit(v(n),n,inf);
(%o7) 7

As u(n)≥0 & limit v(n)=7>1,


By using CNRT,
Σu(n) is divergent.
Practical 9 - Harshit Singh.wxmx 19 / 25

8 ∑ n^n/n!
➔ kill(all)$
u(n):=n^n/n!;
k:makelist(sum(u(i),i,1,n),n,1,30)$
nn
(%o1) u ( n ) :=
n!

➔ wxplot2d([discrete,k],[style,[points,2,2]]);
(%t3)

(%o3)

Observartion: u(n)>0 for all n


Therefore we can use CNRT

➔ v(n):=u(n)^(1/n);
/
(%o4) v ( n ) := u ( n ) 1 n

➔ l:makelist(v(n),n,1,100)$
Practical 9 - Harshit Singh.wxmx 20 / 25

➔ wxplot2d([discrete,l],[style,[points,1,3,5]]);
(%t6)

(%o6)

Onbservation:
It seems to converge to 2.7.
We can check it using the pre define limit function.

➔ limit(v(n),n,inf);
(%o7) %e

As u(n)≥0 & limit v(n)=%e>1,


By using CNRT,
Σu(n) is divergent.
Practical 9 - Harshit Singh.wxmx 21 / 25

9 ∑ %e^n/n^n
➔ kill(all)$
u(n):=%e^n/n^n;
k:makelist(sum(u(i),i,1,n),n,1,30)$
%e n
(%o1) u ( n ) :=
nn

➔ wxplot2d([discrete,k],[style,[points,2,2]]);
(%t3)

(%o3)

Observartion: u(n)>0 for all n


Therefore we can use CNRT

➔ v(n):=u(n)^(1/n);
/
(%o4) v ( n ) := u ( n ) 1 n

➔ l:makelist(v(n),n,1,100)$
Practical 9 - Harshit Singh.wxmx 22 / 25

➔ wxplot2d([discrete,l],[x,0,100],[style,[points,1,3,5]]);
(%t6)

(%o6)

Onbservation:
It seems to converge to 0.
We can check it using the pre define limit function.

➔ limit(v(n),n,inf);
(%o7) 0

As u(n)≥0 & limit v(n)=0<1,


By using CNRT,
Σu(n) is cgt.
Practical 9 - Harshit Singh.wxmx 23 / 25

10 ∑ (3.14/π)^n
➔ u(n):=(n!)^2/(2·n)!;
k:makelist(sum(u(i),i,1,n),n,1,30)$
n !2
(%o18) u ( n ) :=
( 2 n) !

➔ wxplot2d([discrete,k],[x,0,35],[style,[points,2,2,3]]);
(%t15)

(%o15)

Observartion: u(n)>0 for all n


Therefore we can use CNRT

➔ v(n):=(u(n))^(1/n);
/
(%o22) v ( n ) := u ( n ) 1 n

➔ l:makelist(v(n),n,1,20)$
Practical 9 - Harshit Singh.wxmx 24 / 25

➔ wxplot2d([discrete,l],[style,[points,3,3,5]]);
(%t24)

(%o24)

➔ limit (v(n),n,∞);
2 /n
n!
(%o25) lim
1 /n
n→∞ ( 2 n) !

Observation:
It seems to converge to 0.9.
We can check it using the pre define limit fn.

➔ (v(n)),simpsum;true,numer;
2 /n
n!
(%o9) /
( 2 n ) !1 n
(%o10) true
Practical 9 - Harshit Singh.wxmx 25 / 25

As u(n)≥0 & limit v(n)=0.99<1,


By using CNRT,
Σu(n) is cgt.
Practical 10 - Harshit Singh.wxmx 1 / 21

Practical - 10
D' Alembert's Ratio Test

1 ∑1/n
➔ kill(all)$
u(n):=1/n;
z:makelist(u(n),n,1,30)$
1
(%o1) u ( n ) :=
n

➔ wxplot2d([discrete,z],[style,[linespoints,2,2,8]]);
(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use DRT
Practical 10 - Harshit Singh.wxmx 2 / 21

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o4) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$

➔ wxplot2d([discrete,m],[style,[linespoints,1,3,5]]);
(%t6)

(%o6)

Observation:
It seems to converge to 1.
We can check it using the pre define limit function.

➔ limit(v(n),n,inf);
(%o7) 1

As u(n) ≥ 0 & limit v(n) = 1,


By using CNRT,
behaiour of Σu(n) is uncertain

Therefore using the SOPS method.


Practical 10 - Harshit Singh.wxmx 3 / 21

➔ k:makelist(sum(1/i,i,1,n),n,1,100)$

➔ wxplot2d([discrete,k],[style,[points,2,3,2]],[title,"Σ1/n"]);
(%t9)

(%o9)

It seems that ∑ 1/n tends to ∞ as n tends to ∞


We can check it by predefined fun.

➔ sum(1/n,n,1,inf),simpsum:true;
sum: sum is divergent.
−− an error. To debug this try: debugmode(true);

Conclusion:
The ∑ 1/n is divergent.
Practical 10 - Harshit Singh.wxmx 4 / 21

2 ∑1/n^3
➔ kill(all)$
u(n):=1/n^3;
z:makelist(u(n),n,1,30)$
1
(%o1) u ( n ) :=
n3

➔ wxplot2d([discrete,z],[style,[linespoints,2,2,8]]);
(%t11)

(%o11)

Observartion: u(n)≥0 for all n


Therefore we can use DRT

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o12) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 5 / 21

➔ wxplot2d([discrete,m],[x,0,100],[style,[linespoints,1,3,5]]);
(%t14)

(%o14)

Observation:
It seems to converge to 1.
We can check it using the pre define limit function.

➔ limit(v(n),n,inf);
(%o15) 1

As u(n) ≥ 0 & limit v(n) = 1,


By using CNRT,
behaiour of Σu(n) is uncertain

Therefore using the SOPS method.

➔ k:makelist(sum(1/i^3,i,1,n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 6 / 21

➔ wxplot2d([discrete,k],[style,[points,2,3,2]],[title,"Σ1/n"]);
(%t17)

(%o17)

It seems that ∑ 1/n^3 tends to 1.2 as n tends to ∞


We can check it by predefined fun.

➔ sum(1/n^3,n,1,inf),numer,simpsum:true;
(%o18) 1.202056903159594

Conclusion:
The ∑ 1/n^3 is convergent.
Practical 10 - Harshit Singh.wxmx 7 / 21

3 ∑(-1)^n/n!
➔ kill(all)$
u(n):=(−1)^n/n!;
z:makelist(u(n),n,1,30)$
( −1)n
(%o1) u ( n ) :=
n!

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);
(%t3)

(%o3)

Observartion: u(n)<0 for some n


Therefore we can not use DRT

Therefore taking modulus:

➔ v(n):=abs(u(n));
(%o4) v ( n ) := u ( n )
Practical 10 - Harshit Singh.wxmx 8 / 21

➔ m:makelist((v(n+1)/v(n)),n,1,50),numer$

➔ wxplot2d([discrete,m],[y,0,2],[style,[points,3,2,4]]);
(%t6)

(%o6)

Observation:
It seems to converge to 0.
We can check it using the pre define limit function.

➔ limit(v(n),n,inf);
(%o13) 0

As u(n)≥0 & limit v(n)=0<1,


By using the DRT Test,
the series is cgt.
Practical 10 - Harshit Singh.wxmx 9 / 21

4 ∑1/5^n
➔ kill(all)$
u(n):=1/5^n;
z:makelist(u(n),n,1,30)$
1
(%o1) u ( n ) :=
5n

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);

(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use DRT

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o4) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 10 / 21

➔ wxplot2d([discrete,m],[x,0,100],[style,[linespoints,1,3,5]]);
Message from maxima's stderr stream: Warning: empty y range [0.2:0.2], adjusting to [0.198:0.202

(%t6)

(%o6)

Observation:
It seems to converge to 1/5.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
1
(%o7)
5

As u(n)≥0 & limit v(n)=1/5<1,


By using the DRT Test,
the series is cgt.
Practical 10 - Harshit Singh.wxmx 11 / 21

5 ∑π^n
➔ kill(all)$
u(n):=π^n;
z:makelist(u(n),n,1,30)$
(%o1) u ( n ) := π n

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);

(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use DRT

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o4) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 12 / 21

➔ wxplot2d([discrete,m],[x,0,100],[style,[linespoints,1,3,5]]);
Message from maxima's stderr stream: Warning: empty y range [3.14159:3.14159], adjusting to [3.

(%t6)

(%o6)

Observation:
It seems to converge to π.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf),numer;
(%o7) 3.141592653589793

As u(n)≥0 & limit v(n)=π>1,


By using the DRT Test,
the series is dgt.
Practical 10 - Harshit Singh.wxmx 13 / 21

6 ∑(-1)^n
➔ kill(all)$
u(n):=(−1)^n;
z:makelist(u(n),n,1,30)$
(%o1) u ( n ) := ( − 1 ) n

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);

(%t3)

(%o3)

Observartion: u(n)<0 for some n


Therefore we can not use DRT

Therefore taking modulus:

➔ v(n):=abs(u(n));
(%o4) v ( n ) := u ( n )

➔ m:makelist((v(n+1)/v(n)),n,1,50),numer$
Practical 10 - Harshit Singh.wxmx 14 / 21

➔ wxplot2d([discrete,m],[y,0,2],[style,[points,3,2,4]]);

(%t6)

(%o6)

Observation:
It seems to converge to 1.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o7) 1

As |u(n)| is convergent to 1, DRT fails.


Therefore, using SOPS:
Practical 10 - Harshit Singh.wxmx 15 / 21

➔ k:makelist(sum(u(i),i,1,n),n,1,35)$
wxplot2d([discrete,k],[x,0,36],[y,−2,1],[style,[linespoints,2,2]]);

(%t9)

(%o9)

Conclusion:
The series oscillates between -1 & 0 as n → ∞
Practical 10 - Harshit Singh.wxmx 16 / 21

7 ∑%e^n/n^n
➔ kill(all)$
u(n):=%e^n/n^n;
z:makelist(u(n),n,1,30)$
%e n
(%o1) u ( n ) :=
nn

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);

(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use DRT

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o4) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 17 / 21

➔ wxplot2d([discrete,m],[x,0,100],[style,[linespoints,1,3,5]]);

(%t6)

(%o6)

Observation:
It seems to converge to 0.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o7) 0

As u(n)≥0 & limit v(n)=0<1,


By using the DRT Test,
the series is cgt.
Practical 10 - Harshit Singh.wxmx 18 / 21

8 ∑n^n/n!
➔ kill(all)$
u(n):=n^n/n!;
z:makelist(u(n),n,1,30)$
nn
(%o1) u ( n ) :=
n!

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);

(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use DRT

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o4) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 19 / 21

➔ wxplot2d([discrete,m],[x,0,100],[style,[linespoints,1,3,5]]);

(%t6)

(%o6)

Observation:
It seems to converge to 2.7.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
(%o7) %e

As u(n)≥0 & limit v(n)=2.7>1,


By using the DRT Test,
the series is dgt.
Practical 10 - Harshit Singh.wxmx 20 / 21

9 ∑n^2+2n+1/3^n+2
➔ kill(all)$
u(n):=(n^2+2·n+1)/(3^n+2);
z:makelist(u(n),n,1,300)$
n2 + 2 n + 1
(%o1) u ( n ) :=
3n + 2

➔ wxplot2d([discrete,z],[x,0,35],[style,[linespoints,2,2]]);
(%t3)

(%o3)

Observartion: u(n)≥0 for all n


Therefore we can use DRT

➔ v(n):=u(n+1)/u(n);
u( n+1)
(%o4) v ( n ) :=
u( n)

➔ m:makelist(v(n),n,1,100)$
Practical 10 - Harshit Singh.wxmx 21 / 21

➔ wxplot2d([discrete,m],[x,0,100],[style,[linespoints,1,3,5]]);
(%t6)

(%o6)

Observation:
It seems to converge to 0.33.
We can check it using the pre define limit fn.

➔ limit(v(n),n,inf);
1
(%o7)
3

As u(n)≥0 & limit v(n)=0.33<1,


By using the DRT Test,
the series is cgt.
HARSHIT_SINGH_PRACTICAL12.wxm 1 / 14

kill(all);
done
1 (1/n)^(1/n)
a(n):=sum((1/n)^(1/n),n,1,i);
i

1 1/ n
a ( n ) :=
n
n=1
b(n):=abs((1/n))^(1/n);
1 1/ n
b ( n ) :=
n
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,10)$
list2:makelist([j,d(10^j)],j,1,10)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[

Both nth root test and D'Alembert's ratio test doesnt


give a conclusion as they both tend to 1.
limit(b(n),n,∞);
1
HARSHIT_SINGH_PRACTICAL12.wxm 2 / 14

since the sequence doesnt converege to 0 using


necessary condition for convergence we conclude that
the series doesnt converege.

2 1/n
kill(all);
done
a(n):=sum((1/n),n,1,i);
i
1
a ( n ) :=
n
n=1
b(n):=abs((1/n));
1
b ( n ) :=
n
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,10)$
list2:makelist([j,d(10^j)],j,1,10)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[

Both nth root test and D'Alembert's ratio test doesnt


give a conclusion as they both tend to 1.
sum(1/n,n,1,inf),numer,simpsum:true;
sum: sum is divergent.
-- an error. To debug this try: debugmode(true);
HARSHIT_SINGH_PRACTICAL12.wxm 3 / 14

therefore using predefined lim function we say that the


series is divergent.

3 1/n^2
kill(all)$
a(n):=sum((1/n^2),n,1,i);
i
1
a ( n ) := 2
n
n=1
b(n):=abs((1/n^2));
1
b ( n ) :=
2
n
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,10)$
list2:makelist([j,d(10^j)],j,1,10)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[

Both nth root test and D'Alembert's ratio test doesnt


give a conclusion as they both tend to 1.
sum(1/n^2,n,1,inf),numer,simpsum:true;
1.644934066848227
therefore using predefined lim function we say that the
series is convergent.
HARSHIT_SINGH_PRACTICAL12.wxm 4 / 14

4 (1+1/n^(1/2))^-n^(3/2)
kill(all)$
a(n):=sum((1+1/n^(1/2))^−n^(3/2),n,1,i);
i
3/ 2
1 −n
a ( n ) := 1+
1/ 2
n
n=1
b(n):=abs((1+1/n^(1/2))^−n^(3/2));
3/ 2
1 −n
b ( n ) := 1 + 1/ 2
n
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,2)$
list2:makelist([j,d(10^j)],j,1,2)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[

limit(c(n),n,∞);
−1
%e
limit(d(n),n,∞);
−1
%e
since both nth root and ratio does a converege as
they both tend to limit< 1.
HARSHIT_SINGH_PRACTICAL12.wxm 5 / 14

we conclude using root test and dalemberts ratio test


that the series is convergent

5 n!/n^n
kill(all)$
a(n):=sum(n!/n^n,n,1,i);
i
n!
a ( n ) := n
n
n=1
b(n):=abs(n!/n^n
);
n!
b ( n ) :=
n
n
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,2)$
list2:makelist([j,d(10^j)],j,1,2)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[

limit(c(n),n,∞),numer;
rat: replaced -1.0 by -1/1 = -1.0
rat: replaced -1.0 by -1/1 = -1.0
0.3678794411714423
limit(d(n),n,∞);
HARSHIT_SINGH_PRACTICAL12.wxm 6 / 14

−1
%e
since both nth root and ratio does a converege as
they both tend to limit< 1.
we conclude using root test and dalemberts ratio test
that the series is convergent

6 (n^3 + 5)/(3^n + 2)
kill(all)$
a(n):=sum((n^3 + 5)/(3^n + 2),n,1,i);
i
3
n +5
a ( n ) :=
n
3 +2
n=1
b(n):=abs((n^3 + 5)/(3^n + 2));
3
n +5
b ( n ) :=
n
3 +2
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,2)$
list2:makelist([j,d(10^j)],j,1,2)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[
HARSHIT_SINGH_PRACTICAL12.wxm 7 / 14

limit(c(n),n,∞),numer;
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 5.0 by 5/1 = 5.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 2.5 by 5/2 = 2.5
rat: replaced 2.5 by 5/2 = 2.5
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 2.0 by 2/1 = 2.0
rat: replaced 0.6666666666666666 by 2/3 = 0.6666666666666666
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 5.0 by 5/1 = 5.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
rat: replaced 1.0 by 1/1 = 1.0
0.3333333333333333
limit(d(n),n,∞),numer;
rat: replaced 1.09861228866811 by 28672937/26099232 = 1.098612288668111
rat: replaced -1.09861228866811 by -28672937/26099232 = -1.098612288668111
rat: replaced 1.09861228866811 by 28672937/26099232 = 1.098612288668111
rat: replaced 1.098612288668111 by 27033780/24607207 = 1.098612288668112
HARSHIT_SINGH_PRACTICAL12.wxm 8 / 14

rat: replaced 0.5 by 1/2 = 0.5


rat: replaced 0.5 by 1/2 = 0.5
rat: replaced -1.09861228866811 by -28672937/26099232 = -1.098612288668111
rat: replaced 1.09861228866811 by 28672937/26099232 = 1.098612288668111
0.3333333333333324
since both nth root and ratio does a converege as
they both tend to limit< 1.
we conclude using root test and dalemberts ratio test
that the series is convergent

7 1/n^2 + n
kill(all)$
a(n):=sum(1/(n^2 + n),n,1,i);
i
1
a ( n ) := 2
n +n
n=1
b(n):=abs(1/(n^2 + n));
1
b ( n ) :=
2
n +n
c(n):=b(n+1)/b(n);
b(n+1)
c ( n ) :=
b(n)
d(n):=b(n)^(1/n);
1/ n
d ( n ) :=b ( n )
list1:makelist([j,c(10^j)],j,1,10)$
list2:makelist([j,d(10^j)],j,1,10)$
wxplot2d([[discrete,list1],[discrete,list2]],[style,[points,7,5,2],[points,6,3,3]],[
HARSHIT_SINGH_PRACTICAL12.wxm 9 / 14

limit(c(n),n,∞),numer;
1
limit(d(n),n,∞),numer;
1
since both nth root and ratio does a converege as
they both tend to limit=1.
we cant conclude using root test and dalemberts ratio
test .
hence we use sops method
m:makelist(sum(1/(n+n^2),n,1,i),i,1,30)$
wxplot2d([discrete,m]);

therefore the series is convergent to 0.97.

8 1/√(n+1)
kill(all)$
a(n):=1/sqrt(n+1);
1
a ( n ) := p
n+1
b(n):=abs(a(n+1)/a(n));
a(n+1)
b ( n ) :=
a(n)
c(n):=(abs(a(n)))^(1/n);
1/ n
c ( n ) := a ( n )
HARSHIT_SINGH_PRACTICAL12.wxm 10 / 14

b:makelist(b(10^i),i,1,10),numer$
c:makelist(c(10^i),i,1,10),numer$
wxplot2d([[discrete,b],[discrete,c]],[y,0.8,1.05],[style,[linespoints,2,2,2,2],[lin
[legend,"b(n)","c(n)"]);

Since the limits of both b(n) and c(n) tend to 1, therefore


both CNT and DRT are inconclusive.
Let us use the SOPS method.
s1:makelist(sum(1/(sqrt(i+1)),i,2,n),n,1,100)$
wxplot2d([discrete,s1],[style,[points,2,2,2]]);

s2:makelist(sum(1/sqrt(i+1),i,2,n),n,1,700)$
wxplot2d([discrete,s2],[style,[points,2,2,2]]);

The SOPS seems to diverge. Therefore the series also


diverges.

9 cos n
kill(all);
done
a(n):=cos(n);
a ( n ) :=cos( n )
HARSHIT_SINGH_PRACTICAL12.wxm 11 / 14

b(n):=abs(a(n+1)/a(n));
a(n+1)
b ( n ) :=
a(n)
c(n):=(abs(a(n)))^(1/n);
1/ n
c ( n ) := a ( n )
b:makelist(b(10^i),i,1,20),numer$
c:makelist(c(10^i),i,1,20),numer$
wxplot2d([[discrete,b],[discrete,c]],[style,[linespoints,2,2,2,2],[linespoints,3,
[legend,"b(n)","c(n)"],[xlabel,"n"],[ylabel,"a(n)"]);

Observation: c(n) seems to converge to 1. Therefore


CNT is inconclusive.
b(n) seems to behave randomly.
Let us use the SOPS method.
s1:makelist(sum(1/cos(i),i,2,n),n,1,50)$
wxplot2d([discrete,s1],[style,[points,2,2,2]],[xlabel,"n"],[ylabel,"a(n)"],[title,"S

s2:makelist(sum(1/cos(i),i,1,n),n,1,100)$
wxplot2d([discrete,s2],[style,[points,2,2,2]],[xlabel,"n"],[ylabel,"a(n)"],[title,"S
HARSHIT_SINGH_PRACTICAL12.wxm 12 / 14

The SOPS does not seem to converge. Therefore the


series also doesn't converge.

10 1/n(logn)^2
kill(all);
done
a(n):=1/(n·(log(n)^2));
1
a ( n ) :=
2
n log ( n )
b(n):=abs(a(n+1)/a(n));
a(n+1)
b ( n ) :=
a(n)
c(n):=(abs(a(n))^(1/n));
1/ n
c ( n ) := a ( n )
b:makelist(b(10^i),i,1,5)$
c:makelist(c(10^i),i,1,5)$
wxplot2d([[discrete,b],[discrete,c]],[y,0.6,1.05],[style,[linespoints,2,2,2,2],[lin
[legend,"b(n)","c(n)"],[xlabel,"n"],[ylabel,"a(n)"]);

Since the limits of both b(n) and c(n) tend to 1, therefore


both CNT and DRT are inconclusive.
limit(a(n),n,inf);
0
s1:makelist(sum(1/(i·(log(i)^2)),i,2,n),n,1,100)$
wxplot2d([discrete,s1],[style,[points,2,2,2]],[xlabel,"n"],[ylabel,"a(n)"],[title,"S
HARSHIT_SINGH_PRACTICAL12.wxm 13 / 14

s2:makelist(sum(1/(i·(log(i)^2)),i,2,n),n,1,500)$
wxplot2d([discrete,s2],[style,[points,2,2,2]],[xlabel,"n"],[ylabel,"a(n)"],[title,"S

11 1/nlogn
kill(all);
done
a(n):=1/(n·(log(n)));
1
a ( n ) :=
n log ( n )
b(n):=abs(a(n+1)/a(n));
a(n+1)
b ( n ) :=
a(n)
c(n):=(abs(a(n))^(1/n));
1/ n
c ( n ) := a ( n )
b:makelist(b(10^i),i,2,5),numer;
[ 0.9879643283276797, 0.9988564719678147 ,
0.9998891543832154 ,0.9999891315248183 ]
c:makelist(c(10^i),i,2,5),numer;
[ 0.9405189344523628, 0.9911985614271922 ,
0.9988575863340753 ,0.9998604457803696 ]
wxplot2d([[discrete,b],[discrete,c]],[y,0.92,1.02],[style,[linespoints,2,2,2,2],[l
[legend,"b(n)","c(n)"]);
HARSHIT_SINGH_PRACTICAL12.wxm 14 / 14

Since the limits of both b(n) and c(n) tend to 1, therefore


both CNT and DRT are inconclusive.
limit(a(n),n,inf);
0
s1:makelist(sum(1/(i·(log(i))),i,2,n),n,1,100)$
wxplot2d([discrete,s1],[y,0,2.5],[style,[points,2,2,2]]);

s2:makelist(sum(1/(i·(log(i))),i,2,n),n,1,700)$
wxplot2d([discrete,s2],[style,[points,2,2,2]]);

The SOPS seems to diverge. Therefore the series also


diverges.

You might also like