\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
 \ensuremath{\longrightarrow}  
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
/* F[i] := F0(x(i)) */n*sum(integrate((i/n-u)\^{}2, u, F[i], F[i+1]), i, 0, n) ; /* Origen */1/(12*n) + sum(((2*i-1)/(2*n)-F[i])\^{}2, i, 1, n) ; /* Destino */
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{\% o1} 
n\, \sum_{i=0}^{n}{\left. \frac{{{F}_{i+1}^{3}}\, {{n}^{2}}-3 i\, {{F}_{i+1}^{2}} n+3 {{i}^{2}}\, {F_{i+1}}}{3 {{n}^{2}}}-\frac{{{F}_{i}^{3}}\, {{n}^{2}}-3 i\, {{F}_{i}^{2}} n+3 {{i}^{2}}\, {F_i}}{3 {{n}^{2}}}\right.}\mbox{}\]

\[\tag{\% o2} 
\frac{1}{12 n}+\sum_{i=1}^{n}{\left. {{\left( \frac{2 i-1}{2 n}-{F_i}\right) }^{2}}\right.}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bfseries
 \ensuremath{\longrightarrow}  
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
define (sumandoO(i), integrate((i/n-u)\^{}2, u, F[i], F[i+1])) \$sumandoFiO : n*subst ([F[i-1] = 0, F[i+1] = 0], ratsimp(sumandoO(i-1) + sumandoO(i))) ; /* sumando asociado a F[i] */define (sumandoD(i), ((2*i-1)/(2*n)-F[i])\^{}2) \$sumandoFiD : expand (sumandoD(i)) \$sinFi(x) := freeof (F[i], x) \$conFi(x) := not sinFi(x) \$filtrar (suma, predicado) := apply ("+", sublist (maplist (identity, suma), predicado)) \$sumandoConFi : filtrar (sumandoFiD, conFi) ;is (factor(sumandoFiO) = factor(sumandoConFi)) ; /* los sumandos en F[i] coinciden */
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{sumandoFiO}
\frac{3 {{F}_{i}^{2}} n+\left( 3-6 i\right) \, {F_i}}{3 n}\mbox{}\]

\[\tag{sumandoConFi}
-\frac{2 i\, {F_i}}{n}+\frac{{F_i}}{n}+{{F}_{i}^{2}}\mbox{}\]

\[\tag{\% o11} 
\mbox{true}\mbox{}
\]
%%%%%%%%%%%%%%%


\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bfseries
 \ensuremath{\longrightarrow}  
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
define (sumandoSinFi(i), filtrar (sumandoFiD, sinFi)) \$TIorigen : ratsimp (nusum (sumandoSinFi(i), i, 1, n) + 1/(12*n)); /* término independiente en Destino */F[0] : 0 \$F[n+1] : 1 \$sinF(x) := freeof (F, x) \$TIdestino : filtrar (expand (n*sumandoO(n)), sinF) ;is (TIorigen = TIdestino) ; /* los términos independientes coinciden */
\end{minipage}
%%% OUTPUT:
\[\displaystyle \tag{TIorigen}
\frac{n}{3}\mbox{}\]

\[\tag{TIdestino}
\frac{n}{3}\mbox{}\]

\[\tag{\% o18} 
\mbox{true}\mbox{}
\]
%%%%%%%%%%%%%%%
\end{document}
