Generalization of order of the product of elements in an abelian group as follows. Let $(G,*)$ be a group. Let $a_i \in G, |a_i|=n_i, 1 \le i \le m$. Suppose $\gcd(n_i,n_j)=1$ and $a_ia_j=a_ja_i$, for all $i$ and $j$. Let $x=a_1*a_2*\ldots*a_m$. Show that
$|x| = n_1n_2\ldots n_m$.
Attempt:
Here I got so far. Please give me a correction if I make some mistakes.
Write $a*b=ab$.
Let $a_i \in G, |a_i| = n_i$ where $1\le i \le m$. Given that $\gcd(n_i,n_j) = 1$ and
$a_ia_j = a_ja_i$ for all $i$ and $j$.
Let $e_G$ be the identity element in $G$.
Let $P(m)$ be the statement:
The order of $a_1a_2\ldots a_m$ is $n_1n_2\cdots n_m$.
Base Case:
Consider $P(2)$. That is, the order of
$a_1a_2$ is $n_1n_2$. We'll show it now.
Note that $|a_1| = n_1$ and $|a_2|=n_2$.
Let $|a_1a_2| = s$.
To show that $s=n_1n_2$:

*

*$s \mid n_1n_2$:
Notice that
\begin{align*}
(a_1a_2)^{n_1n_2} &= \overset{n_1n_2}{\overbrace{abab \ldots ab}} \\
&= \overset{n_1n_2}{\overbrace{a_1a_1\ldots a_1}}
\overset{n_1n_2}{\overbrace{a_2a_2\ldots a_2}} \\
&= a_1^{n_1n_2}a_2^{n_1n_2} \\
&= (a_1^{n_1})^{n_2}((a_2)^{n_2})^{n_1} \\
&= (e_G)(e_G) \\
&= e_G
\end{align*}
Hence, $s \mid n_1n_2$, as desired.


*$n_1n_2 \mid s$:
Consider that
\begin{align*}
e_G = (a_1a_2)^s &= (a_1a_2)^{sn_1} \\
&= a_1^{sn_1}a_2^{sn_1} \\ 
&= (a_1^{n_1})^sa_2^{sn_1} \\
&= (e_G)a_2^{sn_1} \\
&= a_2^{sn_1}.
\end{align*}
Hence, $n_2 \mid sn_1$. Since
$\gcd(n_1,n_2)=1$, then we must have
$n_2 \mid s$. Similarly, consider
\begin{align*}
e_G = (a_1a_2)^s &= (a_1a_2)^{sn_2} \\
&= a_1^{sn_2}a_2^{sn_2} \\ 
&= a_1^{sn_2}(a_2^{n_2})^s \\
&= a_1^{sn_2}(e_G) \\
&= a_1^{sn_2}.
\end{align*}
Hence, $n_1 \mid sn_2$. Since
$\gcd(n_1,n_2) = 1$, then we must have
$n_1 \mid s$.
Thus, we have $n_1n_2 \mid s$, as desired.
Hence, $s = n_1n_2. \Box$.
Thus, the order of $a_1a_2$ is $n_1n_2$
i.e. $P(2)$ is true.
Inductive Step:
Let $x=a_1a_2\ldots a_k$ and $n=n_1n_2\cdots n_k$.
Assume that $P(k)$ is true. That is, the order of $x$ is $n$.
To show $P(k+1)$ is also true (that is, the order of $xa_{k+1}$ is $nn_{k+1}$.):
Notice that
\begin{align*}
a_1a_2\ldots a_{k+1} &= a_1a_2\ldots a_ka_{k+1} \\
&= (a_1a_2\ldots a_k)a_{k+1} \\
&= xa_{k+1}.
\end{align*}
Now, we apply the same method as in the base case above. Here we go:
Let $|xa_{k+1}| = t$. To show that
$t = nn_{k+1}$:

*

*$t \mid nn_{k+1}$:
Consider that
\begin{align*}
(xa_{k+1})^{nn_{k+1}} &=
\overset{nn_{k+1}}{\overbrace{xa_{k+1}xa_{k+1}\ldots xa_{k+1}}} \\
&= \overset{nn_{k+1}}{\overbrace{xx\ldots x}}\overset{nn_{k+1}}{\overbrace{a_{k+1}a_{k+1}\ldots a_{k+1}}} \\
&= (x^n)^{n_{k+1}}(a_{k+1}^{n_{k+1}})^n
\\
&= (e_G)(e_G) \\
&= e_G.
\end{align*}
Hence, $t \mid nn_{k+1}$, as desired.


*$nn_{k+1} \mid t$:
Consider that
\begin{align*}
e_G = (xa_{k+1})^t &= (xa_{k+1})^{tn} \\
&= x^{tn}a_{k+1}^{tn} \\
&= (x^n)^ta_{k+1}^{tn} \\
&= (e_G)a_{k+1}^{tn} \\
&= a_{k+1}^{tn}.
\end{align*}
Hence, $n_{k+1} \mid tn$.
But, since $\gcd(n,n_{k+1}) = 1$, then we must have $n_{k+1} \mid t$.
Similarly, consider that
\begin{align*}
e_G = (xa_{k+1})^t &= (xa_{k+1})^{tn_{k+1}} \\
&= x^{tn_{k+1}}a_{k+1}^{tn_{k+1}} \\
&= x^{tn_{k+1}}a_{k+1}^{tn_{k+1}} \\
&= x^{tn_{k+1}}(a_{k+1}^{n_{k+1}})^t \\
&= x^{tn_{k+1}}(e_G) \\
&= x^{tn_{k+1}}.
\end{align*}
Hence, $n \mid tn_{k+1}$. Since
$\gcd(n,n_{k+1}) = 1$, then we must have
$n \mid t$.
Thus, we have $nn_{k+1} \mid t$, as desired.
Hence, $nn_{k+1} = t. \Box$.
Thus, the order of $xa_{k+1}$ is
$nn_{k+1}$ i.e. $P(k+1)$ holds.
Therefore, the order of $a_1a_2\ldots a_m$ is $n_1n_2\cdots n_m$ and hence proved. $\Box$
 A: Putting aside whether or not this is an efficient proof of the result or not and a few minor typos this is a correct and carefully carried out proof.
The one part where it might be better to write things slightly differently occurs at the point where you prove $n_1n_2$ divides $s$ (and similarly for the general case).
Your (correct) argument here would be much clearer if you  wrote:-

Assume $ e_G=(a_1a_2)^s $, then $e_G=(a_1a_2)^{sn_1}$ etc.

In other words always make it clear to the reader when you are assuming something.
In terms of efficiency, you realised that you were repeating the same argument when you said "we apply the same method as in the base case above". What you could have done is the following:-

Assume $P(k)$ is true and consider  $a_1a_2\ldots a_{k+1}=(a_1a_2\ldots a_k)a_{k+1}$.


Now $a_1a_2\ldots a_k$  has order $n_1n_2\ldots n_k$ by assumption and $a_{k+1}$ has order $n_{k+1}$. Therefore, by the base case, $a_1a_2\ldots a_{k+1}$ has order $n_1n_2\ldots n_{k+1}$.

Look how much work that has saved!
P.S. I wish many of my students had written out proofs as carefully as this - so don't think my comments mean your work is not good!
