[Tex/LaTex] Increase the space between numerator and denominator

fractions

I have created two fractions (see example below), but the denominator is a little too close to the division bar. Can I change this somehow?

\documentclass{article}
\usepackage{amsmath}

\begin{document}
    Combining two Gaussians with mean $\mu_1, \mu_2$ and variance $\sigma_1^2, \sigma_2^2$ yields a new Gaussian with mean $\mu = \frac{\sigma_2^2 \mu_1 + \sigma_1^2 \mu_2}{\sigma_1^2 + \sigma_2^2}$ and variance $\sigma^2 = \frac{1}{\frac{1}{\sigma_1^2} + \frac{1}{\sigma_2^2}}$
\end{document}

Best Answer

You have two main options:

  • Switch from \frac{...}{...}-notation to inline-fraction notation

  • Switch to display math to typeset the formulas for \mu and \sigma^2.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for "\text" macro
\begin{document}

\noindent
1. OP's original version:

Combining two Gaussians with mean $\mu_1, \mu_2$ and variance $\sigma_1^2, \sigma_2^2$ yields a new Gaussian with mean $\mu = \frac{\sigma_2^2 \mu_1 + \sigma_1^2 \mu_2}{\sigma_1^2 + \sigma_2^2}$ and variance $\sigma^2 = \frac{1}{\frac{1}{\sigma_1^2} + \frac{1}{\sigma_2^2}}$.

\medskip\noindent
2. Partial switch to inline-math notation

Combining two Gaussians with mean $\mu_1, \mu_2$ and variance 
$\sigma_1^2, \sigma_2^2$ yields a new Gaussian with mean 
$\mu = \frac{\sigma_2^2 \mu_1 + \sigma_1^2 \mu_2}{\sigma_1^2 + \sigma_2^2}$ 
and variance $\sigma^2 = \frac{1}{1/\sigma_1^2 + 1/\sigma_2^2}$.

\medskip\noindent
3. Full switch to inline math notation

Combining two Gaussians with means $\mu_1$ and $\mu_2$ and 
variances $\sigma_1^2$ and $\sigma_2^2$ yields a new Gaussian 
with mean $\mu = (\sigma_2^2 \mu_1 + \sigma_1^2 \mu_2)/(\sigma_1^2 + 
\sigma_2^2)$ and variance $\sigma^2 = 1/(1/\sigma_1^2 + 1/\sigma_2^2)$.

\medskip\noindent
4. Switch to display math

Combining two Gaussians with means $\mu_1$ and $\mu_2$ and 
variances $\sigma_1^2$ and $\sigma_2^2$ yields a new Gaussian 
with mean $\mu$ and variance $\sigma^2$ given by
\[
\mu=\frac{\sigma_2^2 \mu_1 + \sigma_1^2 \mu_2}{\sigma_1^2 + \sigma_2^2} 
\quad\text{and}\quad 
\sigma^2 = \frac{1}{1/\sigma_1^2 + 1/\sigma_2^2}\,.
\]

\end{document}