productivity tools

I would define some macros to handle the parts of the code that don't change.

Here's an example of something you can do:

\documentclass{article}
\usepackage{amsmath,amssymb}

\makeatletter

%% user macro translated into internal control sequence
%% to test whether short or long form.
\newcommand\intU{\ae@intU}
%% short form is flagged by a `*` immediately following
%% the control sequence.
\def\ae@intU{%%
  \@ifstar{\ae@intU@short}
          {\ae@intU@long}}

\def\ae@intU@short#1(#2){U^{(#2)}_{#1}}
%% There are three different forms the integral can take in the        
%% long form.  By testing on the first argument, we can determine      
%% which integral form to use.  This could have been handled using     
%% \ifcase.  I chose not to use \ifcase because it only works          
%% on numbers.  If you have integrals somehow indexed by some of token 
%% then this approach *should* work.                                   
\def\ae@intU@long#1(#2)_#3^#4{%%
  \if#11\ae@intUa{#2}{#3}{#4}\fi
  \if#12\ae@intUb{#2}{#3}{#4}\fi
  \if#13\ae@intUc{#2}{#3}{#4}\fi}

%% #1 superscript (<num>)
%% #2 lower bound of integration
%% #3 upper bound of integration
\def\ae@intUa#1#2#3{  \int_{#2}^{#3} \int_{0}^{\sigma_{rr}^{(#1)}} \Big(\frac{(1+\nu)(\sigma_{rr}^{(#1)})}{E#1} - \frac{\nu (2(\sigma_{rr}^{(#1)})+ \sigma_{z})}{E#1} \Big) d(\sigma_{rr}^{(#1)}) r dr dz }
\def\ae@intUb#1#2#3{  \int_{#2}^{#3} \int_{0}^{\sigma_{rz}^{(#1)}} (1+\nu)\frac{(\sigma_{rz}^{(#1)})}{E#1} d(\sigma_{rz}^{(#1)}) r dr dz  }
\def\ae@intUc#1#2#3{  \int_{#2}^{#3} \int_{0}^{\sigma_{zz}^{(#1)}} \Big(\frac{(1+\nu)\sigma_{zz}^{(#1)}}{2E#1} -  \frac{\nu ((\sigma_{zz}^{(#1)})+ 2\sigma_{rr}^{(#1)})}{2 E#1} \Big) d(\sigma_{zz}^{(#1)}) r dr dz }

\makeatother

\begin{document}

\begin{equation}
  \begin{aligned}
    Energy^{(i)} & =  \intU*1(i) + \intU*2(i) + \intU*3(i) \\
    \intU*1(1)   & = \intU1(1)_{a}^{b}                     \\
    \intU*2(1)   & = \intU2(1)_{a}^{b}                     \\
    \intU*3(1)   & = \intU3(1)_{a}^{b}                     \\
    %
    % End of 1
    %
    \intU*1(2)   & = \intU1(2)_{b}^{c}                     \\
    \intU*2(2)   & = \intU2(2)_{b}^{c}                     \\
    \intU*3(2)   & = \intU3(2)_{b}^{c}                     \\
  \end{aligned}
\end{equation}

\end{document}

enter image description here

Since the integrands change and I don't really know what all of this is about, there could be a better way to write this, but I think the above example conveys the general idea.

I'm using a few TeX tricks here. At a minimum I'm trying to let the syntax of command sequence match what's needed: the superscripting with (<num>) and the bounds of integration.