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

math-modemath-operatorssymbols

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:
enter image description here

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:
enter image description here

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.

Best Answer

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} 

enter image description here

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}

enter image description here