I need to divide a Gaussian Mixture by it's widest component. When I do this, the exponents of the output end up a mess of terms in need of simplification, but Simplify[]
doesn't do it. How can I make this work?
gauMix[x_, means_, vars_] :=
(1/Length[vars])*Total[(E^-(((x -means)^2)/(2*vars)))/Sqrt[2*Pi*vars]];
means = {-2, 2, 5};
vars = {1, 2, 2};
widest = Flatten[Position[vars, _?(# == Max[vars] &)]];
h[x_, v_] :=
gauMix[x, means, vars + v]/gauMix[x, {Mean[means[[widest]]]},{vars[[Min[widest]]] + v}];
Expand[h[x, v]]
$$\frac{\sqrt{v+2} \exp \left(\frac{\left(x-\frac{7}{2}\right)^2}{2 (v+2)}-\frac{(x+2)^2}{2 (v+1)}\right)}{3 \sqrt{v+1}}+\frac{1}{3} \exp \left(\frac{\left(x-\frac{7}{2}\right)^2}{2 (v+2)}-\frac{(x-5)^2}{2 (v+2)}\right)+\frac{1}{3} \exp \left(\frac{\left(x-\frac{7}{2}\right)^2}{2 (v+2)}-\frac{(x-2)^2}{2 (v+2)}\right)$$
I would like to see, the exponents individually Simplify[]'d and Together[]'d into something like this:
$$\frac{\sqrt{v+2} \exp \left(\frac{-44 v x+33 v-4 x^2-60 x+17}{8 (v+1) (v+2)}\right)}{3 \sqrt{v+1}}+\frac{1}{3} e^{\frac{33-12 x}{8 v+16}}+\frac{1}{3} e^{\frac{3 (4 x-17)}{8 (v+2)}}$$
h[x, v] // Simplify
? $\endgroup$