Harshit Singh Practical2
Harshit Singh Practical2
Harshit Singh
Q1 Graph each of the functions. Experiment with different domains
or viewpoints to display the best images.
a) y = x/(1+x^2)
In[5]:= Plot[x / (1 + x^2), {x, - 10, 10}]
0.4
0.2
Out[5]=
-10 -5 5 10
-0.2
-0.4
0.4
0.2
Out[3]=
-2 -1 1 2
-0.2
-0.4
2
b) y = x sin(1/x)
In[6]:= Plotx Sin[1 / x], {x, - π , π}
1.0
0.8
0.6
Out[6]= 0.4
0.2
-3 -2 -1 1 2 3
-0.2
0.5
0.4
0.3
0.2
Out[7]=
0.1
-0.1
-0.2
3
c) y = cos(x) +sin(y)
In[10]:= Plot3DCos[x] + Sin[y], {x, - π , π}, y, - 2 π , 2 π
Out[10]=
Out[1]=
4
d) f(x) = x y/(x^2+y^2)
In[11]:= Plot3Dx y / (x ^ 2 + y ^ 2), {x, - 5, 5}, {y, - 10, 10}
Out[11]=
In[24]:= D[f[x]]
D[f[x], {x, 2}]
Out[24]=
x
1 + x2
Out[25]=
4x 8 x2 2
- +x -
1 + x
2 2
1 + x 2 3
1 + x2
2
In[5]:= f '[- 1]
f '[0]
Out[5]= 0
Out[6]= 1
8 x3 6x
Out[7]= -
1 + x2 1 + x2
3 2
Out[8]= 0
1
Out[9]= -
2
b) 471,945,325,930,166,269
In[34]:= FactorInteger[471 945 325 930 166 269]
Out[34]=
{{4211, 1}, {34 589, 1}, {46 747, 1}, {69 313, 1}}
c) 471945325930166281
In[35]:= FactorInteger[471 945 325 930 166 281]
Out[35]=
b) 6^10 mod 11
In[37]:= Mod[6 ^ 10, 11]
Out[37]=
c) 7^20 mod 21
In[38]:= Mod[7 ^ 20, 21]
Out[38]=
d) 7^22 mod 22
In[39]:= Mod[7 ^ 22, 23]
Out[39]=
1
7
Out[12]//MatrixForm=
2 1
1 1
Out[13]//MatrixForm=
3 2
2 1
Out[14]//MatrixForm=
5 3
3 2
Out[15]//MatrixForm=
8 5
5 3
Out[16]//MatrixForm=
13 8
8 5
Out[17]//MatrixForm=
21 13
13 8
Out[18]//MatrixForm=
34 21
21 13
Out[19]//MatrixForm=
55 34
34 21
Out[20]//MatrixForm=
89 55
55 34
2 1
1 1
3 2
2 1
5 3
3 2
8 5
5 3
13 8
8 5
21 13
13 8
34 21
21 13
55 34
34 21
89 55
55 34
{{573 147 844 013 817 084 101, 354 224 848 179 261 915 075},
{354 224 848 179 261 915 075, 218 922 995 834 555 169 026}}
Conclusion : The second element in the first row gives the nth Fibonacci Number in the nth power of M.
c) Find x and y
4x - 3y = 5
6x + 2y = 14
In[36]:= Solve4 x - 3 y ⩵ 5, 6 x + 2 y ⩵ 14, x, y
Out[36]=
{{x → 2, y → 1}}
d) -2x - 2y + 3z + t = 8
-3x + 0y - 6z + t = -19
6x - 8y + 6z + 5t = 47
x + 3y - 3z - t = -9
Find x, y, z, and t.
In[38]:= Solve- 2 x - 2 y + 3 z + t ⩵ 8, - 3 x + 0 y - 6 z + t ⩵ - 19,
{{x → 2, y → 1, z → 3, t → 5}}
250 * E ^ (r) + 300 * E ^ 0.75 * r + 350 * E ^ 0.5 * r + 400 * E ^ 0.25 * r ⩵ 1365, r, 10
Out[39]=
{r → 0.084104}
In[41]:= N[S[2], 5]
N[S[3], 6]
1.5
1.41667
1.41422
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
1.41421
2.
1.75
1.73214
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205
12
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205
1.73205