Anda di halaman 1dari 5

Complete SAT Guide 2010, 13th edition

Gary R. Gruber, Ph.D., p25, #5


Edward Bujak
If x + y = 7 and x y = 4, then find the value of x2 + y2

Solve@x + y Š 7, yD

88y ® 7 - x<<

Solve @x y == 4, yD

::y ® >>
4
x

>, 8x, - 10, 10<F


4
PlotB:7 - x,
x

20

10

-10 -5 5 10

-10

There are 2 intersections (solutions).

solutions = Solve@
8x + y == 7,
x y == 4<,
8x, y<
D

::x ® K7 - 33 O, y ® K7 + 33 O>, :x ® K7 + 33 O, y ® K7 - 33 O>>


1 1 1 1
2 2 2 2

Note that there are 2 solutions:


Solution 1: Hx1 , y1 )
and
Solution 2: Hx2 , y2 )
2 p0025.n05.Mathematica.nb

Note that there are 2 solutions:


Solution 1: Hx1 , y1 )
and
Solution 2: Hx2 , y2 )

You can also treat these functions implicitly:


Plot@8
Evaluate@y . Solve@x + y == 7, yDD,
Evaluate@y . Solve@x y == 4, yDD
<, 8x, - 10, 10<D

20

10

-10 -5 5 10

-10
p0025.n05.Mathematica.nb 3

The above Rules (such as x® and y®) need to be parsed to extract the values.
/. is the "Replace All" Operator expr /. rules
Clear @x, yD;

8x, x ^ 2, y, z< . x ® george

9george, george2 , y, z=
4 p0025.n05.Mathematica.nb

Solution 1:

set1 = solutions@@1DD

:x ® K7 - 33 O, y ® K7 + 33 O>
1 1
2 2

x1 = x . set1

K7 - 33 O
1
2

N@x1D

0.627719

y1 = y . set1

K7 + 33 O
1
2

N@y1D

6.37228

solution1 = x12 + y12

K7 - 33 O + K7 + 33 O
1 2 1 2

4 4

N@solution1D

41.
p0025.n05.Mathematica.nb 5

Solution 2:

set2 = solutions@@2DD

:x ® K7 + 33 O, y ® K7 - 33 O>
1 1
2 2

x2 = x . set2

K7 + 33 O
1
2

N@x2D

6.37228

y2 = y . set2

K7 - 33 O
1
2

N@y2D

0.627719

solution2 = x22 + y22

K7 - 33 O + K7 + 33 O
1 2 1 2

4 4

N@solution2D

41.

Anda mungkin juga menyukai