# Latex Code for Density Function of Normal Distribution

The following is density function of normal distribution. Below includes tutorials showing how to write it as Latex code in Markdown and WordPress.

$f(x)=\frac{1}{\sqrt{2 \pi \sigma^2}}e^{-\frac{1}{2}(\frac{x-\mu}{\sigma})^2}$

## Latex Code for Density Function of Normal Distribution

The following is raw Latex code for the density function for normal distribution.

f(x)=\frac{1}{\sqrt{2 \pi \sigma^2}}e^{-\frac{1}{2}(\frac{x-\mu}{\sigma})^2}

## Latex Code for Density Function of Normal Distribution in Markdown

To show it as the following R Markdown, you can use the following code, namely add the dollar signs.

$$f(x)=\frac{1}{\sqrt{2 \pi \sigma^2}}e^{-\frac{1}{2}(\frac{x-\mu}{\sigma})^2}$$


## Latex Code for Density Function of Normal Distribution in WordPress

To show the normal distribution density function in WordPress (like you see at the beginning of this post), you can use its short code and paste the following to show it.

Note that, the <script>...</script> part only need to be included on a post once, if you have multiple formulas to show.

<script type="text/javascript" async="" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

<p><span class="math display">$f(x)=\frac{1}{\sqrt{2 \pi \sigma^2}}e^{-\frac{1}{2}(\frac{x-\mu}{\sigma})^2}$</span></p>