Section 3.2 Solving Systems of Equations
In this case, the first argument to
solve
is a list of equations. Next, we specify the variables to solve for.Observe that Sage returns a nested list structure. The outer list contains all possible solutions to the system (in this case, there is only one solution). Each solution is represented as an inner list of equations showing the value of each variable.
Since each equation defines implicitly a function, we can use
implicit_plot
to graph each equation in 2D-space.We can also plot a point whose coordinates are the ones given in the solution.
Now the full plot with the equations, the solution, and a legend.
We can solve a system of three equations with three variables.
We can plot the equations in 3D-space using
implicit_plot3d
.Let’s add some color to the plot so we can distinguish the equations.
The following is an example of a system with infinitely many solutions. We can express the general solution as a function of a parameter.