Look for this session in /home/ceng303/maple/sessions as: ch1_11.mw


Session 1.11 Solving Simple Equations

> restart;

> eq1:=x^2=3; Define equation with one unknown

eq1 := x^2 = 3

> solve(eq1,x); Solve equation for x

3^(1/2), -3^(1/2)

> eq2:=x^3=0.5; Cubic equation should have 3 solutions

eq2 := x^3 = .5

> xs:=solve(eq2,x); All solutions for cubic equation. Note : I is used for sqrt(-1)

xs := -.3968502630-.6873648185*I, -.3968502630+.6873648185*I, .7937005260

> xs[3]; You can pick out one of the solutions with "[" and "]".  This is the real root.

.7937005260

> eqs:={x+3*y=5,2*x-y=3}; Define two equations with two unknowns as a set using { and } to enclose them.

eqs := {x+3*y = 5, 2*x-y = 3}

> solve(eqs,{x,y}); Solve system of equations simultaneously.  note you have to specify what to solve for.

{y = 1, x = 2}

> soln:=solve(eqs); If variable is not specified, Maple V, will select the variable. sometimes that may not be what you want.

soln := {y = 1, x = 2}

> x;y;Note that these variables have not been given values.

x

y

> assign(soln);x;y; The "assign" function makes the result found apply to the variables.

2

1

>