Skip to main content\(\usepackage{siunitx}
\newcommand{\lrp}[1]{\left(#1\right)}
\newcommand{\lrb}[1]{\left[#1\right]}
\newcommand{\lrbrace}[1]{\left\lbrace#1\right\rbrace}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\dint}{\displaystyle\int}
\newcommand{\defint}[2]{\dint^{#2}_{#1}}
\newcommand{\dlim}[2]{\displaystyle\lim_{#1\rightarrow #2}\,}
\newcommand{\dydx}{\dfrac{dy}{dx}}
\newcommand{\ddx}{\tfrac{d}{dx}}
\newcommand{\dddx}{\dfrac{d}{dx}}
\newcommand{\ifsol}[1]{\ifprintanswers{#1}\fi}
\newcommand{\Nat}{\mathbb{N}}
\newcommand{\Whole}{\mathbb{W}}
\newcommand{\Int}{\mathbb{Z}}
\newcommand{\Rat}{\mathbb{Q}}
\newcommand{\Real}{\mathbb{R}}
\newcommand{\Complex}{\mathbb{C}}
\DeclareMathOperator\arcsinh{arcsinh}
\DeclareMathOperator\arccosh{arccosh}
\DeclareMathOperator\arctanh{arctanh}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\newcommand{\sfrac}[2]{{#1}/{#2}}
\)
Section 10.4 Solving a System of Equations in Multiple Variables
We can also solve a system of equations by placing the various equations in a list (by using curly brackets) inside the
solve() command.
\begin{equation*}
\displaystyle eq1\, := \,x-y=2
\end{equation*}
\begin{equation*}
\displaystyle eq2\, := \,y={x}^{2}-4
\end{equation*}
> solve( {eq1, eq2}, {x, y});
\begin{equation*}
\displaystyle \left\{ x=2,y=0 \right\} ,\, \left\{ x=-1,y=-3 \right\}
\end{equation*}
Example 10.2. Finding the Intersection of Two Functions (Continued).
Using a system of equations, we can complete the example from
Exampleย 10.1 with either a single
solve() or
fsolve() command.
> solve( {y = x*ln(x), y = sin(x)}, {x,y} );
\begin{equation*}
\begin{array}{l}
\left\{ x=RootOf \left( \_Z\,\ln \left( \_Z \right) -\sin \left( \_Z \right) \right) ,\right.\\
\left. y=\sin \left( RootOf \left( \_Z\,\ln \left( \_Z \right)-\sin \left( \_Z \right) \right) \right) \right\}
\end{array}
\end{equation*}
Once again, we may find that fsolve() provides a more useful output.
> fsolve( {y = x*ln(x), y = sin(x)}, {x,y} );
\begin{equation*}
\displaystyle \left\{ x= 1.752677281,y= 0.9835052061 \right\}
\end{equation*}