Mathematica Assignment 2
Mathematica Assignment 2
Q1. (a). Construct a table of values of function f(x) = (x^2+x+2)/(x+1) when x is sufficiently close to 1.
Evaluate the limit of f(x) as x approaches to 1.Sketch the graph of functions together with the
point(1,2) and draw the lines between the point (1,0),(1,2) and (0,2).
In[55]:=
Observation:
The function approaches 2 as x gets closer to 1.This behavior indicates that the function is continu-
ous at x=1, and its limit at this point is well defined.
2
In[57]:= ShowPlot(x ^ 2 + x + 2) / (x + 1), {x, - 2, 2}, PlotRange → {{- 1.5, 1.5}, {- 1, 5}},
PlotStyle → Blue, Thick[0.5], PlotLabel → "Graph of f(x) with points and line",
GraphicsRed, PointSize[Large], Point[{1, 2}], GraphicsBlack, Line[{{1, 0}, {1, 2}, {0, 2}}]
Out[57]=
Graph of f(x) with points and line
5
-1
Observations:
1. The function f(x) is continuous and smooth near x=1,passing through point (1,2).
2. Line between point (1,2) and (0,2) form a horizontal segment on the graph.
Q.1(b). Construct a table of values of function f(x)=5x-3 when x is sufficiently close to 2. Evaluate the
limit of the function together with a limiting point.
3
Observations:
The table displays x-values close to 2 and their corresponding f(x) values,the values of f(x ) approach
close to limit. This verifies the continuity of the function at x=2.
In[59]:= Limit5 x - 3, x → 2
Out[59]=
7
Observations:
Since f(x) is a linear function ,the limit exists and is simply the value of f(x) at x=2. This should return
f(x)=2.
4
40
20
-10 -5 5 10
-20
-40
Observations:
The graph of the function is a straight line since it is a linear function. The point (2,7) is clearly
marked , showing the limiting behavior as x->2.
Q 2. Use table/limit command to find the limit of following functions. Verify your answers by plotting
the graph of the function in the neighbourhood of limit point.
(a). Cos(1/x) as x approaches 0
In[62]:=
Observations:
The limit is indeterminate due to oscillatory nature of Cos(1/x) as x approaches to 0.
5
1.0
0.5
-0.5
-1.0
Observations:
This plot shows that the function oscillates infinitely as x approaches 0.
In[65]:=
Observations:
The limit will be 0.
0.05
20 40 60 80 100
-0.05
Observations:
The plot shows that function approaches 0 as x tends to infinity
a. f(x)=(2x^2+x+5)/(x+1)
In[68]:= Plot2 x ^ 2 + x + 5 (x + 1), 2 x - 1, {x, - 10, 10}, PlotRange → {- 50, 50},
PlotStyle → {{Blue}, {Red, Dashed}}, ExclusionsStyle → Red, Dashed, Thick
Out[68]=
40
20
-10 -5 5 10
-20
-40
Observations:-
1.Vertical Asymptotes:- The vertical asymptote is at x = -1,since the denominator became zero at this
point.
2. Horizontal Asymptotes:- Not applicable
3. Oblique Asymptotes:- y=2x-1
b. (2x^1/2)/(2x+1)
In[70]:= Plot2 x ^ 1 / 2 2 x + 1, 1 / 2, {x, - 10, 10}, PlotRange → {- 10, 10},
PlotStyle → {{Blue}, {Red, Dashed}}, ExclusionsStyle → Red, Dashed, Thick
Out[70]=
10
-10 -5 5 10
-5
-10
Observations:-
1. Horizontal Asymptotes:-y=1/2
2. Vertical Asymptotes:- x=-1/2
3. Oblique Asymptotes:- Not applicable
c. f(x) = (3x^2-2x)/(9x^3+1)
-10 -5 5 10
-2
-4
Observations:-
1. Horizontal Asymptotes:-y=0
8
d. f(x) = (x^2+1)/(x-1)
In[74]:= Plot{(x ^ 2 + 1) / (x - 1), x + 1}, {x, - 10, 10}, PlotRange → {- 20, 20},
PlotStyle → {{Blue}, {Red, Dashed}}, ExclusionsStyle → Red, Dashed, Thick
Out[74]=
20
10
-10 -5 5 10
-10
-20
Observations:-
1. Horizontal Asymptotes: - Not applicable
2. Vertical Asymptotes:- x=1
3. Oblique asymptotes:- y=x+1
e. f(x)= (5x^3+2x^2+3)/x^2
In[75]:= ResourceFunction["Asymptotes"]5 x ^ 3 + 2 x ^ 2 + 3 x ^ 2, x, y
Out[75]=
Vertical → {{y → ∞, x → 0}}, Oblique → y → 2 + 5 x, x → ± ∞
9
In[76]:= Plot5 x ^ 3 + 2 x ^ 2 + 3 (x ^ 2), 5 x + 2, {x, - 10, 10}, PlotRange → {- 100, 100},
PlotStyle → {{Blue}, {Red, Dashed}}, ExclusionsStyle → Red, Dashed, Thick
Out[76]=
100
50
-10 -5 5 10
-50
-100
Observations:-
1. Horizontal Asymptotes:- Not applicable
2. Vertical Asymptotes:- x=0
3. Oblique Asymptotes:- y=5x+2
f. f(x)= tan(x)
In[77]:= ResourceFunction["Asymptotes"][Tan[x], x, y]
Out[77]=
π π π
Vertical → y → ± ∞, x→ - + 2 π 1 , y → ± ∞, x→ + 2 π 1 , y → ± ∞, x→ + π 1
2 2 2
50
-20 -10 10 20
-50
-100
Observations:-
1. Horizontal Asymptotes:- Not applicable
10
g. f(x) = (x-1)/(x^2+1)
-4 -2 2 4
-2
-4
Observations:-
1. Horizontal Asymptotes:- y = 0
2. Vertical Asymptotes:- Not applicable.
3. Oblique Asymptotes:- Not applicable.