\subsection{expand}
\label{labexpand}
\noindent Name: \textbf{expand}\\
\phantom{aaa}expands polynomial subexpressions\\[0.2cm]
\noindent Library name:\\
\verb|   sollya_obj_t sollya_lib_expand(sollya_obj_t)|\\[0.2cm]
\noindent Usage: 
\begin{center}
\textbf{expand}(\emph{function}) : \textsf{function} $\rightarrow$ \textsf{function}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{function} represents a function
\end{itemize}
\noindent Description: \begin{itemize}

\item \textbf{expand}(\emph{function}) expands all polynomial subexpressions in function
   \emph{function} as far as possible. Factors of sums are multiplied out,
   power operators with constant positive integer exponents are replaced
   by multiplications.
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> print(expand(x^3));
x * x * x
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> print(expand((x + 2)^3 + 2 * x));
8 + 12 * x + 6 * x * x + x * x * x + 2 * x
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 3: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> print(expand(exp((x + (x + 3))^5)));
exp(243 + 405 * x + 270 * x * x + 90 * x * x * x + 15 * x * x * x * x + x * x * 
x * x * x + x * 405 + 108 * x * 5 * x + 54 * x * x * 5 * x + 12 * x * x * x * 5 
* x + x * x * x * x * 5 * x + x * x * 270 + 27 * x * x * x * 10 + 9 * x * x * x 
* x * 10 + x * x * x * x * x * 10 + x * x * x * 90 + 6 * x * x * x * x * 10 + x 
* x * x * x * x * 10 + x * x * x * x * 5 * x + 15 * x * x * x * x + x * x * x * 
x * x)
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{dirtysimplify} (\ref{labdirtysimplify}), \textbf{simplify} (\ref{labsimplify}), \textbf{horner} (\ref{labhorner}), \textbf{coeff} (\ref{labcoeff}), \textbf{degree} (\ref{labdegree})
