Chapter 1 - An Introduction to Mathematica

Section 1.6 - Solving Systems of Equations

PolyN=35 (x^3)+4;

soln=Solve[PolyN==0,x]

approxsolns=N[soln,25]

PolyN/.%

xsolns=x/.approxsolns

Q = 5 (x^3)−7 (x^2)+I x−4 I

soln=Solve[Q==0,x]

approxsolns=N[soln,15]

Q/.approxsolns

xsolns=x/.approxsolns

Chop[Expand[5 (x-xsolns[[1]]) (x-xsolns[[2]]) (x-xsolns[[3]])]]

Eqn1=5 x+3 y==-4;Eqn2=-7 x+2 y==6;

Soln=Solve[{Eqn1,Eqn2},{x,y}]

{Eqn1,Eqn2}/.Soln

approxsolns=N[Soln,10]

{xsolns,ysolns}={x,y}/.Flatten[approxsolns]

ContourPlot[{5 x+3 y==−4,−7 x+2 y==6,(((x−xsolns))^2)+(((y−ysolns))^2)==(1/16)},{x,-5,5},{y,-5,5},ContourStyle->{Directive[Red,Thick],Directive[Blue,Thick],Directive[Black,Thick]}]

{Eqn1,Eqn2}={(((x−7))^2)+(((y−2))^2)==25,(((x−1))^2)+(((y−5))^2)==16};

Soln=Solve[{Eqn1,Eqn2},{x,y}]

approxsolns=N[Soln]

solns={x,y}/.approxsolns

{IntersPt1,IntersPt2}={solns[[1]],solns[[2]]};

ContourPlot[{(((x−7))^2)+(((y−2))^2)==25,(((x−1))^2)+(((y−5))^2)==16,(((x−IntersPt1[[1]]))^2)+(((y−IntersPt1[[2]]))^2)==(1/8),(((x−IntersPt2[[1]]))^2)+(((y−IntersPt2[[2]]))^2)==(1/8)},{x,-5,15},{y,-5,15},ContourStyle->{Directive[Red,Thick],Directive[Blue,Thick],Directive[Black,Thick],Directive[Black,Thick]}]

Eqns={(((x−7))^2)+(((y−2))^2)==25,(((x+2))^2)+(((y−5))^2)==16};

Soln=Solve[Eqns,{x,y}]

N[Soln]