# Creating a product integration symbol which behaves as the standard integration symbol

Context. The product integral is the continuous analogue of the ordinary (Riemann, Lebesgue, Denjoy, Perron etc...) integral and was introduced by Vito Volterra in 1887 in order to provide a compact functional way to express the solution to the Cauchy problem for systems of ordinary differential equations. The interested reader can have a look to this book by Antonín Slavík, Product integration, its history and applications, Matfyzpress 2007.
In the ordinary practice (also in the reference cited above), the product integral is represented as the ordinary "uppercase \Pi" by the standard command \prod in a fashion similar to what one obtains by using the code

\prod_0^t (1+r(s))^{\operatorname{d}s}


Nevertheless, from the logical and clarity viewpoint this is somewhat unsatisfactory: why should we use the same symbol for the product of finite or infinite discrete terms even for the product of infinite "infinitesimal" terms?
For the ordinary integral we know that this limit operation leads from the summation symbol \sum to the \int symbol, is a sort of script-style uppercase "S".

The problem to be solved. My idea is to define a \pint command which prints a sort of script-style uppercase "P" and behaves exactly as the \int symbol. Precisely

1. \pint should be the standard command,
2. the expression following the command should be graphically centred respect to the height of the symbol (as it happens for the standard \int symbol),
3. \pint\limits should be the command use to put the product integration limits above and below the \pint symbol,
4. the script-style "P" could be made by using something like \mathscr{P} or by using an .svg or other vector kind of image obtained by modifying the standard \int symbol.

Some experiments aimed at obtaining the sought-for graphical result. I've managed to produce something of this sort by using the following preamble code declarations

\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{stix}
\newcommand{\dm}{\mathrm{d}}


Then, in order to obtain a "standard style" \pint I defined the following command

% Definition of Volterra's product integral, standard style.
\DeclareMathOperator{\pint}{{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathscr{P}}}}}}}


which, invoked in the body of the document as \pint_{\!\!\!\!\!\!0}^{t}(1+r(s))^{\dm s}, produces the following graphical output:

After that, in order to obtain an \int\limits flavour command I defined the following

% Definition of Volterra's product integral, \limits style.
\DeclareMathOperator*{\pint}{{\mathlarger{\mathlarger{\mathlarger{\mathlarger{\mathscr{P}}}}}}}


which, invoked in the body of the document as \pint_{\!\!\!\!\!\!0}^{\quad t}(1+r(s))^{\dm s}, produces the following graphical output:

While the graphical flavour obtained is similar to the one desired, the solutions presented are somewhat unsatisfactory respect to the first tree of the above points, i.e.

1. invoking the \pint command is not sufficient in order to have the subscripts and superscripts correctly placed, since you have to tweak their position by "bare hands", and
2. the expression is not graphically centred respect to the \pint symbol, and finally
3. in oder to obtain the \pint\limits behaviour I have to completely redefine the command.
• Welcome to the TeX. SE. community :-). Ciao. Jan 11 at 19:11
• Ciao @Sebastiano. Happy new year. Jan 11 at 19:14
• What about a \Pi symbol upon the \int one? Jan 11 at 20:13
• @projetmbc it may be interesting. Could you elaborate an answer or give a reference? Jan 11 at 20:15

Here's my proposal

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx,mathrsfs}

\makeatletter
\NewDocumentCommand{\pint}{t\limits e{_^}}{%
\DOTSI\pint@{#1}{#2}{#3}%
}
\NewDocumentCommand{\pint@}{mmm}{%
\mathop{%
\IfBooleanTF{#1}{\pint@limits}{\pint@nolimits}{#2}{#3}%
}%
}

\NewDocumentCommand{\pint@limits}{mm}{%
\mathpalette\pint@@limits{{#1}{#2}}%
}
\NewDocumentCommand{\pint@@limits}{mm}{%
\pint@@@limits#1#2%
}
\NewDocumentCommand{\pint@@@limits}{mmm}{%
\mathop{\vcenter{
\sbox\z@{\raisebox{\depth}{$\m@th#1\int$}}%
\hbox{\resizebox{!}{0.95\ht\z@}{$\m@th\mathscr{P}$}\vphantom{\box\z@}}%
}}\limits\IfValueT{#2}{_{#2}}\IfValueT{#3}{^{\mspace{\if@display18\else9\fi mu}#3}}%
}

\NewDocumentCommand{\pint@nolimits}{mm}{%
\mathpalette\pint@@nolimits{{#1}{#2}}%
}
\NewDocumentCommand{\pint@@nolimits}{mm}{%
\pint@@@nolimits#1#2%
}
\NewDocumentCommand{\pint@@@nolimits}{mmm}{%
\vcenter{
\sbox\z@{\raisebox{\depth}{$\m@th#1\int$}}%
\hbox{\resizebox{!}{0.95\ht\z@}{$\m@th\mathscr{P}$}\vphantom{\box\z@}}%
}\IfValueT{#2}{_{\mspace{-\if@display24\else12\fi mu}#2}}\IfValueT{#3}{^{#3}}%
}

\makeatother

\begin{document}

$\pint_a^b \int_a^b \pint\limits_a^b \int\limits_a^b$
\begin{center}
$\pint_a^b \int_a^b \pint\limits_a^b \int\limits_a^b$
\end{center}

\end{document}


I would like to mention the prodint package. With a little twist, though.

\documentclass{article}
\usepackage{amsmath}
\usepackage{prodint}

\makeatletter
\newcommand\pint{\DOTSI\if@display\PRODI\else\prodi\fi\ilimits@}
\makeatother

\begin{document}

$\pint_a^b \int_a^b \pint\limits_a^b \int\limits_a^b$
\begin{center}
$\pint_a^b \int_a^b \pint\limits_a^b \int\limits_a^b$
\end{center}

\end{document}


• I have tried your first solution and it worked perfectly in my document. One last supplementary question: if I want to use a custom drawn symbol instead of $\mathscr{P}$, is it simply sufficient to insert its import command instead of the character one? Jan 13 at 13:32
• @DanieleTampieri Maybe. It depends on what you're trying to insert. Jan 13 at 13:35
• maybe an .svg picture produced by generating the \int symbol in an Inkscape sheet and then modifying it in order to resemble a stylized pi. Jan 13 at 13:38
• @DanieleTampieri You need to try. Actually, there's space for improvement in the code. Keep testing. Jan 13 at 14:09

A direct adaptation of my answer at How are big operators defined?. Here, \foo gives a larger symbol in \displaystyle, as does \int, whereas \barr retains the size of the symbol associated with \textstyle, even in display math.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\DeclareMathOperator*{\foo}{\scalerel*{\mathscr{P}}{\sum}}
\DeclareMathOperator*{\barr}{\scalerel*{\mathscr{P}}{\textstyle\sum}}
\usepackage{mathrsfs}
\usepackage{scalerel}

\begin{document}
$\foo_{i=3}^{6}(f^2(i))$

This is inline: $$\foo_{i=3}^{6}(f^2(i))$$

$\barr_{i=3}^{6}(f^2(i))$

This is inline: $$\barr_{i=3}^{6}(f^2(i))$$
\end{document}


Mico notes that \barr should not be used in either of the script styles, which is true. If that usage were to be necessary, then \barr could instead be defined as

\DeclareMathOperator*{\barr}{\scalerel*{\mathscr{P}}{\mathchoice
{\textstyle\sum}{\sum}{\sum}{\sum}}}


In the above MWE, the "P" is scaled to the same size as \sum. If you would prefer it scaled to the size of \int, just replace \sum with \int in each of the \DeclareMathOperators and the result looks like:

• +1. You may want to add an explicit warning that \barr shouldn't be used in \scriptstyle, let alone \scriptscriptstyle, surroundings. Of course, this caveat should be obvious for anyone who actually looks at the code.
– Mico
Jan 11 at 19:15
• +1 Steven. Your approach fulfills requirements 1 and 2 and at least seems capable to fulfill requirement 3. I'll wait a bit but, if there aren't other answers I'll accept your as the answer. Thank you very much Jan 11 at 19:20
• Just out of idle curiosity: Would there be anything wrong with defining \barr via \DeclareMathOperator*{\barr}{{\textstyle\foo}}?
– Mico
Jan 11 at 19:21
• @Mico While it may work, I would not recommend it, from an efficiency point of view. It would be nesting \mathops and worse still, nesting \scalerels. Jan 11 at 19:43
• @Mico As to the warning, I have added one, as well as a workaround. See my edit. Jan 11 at 19:57

Imo, the functional (single letter) notation for the integral is simple and more economical than the integral symbol, it can explicitly show (instead of hiding it in often unused dx) the integrating variable if needed, and it doesn't depend on the dimension. The notation also needs to be easily usable when writing in class on a board. So a simple \DeclareMathOperator*{\pint}{\mathbf{P}} should do the job, but in the example, below a font is used with a longer neck for distinction, and it still can be easily replicated in handwriting.

\documentclass{article}
\usepackage{amsmath}
\usepackage{scalerel}

% for longer neck letters but don't use them by default
\usepackage[nodefault,typeone]{drm}

%
\newcommand{\drm}[1]{{\fontfamily{drm}\selectfont #1}}

% Longer neck P
\DeclareMathOperator*{\pint}{\textrm{\drm{P}}}

% Longer neck P large operator
\DeclareMathOperator*{\Pint}{\scalerel*{\textrm{\drm{P}}}{\int}}
\begin{document}

\begin{tabular}{ll}
$\pint_a^b(1+r(s))$
& $\displaystyle \pint_a^b(1+r(s))$\\[1cm]
$\pint_{s \in [a,b]}(1+r(s))$
& $\displaystyle \pint_{s \in [a,b]}(1+r(s))$\\[1cm]
$\pint_{(s,t) \in [a,b]\times[c,d]}(1+r(s,t))$
& $\displaystyle \pint_{(s,t) \in [a,b]\times[c,d]}(1+r(s,t))$\\[1cm]
$\pint_{s^2+t^2=1}(1+r(s,t))$
& $\displaystyle \pint_{s^2+t^2=1}(1+r(s,t))$\\[1cm]
$\Pint_{s^2+t^2=1}(1+r(s,t))$
& $\displaystyle \Pint_{s^2+t^2=1}(1+r(s,t))$
\end{tabular}

\end{document}


• Btw, Computer Modern Dunhill cmdh (tug.org/FontCatalogue/computermoderndunhillroman) is available if one wishes to have a computer modern matching uppercase P with a longer neck. Jan 17 at 4:22
• For this purpose, you are right, @ApoorvPotnis, cmdh or lmdh would be better. They do not have bold face versions, while that's what I use in my papers for some single letter operators. Jan 17 at 5:47