Professional Documents
Culture Documents
Practical File Name: Harshit Singh Course: B.SC (H) Mathematics Roll Number: 21BMAT100 Submitted To: Ms Rajni Gupta
Practical File Name: Harshit Singh Course: B.SC (H) Mathematics Roll Number: 21BMAT100 Submitted To: Ms Rajni Gupta
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
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]);
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 x −x −2 x
%e , 4 %e −3 %e ]
2.2.3 Plotting the family of Solutions
wxplot2d(rhs(fsoln52),[x,−1,1]);
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]);
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]);
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]);
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
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]);
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]);
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"
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
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−
2π
− 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]]);
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"]);
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"]);
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
Practical - 4
1 Runge-Kutta Questions
➔ 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
➔ 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
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:
dx/dt = b1x(1-x/k)-c1xy
dy/dt = c2xy-a2y
➔ 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:
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
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:
3 Battle Model
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:
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
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:
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]);
kill(all)$
Observations :
1) The given sequence seems to converge to 0.
Observation:
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:
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:
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:
kill(all)$
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
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]] );
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]] );
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]] );
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]] );
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]] );
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
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]] );
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]] );
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]] );
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]] );
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
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
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:
(%i13) sum(1/n,n,1,inf),simpsum:true;
sum: sum is divergent.
-- an error. To debug this try: debugmode(true);
1.4 conclusion:
➔ 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:
➔ 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:
➔ 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:
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:
➔ sum(2^n,n,1,inf),simpsum:true;
5.4 conclusion:
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:
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:
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
(%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)
(%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
➔ 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)
➔ 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)
➔ 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
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)
➔ 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
➔ 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:
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)
➔ 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
➔ 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)
Conclusion:
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)
➔ 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:
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)
➔ 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
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)
➔ 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
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)
➔ 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
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)
➔ 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
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)
➔ 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
➔ k:makelist(sum(1/i,i,1,n),n,1,100)$
➔ wxplot2d([discrete,k],[style,[points,2,3,2]],[title,"Σ1/n"]);
(%t9)
(%o9)
➔ 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)
➔ 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
➔ 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)
➔ 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)
➔ 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
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)
➔ 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
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)
➔ 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
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)
➔ 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
➔ 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)
➔ 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
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)
➔ 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
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)
➔ 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
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]],[
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]],[
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]],[
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
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
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]);
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)"]);
s2:makelist(sum(1/sqrt(i+1),i,2,n),n,1,700)$
wxplot2d([discrete,s2],[style,[points,2,2,2]]);
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)"]);
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
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)"]);
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
s2:makelist(sum(1/(i·(log(i))),i,2,n),n,1,700)$
wxplot2d([discrete,s2],[style,[points,2,2,2]]);