I have a LaTeX project with the following line:
$$f\left(S_0e^{\left(r-\frac{1}{2}\sigma^2\right)T + \sigma \sqrt{T} x\right)},$$
Without this line, the compilation is ok. With it, there are two errors:
Missing } inserted. ...gma^2\right)T + \sigma \sqrt{T} x\right)}
and immediately after:
Extra }, or forgotten $. ...gma^2\right)T + \sigma \sqrt{T} x\right)}
both for the same, already mentioned line. It seams to me that the compiler inserts a '}' character, and then immediatelly after that it complains about that. Have you ever encountered such a problem?
Your expression starts with a
(
followed by a{
; it ends with a)
, followed by a}
.So when the closing
)
is seen, a}
is expected, and one is added, so everything balances. But there is still that trailing}
, which generates the second error (arguably caused by LaTeX itself).