[Tex/LaTex] “Undefined control sequence” error message

errors

While compiling, an error message "Undefined control sequence" for the fourth line below (starting with 1958*e…..). Any idea about the cause?

\begin{equation}
S = \left\{ \begin{array}{rcl}
1280*Q^{0.46}*(1.43-0.26*\log{A}) & \mbox{if} & Q<2 in \\ 
1958*e^{-0.055}*Q*(1.43-0.26*\logA) & \mbox{if} & Q\geq2 in 
\end{array}\right.
\end{equation}

Best Answer

There is a big difference between

\log{A}

(line 3 of your code) and

\logA

(line 4 of your code), but they're both wrong and it should be \log A in both cases.

Actually, \log{A} and \log A produce the same output, but it wouldn't be the same for \log{(A+B) and \log (A+B) (check it).

You should use amsmath and input your equation as

\begin{equation}
S =
\begin{cases}
  1280Q^{0.46}(1.43-0.26\log A) & \text{if $Q<2\,\mathrm{in}$} \\ 
  1958e^{-0.055}Q(1.43-0.26\log A) & \text{if $Q\geq 2\,\mathrm{in}$}
\end{cases}
\end{equation}

(in mathematics, multiplication is very rarely denoted by an asterisk).

Full code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
S =
\begin{cases}
  1280Q^{0.46}(1.43-0.26\log A) & \text{if $Q<2\,\mathrm{in}$} \\
  1958e^{-0.055}Q(1.43-0.26\log A) & \text{if $Q\geq 2\,\mathrm{in}$}
\end{cases}
\end{equation}

\end{document}

enter image description here