Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168695
Image: ubuntu2004

EXAMPLE 2  Solving  a System in Three Variables

Solve:

5x2y4z=35x - 2y - 4z = 3

3x+3y+2z=33x + 3y + 2z = -3

2x+5y+3z=3-2x + 5y + 3z = 3

var('x y z') solve([5*x - 2*y - 4*z == 3, 3*x + 3*y + 2*z == -3, -2*x + 5*y + 3*z == 3], [x, y, z])
var('x y z')
eq1 = 5*x - 2*y - 4*z == 3 eq2 = 3*x + 3*y + 2*z == -3 eq3 = -2*x + 5*y + 3*z == 3
eq4 = eq1 + 2*eq2 eq4
eq5 = -3*eq2 + 2*eq3 eq5
eq6 = eq4 - 4*eq5 eq6
x = -1 y = 15 + 13*x # eq5 z = (3 + 2*x - 5*y)/3 x, y, z
var('x y z') a1, b1, c1, d1 = 1, 0, 1, 3 a2, b2, c2, d2 = 1, 2, -1, 1 a3, b3, c3, d3 = 2, -1, 1, 3
eq1 = a1*x + b1*y + c1*z == d1 eq1
eq2 = a2*x + b2*y + c2*z == d2 eq2
eq3 = a3*x + b3*y + c3*z == d3 eq3
eq4 = c2*eq1 - c1*eq2 eq4
eq5 = c3*eq2 - c2*eq3 eq5
eq6 = eq4/2+eq5 eq6
x = 1 y = 4-3*x z = 3 - 2*x + y x, y, z