## Is my simplification of a product of Gaussian Density Functions Correct

$a_{j} = \sqrt[]{2\pi \sigma^2_{j}}$, $b=-\frac{(x_{ij} - \mu_j)^2}{2\sigma^2_j}$. Though not explicitally written let $\sigma$ and $\mu$ correspond to the appropriate means depending on wether $y_i=1$ or $y_i=0$.
\begin{align*}
f_{XY}(x_i|y) = \ln(\prod_{j=1}^{M}\frac{1}{a_j}e^{b_j}) &= \\
\ln(\frac1{a_1}e^{b_1}\cdot \frac{1}{a_2}e^{b_2} \cdots \frac1{a_M}e^{b_M}) &= \\
\ln(\frac1{a_1}e^{b_1}) + \dots + \ln(\frac1{a_m}e^{b_M}) &= \\
-\ln(a_1) + \ln(e^{b_1}) + \dots + (-\ln(a_m)) + \ln(e^{b_M}) &= \\
\ln(a_1) + \ln(a_2) + \dots \ln(a_M) - (b_1 + b_2 + \dots + b_M) && \text{$\ln$ $e$ are inverse operations} &= \\
\ln(\sqrt[]{2\pi \sigma^2_{1}}) + \dots + \ln(\sqrt[]{2\pi \sigma^2_{M}}) + \frac{(x_{i1} - \mu_1)^2}{2\sigma^2_1} + \dots + \frac{(x_{iM} - \mu_M)^2}{2\sigma^2_M}) && \text{negative distributes over $b$ terms making them positive}
\end{align*}

I am trying to find a formula that is easier for my computer to handle. This is why I want to eliminate the exponenent. Want to see if this is correct however?