# [Tex/LaTex] How to write Exponential distribution in overleaf

casesmath-mode

I am new to overleaf and having trouble in writing an exponential distribution function in overleaf.

Use cases (or dcases), and although I prefer writing exp, if you insist on using e ensure it is an upright letter, as its a number, not a variable, so use \mathrm{e}.
\documentclass{article}
$$f_X(x) = \begin{cases} \lambda \exp(-\lambda x) & x > 0 \\ 0 & \text{otherwise.} \end{cases}$$
$$f_X(x) = \begin{dcases} \lambda \mathrm{e}^{-\lambda x} & x > 0 \\ 0 & \text{otherwise.} \end{dcases}$$