0% found this document useful (0 votes)
23 views20 pages

Mathematica Assignment No. 3

The document discusses solving problems related to roots of polynomials, partial fraction decomposition, trigonometric identities, distance between points, equations of lines and circles. Various Mathematica commands are used to calculate sums, products, coefficients, greatest common divisors, least common multiples and plots.
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)
23 views20 pages

Mathematica Assignment No. 3

The document discusses solving problems related to roots of polynomials, partial fraction decomposition, trigonometric identities, distance between points, equations of lines and circles. Various Mathematica commands are used to calculate sums, products, coefficients, greatest common divisors, least common multiples and plots.
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/ 20

Question 1

(a)

In[ ]:= P[x_] := x6 - 21 x5 + 175 x4 - 735 x3 + 1624 x2 - 1764 x + 720


solutions = Solve[P[x]  0, x]
Out[ ]= {{x  1}, {x  2}, {x  3}, {x  4}, {x  5}, {x  6}}

In[ ]:= list = x /. solutions


Out[ ]= {1, 2, 3, 4, 5, 6}

The sum of the roots of P(x) is,


In[ ]:= Sum[list〚k〛, {k, 1, 6}]
Out[ ]= 21

The product of the roots of P(x) is,


In[ ]:= Product[list〚k〛, {k, 1, 6}]
Out[ ]= 720

Thus, the results are verified.


Sum of the squares of the roots is,

In[ ]:= Sumlist2 〚k〛, {k, 1, 6}


Out[ ]= 91

Sum of the reciprocal of the squares of the roots is,


1
In[ ]:= Sum 〚k〛, {k, 1, 6}
list2
5369
Out[ ]=
3600

(b)

In[ ]:= f[x_] := x3 - 6 x2 + 11 x - 6


solutions1 = Solve[f[x]  0, x]
Out[ ]= {{x  1}, {x  2}, {x  3}}

In[ ]:= list1 = x /. solutions1


Out[ ]= {1, 2, 3}

The sum of the roots of f(x) is,


2 Mathematica Assignment No. 3 B200302063.nb

In[ ]:= Sum[list1〚k〛, {k, 1, 3}]


Out[ ]= 6

The product of the roots of f(x) is,


In[ ]:= Product[list1〚k〛, {k, 1, 3}]
Out[ ]= 6

(c)

In[ ]:= f[x_] := x5 - 3 x4 - 24 x3 + 95 x2 - 46 x - 101


rootsoffunction = NSolve[f[x]  0, x, Reals];
list = x /. rootsoffunction;
Print["Upper limit of roots ", Max[list]]
Print["Lower limit of roots ", Min[list]]
Upper limit of roots 4.32951

Lower limit of roots -5.23566

(d)

In[ ]:= Plot5 Cos[x] - 4 + x3 , {x, - 1, 2}


2

Out[ ]= -1.0 -0.5 0.5 1.0 1.5 2.0

-1

-2

It appears that there are three solutions near -0.6, 0.8 & 1.6. So, the roots of the equation are,

In[ ]:= FindRoot5 Cos[x] - 4 + x3 , {x, - 0.6}


FindRoot5 Cos[x] - 4 + x3 , {x, 0.8}
FindRoot5 Cos[x] - 4 + x3 , {x, 1.6}
Out[ ]= {x  - 0.576574}

Out[ ]= {x  0.797323}

Out[ ]= {x  1.61805}
Mathematica Assignment No. 3 B200302063.nb 3

(e)
1
In[ ]:= SolveSin[x]  , x
2
π 5π
Out[ ]= x  + 2 π 1 if 1 ∈  , x  + 2 π 1 if 1 ∈  
6 6

1
In[ ]:= SolveSin[x]  , x
2

π 3π
Out[ ]= x  + 2 π 1 if 1 ∈  , x  + 2 π 1 if 1 ∈  
4 4

Question 2
(a)
The partial fraction expansion is,
(x - 1)4
In[ ]:= Apart 
x2 + 1 (x + 1)2 (x - 4)
81 8 32 2 (- 1 + 4 x)
Out[ ]= - + -
425 (- 4 + x) 5 (1 + x)2 25 (1 + x) 17 1 + x2 

(x - 1)4
In[ ]:= ExpandNumeratorExpandDenominator 
x2 + 1 (x + 1)2 (x - 4)

1 - 4 x + 6 x 2 - 4 x 3 + x4
Out[ ]=
- 4 - 7 x - 6 x 2 - 6 x 3 - 2 x 4 + x5

(b)
Coefficients of a,

In[ ]:= CoefficientList(a + b)5 , a 

Out[ ]= b5 , 5 b4 , 10 b3 , 10 b2 , 5 b, 1

Coefficients of b,

In[ ]:= CoefficientList(a + b)5 , b 

Out[ ]= a5 , 5 a4 , 10 a3 , 10 a2 , 5 a, 1
4 Mathematica Assignment No. 3 B200302063.nb

In[ ]:= Coefficient(x + y + z)6 , x y2 z3 


Out[ ]= 60

(c)

In[ ]:= p = 2 x4 - 15 x3 + 39 x2 - 40 x + 12;


q = 4 x4 - 24 x3 + 45 x2 - 29 x + 6;

In[ ]:= a = PolynomialGCD[p, q]


Out[ ]= - 6 + 17 x - 11 x2 + 2 x3

In[ ]:= b = PolynomialLCM[p, q]


Out[ ]= (- 2 + x) 6 - 29 x + 45 x2 - 24 x3 + 4 x4 

Now,
In[ ]:= Expand[a * b]  Expand[p * q]
Out[ ]= True

Thus, ab = pq

(d)
In[ ]:= trigtable = TableTrigReduceSin[x]n , TrigReduceCos[x]n , {n, 3, 8};
TableFormtrigtable, TableAlignments  Left,
TableHeadings  None, " sinn (x)", " cosn (x)"
Out[ ]//TableForm=

sinn (x) cosn (x)


1 1
(3 Sin[x] - Sin[3 x]) (3 Cos[x] + Cos[3 x])
4 4
1 1
(3 - 4 Cos[2 x] + Cos[4 x]) (3 + 4 Cos[2 x] + Cos[4 x])
8 8
1 1
(10 Sin[x] - 5 Sin[3 x] + Sin[5 x]) (10 Cos[x] + 5 Cos[3 x] + Cos[5 x])
16 16
1 1
(10 - 15 Cos[2 x] + 6 Cos[4 x] - Cos[6 x]) (10 + 15 Cos[2 x] + 6 Cos[4 x] + Cos[6
32 32
1 1
(35 Sin[x] - 21 Sin[3 x] + 7 Sin[5 x] - Sin[7 x]) (35 Cos[x] + 21 Cos[3 x] + 7 Cos[5 x]
64 64
1 1
(35 - 56 Cos[2 x] + 28 Cos[4 x] - 8 Cos[6 x] + Cos[8 x]) (35 + 56 Cos[2 x] + 28 Cos[4 x] + 8 Cos
128 128

Question 3
(a)

In[ ]:= f[x1_, x2_, y1_, y2_] := (x1 - x2)2 + (y1 - y2)2

Distance between the points (-1, 3) and (4, 2) is,


Mathematica Assignment No. 3 B200302063.nb 5

In[ ]:= f[- 1, 4, 3, 2]


Out[ ]= 26

(b)
(y1 - y2)
In[ ]:= p[x1_, x2_, y1_, y2_] := y1 + (x - x1)
x1 - x2
In[ ]:= line = y  Expand[p[- 1, 4, 3, 2]]
14 x
Out[ ]= y -
5 5

Thus, equation of the line is x+5y-14 = 0. Let the equation of straight line perpendicular to this line
In[ ]:= l[x_, y_] := 5 x - y + k  0

If this line passes through  32 , 5


2
) then the value of k is,

3 5
In[ ]:= l , 
2 2
Out[ ]= 5+k  0

The value of k is -5. Thus the line perpendicular to x+5y-14 = 0 is 5x-y-5 = 0


14 - x
In[ ]:= Plot , 5 x - 5, {x, - 5, 10}, AspectRatio  Automatic, PlotRange  {- 5, 10}
5
10

Out[ ]=
2

-4 -2 2 4 6 8 10

-2

-4

Which confirms that the lines are indeed perpendicular.


6 Mathematica Assignment No. 3 B200302063.nb

Question 4
(a)
Let equation of the circle

In[ ]:= p[x_, y_] := x2 + y2 + 2 g x + 2 f y + c  0

If the circle passes through (1, 4), (2, 7), (4, 11) we get three equations to solve for g, f and c.
In[ ]:= p[1, 4]
p[2, 7]
p[4, 11]
Out[ ]= 17 + c + 8 f + 2 g  0

Out[ ]= 53 + c + 14 f + 4 g  0

Out[ ]= 137 + c + 22 f + 8 g  0

Solving the three equations for g, f ,c;


In[ ]:= Solve[{17 + c + 8 f + 2 g  0, 53 + c + 14 f + 4 g  0, 137 + c + 22 f + 8 g  0}, {g, f, c}]
Out[ ]= {{g  - 27, f  3, c  13}}

Thus, the equation of the circle is;


In[ ]:= p[x, y] /. {g  - 27, f  3, c  13} // TraditionalForm
Out[ ]//TraditionalForm=

x2 - 54 x + y2 + 6 y + 13  0

The centre of the circle is (27,-3)


& we know;
In[ ]:= g = - 27; f = 3; c = 13;

In[ ]:= radiusofcircle = g 2 + f2 - c

Out[ ]= 5 29

So the radius is 5 29
Equation of tangent of the given circle is,
In[ ]:= x1 = 1; y1 = 4;
q[x_, y_] = x x1 + y y1 + g (x + x1) + f (y + y1) + c  0 // Simplify
Out[ ]= 2 + 26 x  7 y

Thus, equation of the tangent to the circle at point (1, 4) is


26x-7y+2=0
Mathematica Assignment No. 3 B200302063.nb 7

In[ ]:= g1 = ContourPlotx 2 - 54 x + y2 + 6 y + 13  0, {x, - 10, 60},


{y, - 35, 30}, AspectRatio  Automatic, Frame  False, Axes  True;
26 x + 2
g2 = Plot , {x, - 10, 10};
7
Show[g1, g2]
30

20

10

Out[ ]= -10 10 20 30 40 50 60

-10

-20

-30

(b)
The given circles are
x2 + y2 = 4
x2 + y2 - 2 x - 4 y + 4 = 0
Let, The equation of the circle going through the intersection point of the two above circles;

In[ ]:= p[x_, y_] = x2 + y2 - 4 + k x2 + y2 - 2 x - 4 y + 4  0 // Factor

Out[ ]= - 4 + 4 k - 2 k x + x 2 + k x2 - 4 k y + y 2 + k y2  0

Which transforms into


2k 4k 4k-4
In[ ]:= intersectingcircle = x2 + y2 - x- y+ 0
k+1 k+1 k+1
-4 + 4 k 2kx 4ky
Out[ ]= - + x2 - + y2  0
1+k 1+k 1+k

k 2 2k 2
Center of the circle is  k+k1 , 2k
k +1
) and radius is -
k +1
 + -
k +1
 -
4 k -4
k +1

If the circle touches the line x+2y=0, then the distance between the line and the center of the circle will
be equal to the radius of the circle. Hence,
8 Mathematica Assignment No. 3 B200302063.nb

k 2k
1 +2 k 2
2k 2
4k-4
k+1 k+1
In[ ]:= valueofk =  - + - - ;
1 2 + 22 k+1 k+1 k+1

Solve[valueofk, k]
Out[ ]= {{k  1}}

Putting the value of k the equation becomes,


In[ ]:= intersectingcircle /. k  1 // TraditionalForm
Out[ ]//TraditionalForm=

x2 - x + y2 - 2 y  0

This is the equation of the circle passing through the intersection points of the two given circles.

In[ ]:= g3 = ContourPlotx2 - x + y2 - 2 y  0, {x, - 1, 2},


{y, - 1, 2.5}, AspectRatio  Automatic, Axes  True, Frame  False;
-x
g4 = Plot , {x, - 5, 5};
2
Show[g3, g4]
2.5

2.0

1.5

1.0
Out[ ]=

0.5

-1.0 -0.5 0.5 1.0 1.5 2.0

-0.5

-1.0

Question 5
The general equation of 2nd degree is
ax2 + 2 hxy + by2 +2gx+2fy+c = 0
The given equation is
x 2 - 5 xy + 4 y 2 + x + 2 y - 2 = 0
Comparing the two equations we get
Mathematica Assignment No. 3 B200302063.nb 9

In[ ]:= a = 1;
-5
h= ;
2
b = 4;
1
g= ;
2
f = 1;
c = - 2;
a h g
If the equation represents a pair of straight lines then, Det h b f =0
g f c

ahg
In[ ]:= Det h b f 
gfc
Out[ ]= 0

Thus, the equation represents a pair of straight lines.(Showed)


To find the point of intersection of the two lines, let,

In[ ]:= f[x1_, y1_] := x12 - 5 x1 y1 + 4 y12 + x1 + 2 y1 - 2  0

Differentiating with respect to x1 and y1 we get,


In[ ]:= D[f[x1, y1], x1]
D[f[x1, y1], y1]
Out[ ]= 1 + 2 x1 - 5 y1  0

Out[ ]= 2 - 5 x1 + 8 y1  0

Solving for x1 and y1;


In[ ]:= Solve[{1 + 2 x1 - 5 y1  0, 2 - 5 x1 + 8 y1  0}, {x1, y1}]
Out[ ]= {{x1  2, y1  1}}

Thus, the intersection point of the two lines is (2, 1)

Angle between the two straight lines is,

2 h2 - a b
In[ ]:= anglebetweenlines = ArcTan 
a+b
3
Out[ ]= ArcTan 
5

In[ ]:= p[x_, y_] := x2 - 5 x y + 4 y2 + x + 2 y - 2


Solve[p[x, y]  0, x]
Out[ ]= {{x  1 + y}, {x  2 (- 1 + 2 y)}}

Thus, the equation of the two straight lines are x-y-1 = 0 & x-4y+2 = 0
10 Mathematica Assignment No. 3 B200302063.nb

on the y-axis, x = 0; y = -1 & 12 . Thus, the vertices of the triangle are (2, 1), (0, -1), 0, 1
2
).

2 1 1
1
In[ ]:= trianglearea = Abs Det 0 - 1 1 
2 0
1
1
2

3
Out[ ]=
2

So, area of the triangle is 32 sq. Units

We have to transform the given equation into one where the terms with x, y and xy is absent. We got the
intersection point of the two lines which is (2,1).
So, Transferring the origin to the point (2, 1). Then putting x = x1+2 and y = y1+1 in
x 2 - 5 xy + 4 y 2 + x + 2 y - 2 = 0 we get;

In[ ]:= x2 - 5 x y + 4 y2 + x + 2 y - 2  0 /. {x  x1 + 2, y  y1 + 1} // Simplify


Out[ ]= x12 + 4 y12  5 x1 y1

Equation transforms to x 2 - 5 xy + 4 y 2 = 0 [Drop the suffixes]


Let the axes be rotated bu an angle θ. Then we know,
1 2h
In[ ]:= θ= ArcTan 
2 a-b
1 5
Out[ ]= ArcTan 
2 3

Then, putting x=x1cosθ-y1sinθ and y=x1sinθ+y1cosθ we get;

In[ ]:= x2 - 5 x y + 4 y2  0 /. {x  x1 Cos[θ] - y1 Sin[θ], y  x1 Sin[θ] + y1 Cos[θ]} // Simplify


Out[ ]= - 5 + 34  x12  5 + 34  y12

Thus, The equation reduces to  34 - 5 x 2 -  34 + 5 y 2 =0 in which there is no term involving x,y and
xy.
Sketching the equation we get;
Mathematica Assignment No. 3 B200302063.nb 11

In[ ]:= ContourPlotx2 - 5 x y + 4 y2 + x + 2 y - 2  0, {x, - 5, 11},


{y, - 5, 5}, Frame  False, Axes  True, AspectRatio  Automatic

Out[ ]=
-5 5 10

-2

-4

Question 6
General equation of second degree is ax^2 + 2 hxy + by2 +2gx+2fy+c=0
Δ = abc + 2 fgh - af2 - bg2 - ch2
General equation of second degree will represent
(i) two straight line if Δ=0;
(ii)a circle if a=b and h=0;
(iii) a parabola if ab = h2 and Δ≠0;
(iv)an ellipse if ab - h2 <0 and Δ≠0;
(v)a hyperbola if ab - h2 >0 and Δ≠0;
Given the Equation,

In[1]:= f[x_, y_] := 4 x2 + 12 x y + 9 y2 + 3 x + y + 2  0


Comparing the given equation and general equation of second drgree we get,

In[ ]:= a = 4; b = 9; h = 6; g = 3 / 2; f = 1 / 2; c = 2;

In[ ]:= Δ = a b c + 2 f g h - a f 2 - b g2 - c h2
49
Out[ ]= -
4

So, Δ ≠ 0

In[ ]:= a b - h2
Out[ ]= 0

i . e . ab = h2
12 Mathematica Assignment No. 3 B200302063.nb

So, we can say the given equation represents a parabola .


Reduction to standard form of the given parabola:

In[11]:= Reduce4 x2 + 12 x y + 9 y2 + 3 x + y + 2  0, {x, y}


1 1
Out[11]= y - 1 - - 71 - 84 x - 12 x || y  - 1 + - 71 - 84 x - 12 x
18 18

Question 7
(a)
Equation of the plane through the given points;
x y z 1
2 3 1 1
In[ ]:= Det   0 // Simplify
1 1 3 1
2 2 3 1
Out[ ]= 3+2x  2y+z

Thus, equation of the required plane is 2x-2y-z+3 = 0


Perpendicular distance from the point (5, 6, 7) to the plane 2x-2y-z+3 = 0 is,
2*5-2*6-1*7+3
In[ ]:= perpdistance = Abs 
22 + (- 2)2 + (- 1)2
Out[ ]= 2

Now plotting the plane we get,


In[ ]:= Plot3D[2 x - 2 y + 3, {x, - 30, 10}, {y, 0, 10}, AxesLabel  {"x", "y", "z"},
PlotRange  {- 100, 30}, PlotLabel  "Equation of plane 2x-2y-z+3 = 0"]

Out[ ]=

(b)
Given,
Equation of the planes are
Mathematica Assignment No. 3 B200302063.nb 13

6x-8y+10z = 0
3x-4y+5z-7 = 0
Let,
In[ ]:= a1 = 6 ; b1 = - 8 ; c1 = 10;
a2 = 3 ; b2 = - 4; c2 = 5;

Now, the angle between the planes is,


a1 a2 + b1 b2 + c1 c2
In[ ]:= planeangle = ArcCos 
a12 + b12 + c12 a22 + b22 + c22
Out[ ]= 0

As the angle between the planes is 0, the planes are parallel to each other.
Given,
Equation of the planes are,
6x-8y+10z = 0 which transform into
3x-4y+5z= 0
3x-4y+5z-7 = 0

The perpendicular distance between the two planes is,


let,
In[ ]:= A = 3; B = - 4; c = 5; D1 = 0; D2 = - 7;

D1 - D2
In[ ]:= planedistance = Abs 
A 2 + B2 + c2
7
Out[ ]=
5 2

(c)
Given,
Equation of the planes are
3x-4y+5z = 0
2x-y-2z = 0
Let,
In[ ]:= a1 = 3; b1 = - 4; c1 = 5;
a2 = 2 ; b2 = - 1; c2 = - 2;

Angle between the planes are,


14 Mathematica Assignment No. 3 B200302063.nb

a1 a2 + b1 b2 + c1 c2
In[ ]:= planeangle1 = ArcCos 
a12 + b12 + c12 a22 + b22 + c22
π
Out[ ]=
2

Thus, the planes are perpendicular to each other.


In[ ]:= Plot3D[{3 x - 4 y, 2 x - y}, {x, - 5, 5}, {y, - 5, 5}, AspectRatio  Automatic,
AxesLabel  {"x", "y", "z"}, PlotRange  {- 40, 40}, PlotLabel  "Two Intersecting Planes"]

Out[ ]=

(d)
In[ ]:= Given the equation
line1 = x + 2 y + 3 z - 3 = 0---- - (1)
line2 = 2 x + y - z + 5 = 0------ (2)
line3 = 5 x + 3 y + 6 z + 5 = 0---- - (3)
find the intersection point of (1) and (2)
In[ ]:= p = Solve[x + 2 y + 3 z - 3  2 x + y - z + 5, {x, z}]

Solve: Equations may not give solutions for all "solve" variables.

x 8-y
Out[ ]= z  + 
4 4

x 8-y
In[ ]:= line1 /. z  +
4 4
Out[ ]= - 1 + 0 -- --
Mathematica Assignment No. 3 B200302063.nb 15

Question 8
The given lines are
x -3 y -8 z -3
3
=
-1
=
1
-----------1
x +3 y +7 z -6
-3
=
2
=
4
-----------2
dr’s of line 1 (3, -1, 1)
dr’s of line 2 (-3, 2, 4)
let the dr’s of S.D is (a, b, c)
let,
In[ ]:= a1 = 3 ; b1 = - 1 ; c1 = 1;
a2 = - 3 ; b2 = 2; c2 = 4;

Which are the dr’s of line 1 and line 2


The Shortest Distance(S.D) is perpendicular to both lines. Thus;
We obtain,
In[ ]:= a a1 + b b1 + c c1  0
a a2 + b b2 + c c2  0
Out[ ]= 3a-b+c  0

Out[ ]= -3 a + 2 b + 4 c  0

Solving the two equations,


a b c
In[ ]:=   k
b1 c2 - b2 c1 a2 c1 - a1 c2 a1 b2 - a2 b1
a b c
Out[ ]= - -  k
6 15 3

We get, the dr’s of S.D (a, b, c) = (-6,15,3)


In[ ]:= a = - 6; b = - 15; c = 3;

Let the dc’s of S.D (l, m, n)


16 Mathematica Assignment No. 3 B200302063.nb

a
In[ ]:= l=
a 2 + b2 + c2
b
m=
a 2 + b2 + c2
c
n=
a 2 + b2 + c2

2
Out[ ]= -
15

5
Out[ ]= -
6
1
Out[ ]=
30

Thus, dc’s of S.D (l, m, n) = (- 2


15
,-
5
6
,
1
)
30

A point on line 1 is (x1 ,y1, z1) ≡ (3, 8, 3)


A point on line 2 is (x2 ,y2, z2) ≡ (-3, -7, 6)
In[ ]:= x1 = 3; y1 = 8; z1 = 3;
x2 = - 3; y2 = - 7; z2 = 6;

The Shortest distance between line 1 and line 2 is


In[ ]:= shortestdistance = Abs[l (x1 - x2) + m (y1 - y2) + n (z1 - z2)]

3 6 15
Out[ ]= +2 +5
10 5 2

Equation of the Shortest Distance is,


x - x1 y - y1 z - z1 x - x2 y - y2 z - z2
In[ ]:= Det 3 -1 1   0  Det -3 2 4  // TraditionalForm
-6 - 15 3 -6 - 15 3
Out[ ]//TraditionalForm=

12 x - 15 y - 51 z + 237  0  66 x - 15 y + 57 z - 249

We know,
Equation of the Plane containing line 1 and Shortest Distance is,
12 x-15 y-51 z+237  0
Equation of the Plane containing line 2 and Shortest Distance is,
66 x-15 y+57 z-249 = 0
Let, z=0; the two equation becomes;
12 x - 15 y + 237  0
66 x - 15 y - 249  0
Mathematica Assignment No. 3 B200302063.nb 17

Solving the two equations we get,


In[12]:= Solve[{12 x - 15 y + 237  0, 66 x - 15 y - 249  0}, {x, y}]
Out[12]= {{x  9, y  23}}

So, a point on S.D is S(9,23,0).


Thus, the equation of S.D is ;
x-9 y - 23 z
= =
-6 - 15 3
Now, let,
x-9 y - 23 z
= = =r
-6 - 15 3
x = -6 r + 9
y = - 15 r + 23
z = 3r

If (x, y, z) lies on line 1. then,


x-3
In[29]:= /. x  - 6 r + 9
3
y-8
/. y  - 15 r + 23
-1
1
Out[29]= (6 - 6 r)
3
Out[30]= - 15 + 15 r

1
In[31]:= Solve (6 - 6 r)  - 15 + 15 r, r
3
Out[31]= {{r  1}}

Thus, S.D meets line 1 in (3, 8, 3)


Again,
If (x, y, z) lies on line 1. then,
x+3
In[32]:= /. x  - 6 r + 9
-3
y+7
/. y  - 15 r + 23
2
1
Out[32]= (- 12 + 6 r)
3
1
Out[33]= (30 - 15 r)
2
18 Mathematica Assignment No. 3 B200302063.nb

1 1
In[34]:= Solve (- 12 + 6 r)  (30 - 15 r), r
3 2
Out[34]= {{r  2}}

Thus, S.D meets line 2 in (-3, -7, 6)


Conclusion: S.D meets line 1 in (3, 8, 3) and S.D meets line 2 in (-3, -7, 6)

Question 9
(a)
Let the equation of the sphere,

In[ ]:= sphere = x2 + y2 + z2 + 2 u x + 2 v y + 2 w z + d  0;

If the sphere goes through the given points, then the equation of the sphere become,
In[ ]:= equations = sphere /.
{{x  4, y  - 1, z  2}, {x  0, y  - 2, z  3}, {x  1, y  - 5, z  - 1}, {x  2, y  0, z  1}}
Out[ ]= {21 + d + 8 u - 2 v + 4 w  0, 13 + d - 4 v + 6 w  0, 27 + d + 2 u - 10 v - 2 w  0, 5 + d + 4 u + 2 w  0}

In[ ]:= Solve[{21 + d + 8 u - 2 v + 4 w  0,


13 + d - 4 v + 6 w  0, 27 + d + 2 u - 10 v - 2 w  0, 5 + d + 4 u + 2 w  0}]
Out[ ]= {{d  5, u  - 2, v  3, w  - 1}}

Equation of the sphere is,


In[ ]:= sphere /. {d  5, u  - 2, v  3, w  - 1} // TraditionalForm
Out[ ]//TraditionalForm=

x2 - 4 x + y2 + 6 y + z 2 - 2 z + 5  0

Graph of the sphere,


Mathematica Assignment No. 3 B200302063.nb 19

In[ ]:= RegionPlot3Dx2 - 4 x + y2 + 6 y + z2 - 2 z + 5, {x, - 3, 7}, {y, - 9, 3}, {z, - 5, 6}

Out[ ]=

(b)
Let the equation of the sphere having its centre on (d,e,f) and radius r,

In[ ]:= c[x_, y_, z_] := (x - d)2 + (y - e)2 + (z - f)2  r2

If the sphere passes through (4, 1, 0), (2, -3, 4) & (1, 0, 0) and if the sphere touches the plane 2x+3y-z = 11
then the equation becomes
In[ ]:= c[4, 1, 0]
c[2, - 3, 4]
c[1, 0, 0]
(2 d + 3 e - f - 11)
r
22 + 32 + (- 1)2

Out[ ]= (4 - d)2 + (1 - e)2 + f2  r2

Out[ ]= (2 - d)2 + (- 3 - e)2 + (4 - f)2  r2

Out[ ]= (1 - d)2 + e2 + f2  r2

- 11 + 2 d + 3 e - f
Out[ ]= r
14

In[ ]:= Solve(4 - d)2 + (1 - e)2 + f2  (2 - d)2 + (- 3 - e)2 + (4 - f)2 


3 d
Out[ ]= f  + + e
2 2

In[ ]:= Solve(2 - d)2 + (- 3 - e)2 + (4 - f)2  (1 - d)2 + e2 + f2 


7 d 3e
Out[ ]= f  - + 
2 4 4
20 Mathematica Assignment No. 3 B200302063.nb

In[ ]:= Solve(4 - d)2 + (1 - e)2 + f2  (1 - d)2 + e2 + f2 


Out[ ]= {{e  8 - 3 d}}

3 d
In[ ]:= f + + e /. {e  8 - 3 d}
2 2
7 d 3e
f - + /. {e  8 - 3 d}
2 4 4
19 5 d
Out[ ]= f -
2 2
7 3 d
Out[ ]= f + (8 - 3 d) -
2 4 4

19 5d 7 3 d
In[ ]:= Solve -  + (8 - 3 d) - , d
2 2 2 4 4
Out[ ]= {{}}

Conclusion: There exists no solution for the center of the sphere.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy