Assignment Group 2
Assignment Group 2
NO-01
2
-y 2
Find all relative maxima of the function f(x,y) = xye -x sketch the surface.
n
Sol :
If we try to use Solve to find where the partial derivatives are 0. We will get an error message due to
2
-y 2
the presence of the (non -algebraic ) exponential .However ,since -e -x cannot equal zero , we
can ignore its presence .
2
In[ ]:= d[x_, y_] = ∂{x,2} f[x, y] × ∂{y,2} f[x, y] - ∂{x,y} f[x, y] ;
d[0, 0]
Out[ ]= 0
1 1
In[ ]:= ∂{x,2} f[x, y] /. x ,y
Sqrt[2] Sqrt[2]
2
Out[ ]= -
1 1
Relative maximum at ( , ).
2 2
1 -1
In[ ]:= ∂{x,2} f[x, y] /. x ,y
Sqrt[2] Sqrt[2]
2
Out[ ]=
2 assignment,,,.nb
In[ ]:= Plot3D[f[x, y], {x, - 3, 3}, {y, - 3, 3}, PlotPoints 30,
ViewPoint {1.391, - 3.001, 0.713}, PlotRange All]
Plot3D[f[x, y], {x, - 3, 3}, {y, - 3, 3}, PlotPoints 30,
ViewPoint {0.617, - 3.318, 0.245}, PlotRange All]
Out[ ]=
Out[ ]=
Q.NO-02
Use differentials to approximate e0.1 4.010020 and determine the percentage error of the estimate
.
Soln :
We take advantage of the fact that 0.1 is near 0 and 4.010020 is near 4.
In[ ]:= f[x_, y_] = Exp[x] Sqrt[y];
approximation = f[0, 4] + Dt[f[x, y]] /. {x 0, y 4, Dt[x] 0.1, Dt[y] 0.010020}
Out[ ]= 2.20251
Q.NO-03
Find an equation of the tangent plane to the surface x 2 y- 4 z2 = -7 at the point (-3,1,2).Sketch the
surface and its tangent plane.
Soln :
Out[ ]=
Q.NO-04
Find the points on the sphere x 2 +y 2 +z2 =36 that are closest to and farthest from the point
(1,2,2).
Soln :
The sphere’s equation is x 2 + y 2 + z2 =36
4 assignment,,,.nb
The farthest points closest to are (2,4,4) and farthest to are (-2,-4,-4).
Q.NO-05
A silo is formed above the x - y plane by the intersection of a right circular cylinder of radius 3
and a sphere of radius 5. Compute its volume.
Soln :
The equation of the spherical cap is 25 - r 2 . It will intersect the cylinder when r =
3. The height of the cylinder will be 4.
In[ ]:= cylinder = Graphics3D[Cylinder[{{0, 0, 0}, {0, 0, 4}}, 3]];
cap = RevolutionPlot3D 25 - r2 , {r, 0, 3}, {θ, 0, 2 π};
Show[cylinder, cap, Boxed False, PlotRange {0, 5}]
Out[ ]=
2π 3 25-r2
In[ ]:= volume = r z r θ
0 0 0
122 π
Out[ ]=
3
assignment,,,.nb 5
Q.NO-06
Use the bisection method to find solution accurate to within 10-2 for x 4 - 2 x 3 - 4 x 2 + 4x + 4=0 on
the interval [0,2].
Soln :
2
Out[ ]=
-1 1 2 3
-2
-4
Out[ ]//PaddedForm=
Q.NO-07
Use the Fixed point iteration method to find solution accurate to within 10-4 for x 3 + x 2 -1 = 0 on the
interval [0,1].
Soln :
1.0
0.8
0.6
Out[ ]=
0.4
0.2
Out[ ]//TableForm=
Iteration Approximation Error
1 0.5 0.316497
2 0.816497 0.0745328
3 0.741964 0.0157068
4 0.757671 0.00339293
5 0.754278 0.000729068
6 0.755007 0.000156839
7 0.75485 0.0000337315
Q.NO-08
Find a real root of the equation x 3 + x 2 -1 =0 on the interval [0,1] by using False position method
correct up to six decimal places.
Soln :
0.5
Out[ ]=
0.2 0.4 0.6 0.8 1.0
-0.5
-1.0
8 assignment,,,.nb
Out[ ]//TableForm=
Iteration a b c error
1 0 1 0.5 0.625
2 0.5 1 0.692308 0.188894
3 0.692308 1 0.741194 0.0434413
4 0.741194 1 0.751969 0.00933539
5 0.751969 1 0.754263 0.00197657
6 0.754263 1 0.754748 0.000417179
7 0.754748 1 0.75485 0.0000879919
8 0.75485 1 0.754872 0.0000185567
9 0.754872 1 0.754876 3.91334 × 10-6
10 0.754876 1 0.754877 8.25261 × 10-7
The solution is 0.754877
Q.NO-09
Find a real root of the equation x 3 + x 2 -1 =0 on the interval [0,1] by using Newton Raphson method
correct up to six decimal places.
Soln :
assignment,,,.nb 9
Label[1];
0+1
x0 = ;
2
If[Abs[f '[x0]] 0, {Print["Re-enter a suitable initial point"];
Goto[1];}] ;
10
Out[ ]=
-2 -1 1 2
-5
Out[ ]//PaddedForm=
Q.NO-10
Use Runge method of order four to approximate the solution of the initial value proble-
m y ′ = t 3 t -2y , y(0)=0 , which h=0.2 and compare it with the actual values of y.
10 assignment,,,.nb
Soln :
Q.NO-11
6
Evaluate ∫0 1 1 + x 2 x by using (a) Trapezoidal rule (b) Simpson’s 1/3 rule (c) Simpson’s 3/8 rule
and compare it with the actual values.
Soln :
Trapezoidal Rule
assignment,,,.nb 11
Error= 0.00515093200655
Error= 0.03947423614803
Error= 0.04856681288767
Q.NO-12
Use Gaussian elimination with backward substitution to solve the following linear system x-y+3z=2,
3x-3y+z =1 , x+y = 3.
assignment,,,.nb 13
For[i = 1, i ≤ n - 1, i ++ {p = i;
For[j = i, j ≤ n, j ++, If[a[j, i] ≠ 0, {p = j;
Break[];}]];
If[a[p, i] 0, {Print["No uniqe Solution"];
Exit[];}];
If[p ≠ i, For[k = 1, k ≤ n + 1, k ++, {t = a[i, k];
a[i, k] = a[p, k];
a[p, k] = t;}];];
For[j = i + 1, j ≤ n, j ++, {m[j, i] = a[j, i] / a[i, i];
For[k = 1, k ≤ n + 1, k ++,
a[j, k] = a[j, k] - m[j, i] * a[i, k]];}];}];
If[a[n, n] 0, {Print["No unique solution"];
Exit[];}];
x[n] = a[n, n + 1] / a[n, n];
n
Fori = n - 1, i ≥ 1, i --, x[i] = a[i, n + 1] - a[i, k] * x[k] a[i, j];;
k=i+1
13
Out[ ]= - , 9, 8
2