1

I have an equation to be written. The equation I expect to have is this one:

My aim

\begin{align}
M &= \left\{
\begin{array}
\sqrt{1+0.6275 \frac{l^2}{Dt} -0.003375 \frac{l^4}{D^2 t^2}} if \frac{l^2}{Dt} \leq 50 \\
0.032 \frac{l^2}{Dt} +3.293 if \frac{l^2}{Dt} > 50 
\end{array} \right.

\end{align}

Instead what I get is this:

My output

I don't understand why. Also, I receive an error message when I run the code:

   missing delimiter (. inserted)

even if I inserted on purpose

\right. to close it. 

What is the problem?

  • Shouldn't the \sqrt be outside of the array? I would also use \text{if} from the amsmath package instead of if. – Christian May 16 '16 at 16:23
  • 1
    Not a case of misreading but of misspelling. – samcarter is at topanswers.xyz May 16 '16 at 16:25
5

You have a big error: you're missing the mandatory argument to array.

However, there are better methods to accomplish what you want.

\documentclass{article}
\usepackage{amsmath,mathtools}

\begin{document}

\begin{equation*}
M =
\begin{dcases}
\sqrt{1+0.6275 \frac{l^2}{Dt} -0.003375 \frac{l^4}{D^2 t^2}} 
  & \text{if } \frac{l^2}{Dt} \leq 50 \\
0.032 \frac{l^2}{Dt} +3.293 & \text{if } \frac{l^2}{Dt} > 50
\end{dcases}
\end{equation*}

\end{document}

enter image description here

Some advice

Don't disregard compilation errors: you get several of them with that code. Don't use align for single equation displays.

  • For the record, there's also dcases* (and all the other variants) which puts the second column in text mode, writing .. & if $\frac{\ell}{Dt} \leq 50$ \\ feels more natural to me. – Manuel May 16 '16 at 20:35
  • 1
    @Manuel But this wouldn't use display style – egreg May 16 '16 at 20:36
  • I thought it would work automatically through some \everymath{\displaystyle}, but if it doesn't, then your solution is better for this particular case. – Manuel May 16 '16 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.