# Complex Mathematical Equation

I have been stuck for hours trying to write this equation in Latex but I just couldn't, can anyone please help me out here. Thanks in advance.

• For one thing, I'd use \exp\Bigl( ... \Bigr) instead of the e^{...} notation for such a big expression. But, is there something in particular you have problem with? Aug 23, 2022 at 13:53
• Please show the tex code you used ... Aug 23, 2022 at 13:57
• @mickep yes, when I try to write second part of the equation using e$^\frac{(...)$^2$}{...$^2\$} it gives me a none sense when I compile. Aug 23, 2022 at 13:58
• As @Mensch writes, show us the code. I mean, I could probably type that equation, but I think it is more instructive if you show what you do. Aug 23, 2022 at 14:00
• I suggest you read an introduction to LaTeX's math mode. See e.g. here: learnlatex.org/en/lesson-10 Aug 23, 2022 at 14:01

This?

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}
$$I_{SERS}(\Delta x) = ue^{\left(\dfrac{(\Delta x - \mu_g)^2}{2\sigma^{2}_{g}} + \dfrac{2L\sigma_{l}}{4\pi(\Delta x - \mu_{l})^2 + \sigma^{2}_{l}} + I_0 \right)}$$

\end{document}


• Yes man, you are a life saver. Thanks a lot! Aug 23, 2022 at 14:07

### Version A

\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{amsmath}
\usepackage{fouriernc}
\begin{document}
$I_{\text{SERS}}\big(\Delta x\big) = u \exp\left[\frac{\big(\Delta x-\mu_g\big)^2}{2\sigma_g^2}+\frac{2L\sigma_l}{4\pi\big(\Delta x-\mu_l\big)^2+\sigma_l^2}+I_0\right]$
\end{document}


### Version B

\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{amsmath}
\usepackage{mathpazo}
\begin{document}
$\ln\left(\frac{I_{\text{SERS}}\big(\Delta x\big)}{u}\right) = \frac{\big(\Delta x-\mu_g\big)^2}{2\sigma_g^2}+\frac{2L\sigma_l}{4\pi\big(\Delta x-\mu_l\big)^2+\sigma_l^2}+I_0$
\end{document}


I add only one improvement in this solution mainly a custom plus operator whose size is adapted to the size of the whole expression, if you decide on display mode and the superscript format (as shown below).

\documentclass{article}
\usepackage{mathtools}

\DeclareMathOperator{\e}{\mathit{e}}
\newcommand{\dplus}{\displaystyle+}

\begin{document}
\begin{equation*}
I_{\mathit{SERS}}(\Delta x) =
u\e^{
\dfrac{(\Delta x - \mu_{g})^2}{2\sigma_{g}^{2}}
\dplus \dfrac{2L\sigma_{l}}{4\pi(\Delta x - \mu_{l})^2 + \sigma_{l}^{2}}
\dplus I_{0}
}
\end{equation*}
\end{document}


Unrelated.
It's probably me but multiple-letter subscript may look slightly better when typeset as roman font via \textup{SERS}, rather then as italics

You need first to be consistent, which the image isn't:

1. In the left hand side we see \Delta x, whereas in the right hand side there's \triangle x.

2. The exponent to \sigma_{g} in the first fraction is staggered, which isn't in the exponent to \sigma_{l} in the second fraction.

Using so long an exponent to “e” makes the formula very difficult to read, it's much better to use “exp”, which means the same thing.

The “SERS” part should be either \mathit or \mathrm, because it's not the product of four quantities. Be consistent.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
I_{\mathit{SERS}}(\Delta x)=
u\exp\biggl(
\frac{(\Delta x-\mu_{g})^{2}}{2\sigma_{g}^{2}}+
\frac{2L\sigma_{l}}{4\pi(\Delta x-\mu_{l})^{2}+\sigma_{l}^{2}}+
I_{0}
\biggr)
\end{equation*}

\end{document}


Just for a comparison, the same with the exponent in different sizes:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{gather}
I_{\mathit{SERS}}(\Delta x)=
u\exp\biggl(
\frac{(\Delta x-\mu_{g})^{2}}{2\sigma_{g}^{2}}+
\frac{2L\sigma_{l}}{4\pi(\Delta x-\mu_{l})^{2}+\sigma_{l}^{2}}+
I_{0}
\biggr)
\\
I_{\mathit{SERS}}(\Delta x)=
ue^{
\frac{(\Delta x-\mu_{g})^{2}}{2\sigma_{g}^{2}}+
\frac{2L\sigma_{l}}{4\pi(\Delta x-\mu_{l})^{2}+\sigma_{l}^{2}}+
I_{0}
}
\\
I_{\mathit{SERS}}(\Delta x)=
ue^{\textstyle
\frac{(\Delta x-\mu_{g})^{2}}{2\sigma_{g}^{2}}+
\frac{2L\sigma_{l}}{4\pi(\Delta x-\mu_{l})^{2}+\sigma_{l}^{2}}+
I_{0}
}
\\
I_{\mathit{SERS}}(\Delta x)=
ue^{\displaystyle
\frac{(\Delta x-\mu_{g})^{2}}{2\sigma_{g}^{2}}+
\frac{2L\sigma_{l}}{4\pi(\Delta x-\mu_{l})^{2}+\sigma_{l}^{2}}+
I_{0}
}
\end{gather}

\end{document}


Comments to the four realizations

1. This is what I suggest.
2. The exponent is too small and difficult to read.
3. The exponent is bigger, but still hard to read.
4. The exponent is too big and doesn't help the reader to correctly parse the equation.