3

I want to display something like:

enter image description here

My current attempt is :

\begin{equation}
Z=min E \int_{0}^{\infty} exp(-\rho t)\{ \alpha^2[r(t)-x(t)]^2+[\lambda ^ {-1}\frac{\dd{x(t)}}{\dd{t}}]^2 \} \dd{t}
\end{equation}

I have defined a macro dd above as (this uses physics package):

\newcommand{\dd}[1]{\mathrm{d}#1}

How should I go about doing this? I am okay with using any other packages if they allow to display this better.

Karup
  • 217
  • 1
    What is the difference between what you have and what you want ? – Jérôme Dequeker Dec 15 '15 at 14:01
  • @JérômeDequeker Right now on compiling this nothing gets displayed. It's as if this entire equation block isn't there! Everything else and other equation gets displayed. I don't understand what am I doing wrong here. Edit I forgot closing $ above so not getting displayed issue is resolved. :) – Karup Dec 15 '15 at 14:04
  • is the fact that the equation is split onto two lines important to you? (none of the answers so far address that.) – barbara beeton Dec 15 '15 at 14:10
  • A better definition for \dd is \newcommand{\dd}[1]{\mathop{}\!\mathrm{d}#1}. I'd use an italic “d”, but that's personal preference by a mathematician. ;-) This definition avoids the need of preceding the differential with \,. – egreg Dec 15 '15 at 14:11
  • @barbarabeeton Not really. Anyway doesn't a simple \\\ before + solve that? @egreg Thanks for that! – Karup Dec 15 '15 at 14:13
  • 1
    the equation environment by itself only allows a single line. if you need more than one line, a different (either separate, e.g. align, or a subenvironment, e.g. split) must be used. and in that case, there are restrictions on how \left and \right can be used. take a look at Brackets in two different align “lines” – barbara beeton Dec 15 '15 at 14:25

2 Answers2

5

You need to replace min and exp with \min and \exp, respectively. To autosize the curly braces and square brackets, prefix them with \left in the case of { and [ and with \right in the case of } and ].

enter image description here

\documentclass{article}
\usepackage{amsmath}
\newcommand{\dd}[1]{\mathrm{d}#1}
\begin{document}
\begin{equation}
Z=\min E \int_{0}^{\infty} \exp(-\rho t)\left\{ \alpha^2[r(t)-x(t)]^2+
  \left[\lambda ^ {-1}\frac{\dd{x(t)}}{\dd{t}}\right]^2 \right\} \dd{t}
\end{equation}
\end{document}

If you prefer to have the curly braces have the same vertical size as the square brackets, it's preferable to use explicit sizing instructions -- here, \biggl and \biggr, respectively:

Z=\min E \int_{0}^{\infty} \exp(-\rho t)\biggl\{ \alpha^2[r(t)-x(t)]^2+
  \biggl[\lambda ^ {-1}\frac{\dd{x(t)}}{\dd{t}}\biggr]^2 \biggr\} \,\dd{t}
Mico
  • 506,678
3

if you refer to parenthesis height you can use \left and \right to get it automatically

\begin{equation}
Z=\min E \int_{0}^{\infty} exp(-\rho t)\left\{ \alpha^2\left[r(t)-x(t)\right]^2+\left[\lambda ^ {-1}\frac{\dd{x(t)}}{\dd{t}}\right]^2 \right\}  \dd{t}
\end{equation}