\documentclass[leqno]{article}

%% Created with wxMaxima 19.07.0

\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{iftex}
\ifPDFTeX
  % PDFLaTeX or LaTeX 
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \DeclareUnicodeCharacter{00B5}{\ensuremath{\mu}}
\else
  %  XeLaTeX or LuaLaTeX
  \usepackage{fontspec}
\fi
\usepackage{graphicx}
\usepackage{color}
\usepackage{amsmath}
\usepackage{grffile}
\usepackage{ifthen}
\newsavebox{\picturebox}
\newlength{\pictureboxwidth}
\newlength{\pictureboxheight}
\newcommand{\includeimage}[1]{
    \savebox{\picturebox}{\includegraphics{#1}}
    \settoheight{\pictureboxheight}{\usebox{\picturebox}}
    \settowidth{\pictureboxwidth}{\usebox{\picturebox}}
    \ifthenelse{\lengthtest{\pictureboxwidth > .95\linewidth}}
    {
        \includegraphics[width=.95\linewidth,height=.80\textheight,keepaspectratio]{#1}
    }
    {
        \ifthenelse{\lengthtest{\pictureboxheight>.80\textheight}}
        {
            \includegraphics[width=.95\linewidth,height=.80\textheight,keepaspectratio]{#1}
            
        }
        {
            \includegraphics{#1}
        }
    }
}
\newlength{\thislabelwidth}
\DeclareMathOperator{\abs}{abs}
\usepackage{animate} % This package is required because the wxMaxima configuration option
                      % "Export animations to TeX" was enabled when this file was generated.

\definecolor{labelcolor}{RGB}{100,0,0}

\begin{document}


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bfseries
(\% i1)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
A: matrix([1 -l -s*l\_s,1-l -s*l\_s - Nsl\_S,M*(l\_s + Nl\_S)],[-s*l\_S,-Nsl\_S,M*Nl\_S],[-s*l\_D,-NSl\_D,1-delta + M*Nl\_D + g\_D]);
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{A}
\begin{pmatrix}-{l_s} s-l+1 & -{l_s} s-l-{{\mathit{Nsl}}_S}+1 & M\, \left( {l_s}+{{\mathit{Nl}}_S}\right) \\
-{l_S} s & -{{\mathit{Nsl}}_S} & M\, {{\mathit{Nl}}_S}\\
-{l_D} s & -{{\mathit{NSl}}_D} & {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bfseries
(\% i2)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
invert(A);
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{\% o2} 

\begin{pmatrix}\frac{M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) } & \frac{-\left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) -M\, {{\mathit{NSl}}_D} \left( {l_s}+{{\mathit{Nl}}_S}\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) } & \frac{M\, {{\mathit{Nl}}_S} \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +M\, {{\mathit{Nsl}}_S} \left( {l_s}+{{\mathit{Nl}}_S}\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }\\
\frac{\left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s}{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) } & \frac{\left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  \left( -{l_s} s-l+1\right) +M\, {l_D} \left( {l_s}+{{\mathit{Nl}}_S}\right)  s}{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) } & \frac{-M\, {{\mathit{Nl}}_S} \left( -{l_s} s-l+1\right) -M\, {l_S} \left( {l_s}+{{\mathit{Nl}}_S}\right)  s}{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }\\

\frac{{{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s}{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) } & \frac{{{\mathit{NSl}}_D} \left( -{l_s} s-l+1\right) -{l_D} s\, \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) } & \frac{{l_S} s\, \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) -{{\mathit{Nsl}}_S} \left( -{l_s} s-l+1\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bfseries
(\% i3)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
b: matrix([b1],[b2],[b3]);
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{b}
\begin{pmatrix}\mathit{b1}\\
\mathit{b2}\\
\mathit{b3}\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bfseries
(\% i8)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
x : invert(A).b;
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{x}

\begin{pmatrix}\frac{\mathit{b2}\, \left( -\left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) -M\, {{\mathit{NSl}}_D} \left( {l_s}+{{\mathit{Nl}}_S}\right) \right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }+\frac{\mathit{b3}\, \left( M\, {{\mathit{Nl}}_S} \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +M\, {{\mathit{Nsl}}_S} \left( {l_s}+{{\mathit{Nl}}_S}\right) \right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }+\frac{\mathit{b1}\, \left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }\\


\frac{\mathit{b2}\, \left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  \left( -{l_s} s-l+1\right) +M\, {l_D} \left( {l_s}+{{\mathit{Nl}}_S}\right)  s\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }+\frac{\mathit{b3}\, \left( -M\, {{\mathit{Nl}}_S} \left( -{l_s} s-l+1\right) -M\, {l_S} \left( {l_s}+{{\mathit{Nl}}_S}\right)  s\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }+\frac{\mathit{b1}\, \left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }\\

\frac{\mathit{b3}\, \left( {l_S} s\, \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) -{{\mathit{Nsl}}_S} \left( -{l_s} s-l+1\right) \right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }+\frac{\mathit{b2}\, \left( {{\mathit{NSl}}_D} \left( -{l_s} s-l+1\right) -{l_D} s\, \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) \right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }+\frac{\mathit{b1}\, \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }{\left( \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right)  {l_S} s-M\, {{\mathit{Nl}}_S} {l_D} s\right)  \left( -{l_s} s-l-{{\mathit{Nsl}}_S}+1\right) +\left( M\, {{\mathit{NSl}}_D} {{\mathit{Nl}}_S}-{{\mathit{Nsl}}_S} \left( {g_D}-delta+M\, {{\mathit{Nl}}_D}+1\right) \right)  \left( -{l_s} s-l+1\right) +M\, \left( {l_s}+{{\mathit{Nl}}_S}\right)  \left( {{\mathit{NSl}}_D} {l_S} s-{{\mathit{Nsl}}_S} {l_D} s\right) }\end{pmatrix}\mbox{}
\]
%%%%%%%%%%%%%%%
\end{document}
