## 9.4.9 Delimiters

Placing brackets around a tall object in maths mode, such as fractions, does not look right if you use normal sized brackets. For example:

$(\frac{1}{1+x})$

results in:

Instead, you can automatically resize the delimiters using the commands:

\left<delimiter>

and

\right<delimiter>

Rewriting the above example:

produces:

Note that you must always have matching \left and \right commands, although the delimiters used may be different. If you want one of the delimiters to be invisible, use a . (full stop) as the delimiter. Available delimiters are shown in Table 9.13. (Note for a vertical bar delimiter it's best to use amsmath's \lvert command instead of | and \lVert instead of \|.) Sometimes using \left and \right doesn't produce the optimal sized delimiters. In which case you can use additional commands provided by the amsmath package shown in Table 9.14.

 ( ) [ ] \{ \} \lvert† \rvert† \lVert† \rVert† \langle \rangle \lfloor \rfloor \lceil \rceil \uparrow \downarrow \Uparrow \Downarrow \updownarrow \Updownarrow / \backslash

 Definitions Example Default Size $( X )$ \bigl \bigr $\bigl( X \bigr)$ \Bigl \Bigr $\Bigl( X \Bigr)$ \biggl \biggr $\bigl( X \biggr)$ \Biggl \Biggr $\Biggl( X \Biggr)$

Example (Vertical Bar Delimiters):

Example (Delimiter with Subscript):

Delimiters can take limits:

Example (Mismatch):

The left and right delimiters don't have to match:

Example (An invisible delimiter):

Every \right must have a matching \left (and vice versa), so use a . (full stop) for an invisible delimiter.

We have now covered enough to reproduce the equation shown in §1. Introduction:

\newcommand*{\pderiv}[2]{\frac{\partial #1}{\partial #2}}
\newcommand*{\e}{\mathrm{e}}

$\pderiv{^2\mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \pderiv{v_i}{\rho_i} \frac{\e^{v_i}}{1-\e^{v_i}} + v_i \frac{\e^{v_i}\pderiv{v_i}{\rho_i}(1-\e^{v_i}) +\e^{2v_i}\pderiv{v_i}{\rho_i}}{(1-\e^{v_i})^2} \right)$

Note:

The above code looks a bit complicated, and there are so many braces that it can be easy to lose track, so here are some ways of making it a little easier to type:

1. Whenever you start a new environment type in the \begin and \end bits first, and then insert whatever goes inside the environment. This ensures that you always have a matching \begin and \end. The same goes for $and$.

2. Whenever you type any braces, always type the opening and closing braces first, and then insert whatever goes in between. This will ensure that your braces always match up.

So keeping these notes in mind, let's try typing in the code in a methodical manner:

1. Start and end the displayed maths mode:

2. We now need a partial derivative. (The command \pderiv is defined as described earlier. Make sure you remember to define it, preferably in the preamble.)

$\pderiv{}{}$

3. Let's do the first argument. This partial derivative is actually a double derivative, which means we need a squared bit on the top along with a calligraphic L:

$\pderiv{}{}$

4. The second argument is the squared bit. This is a nested superscript {z_i^\rho}^2:

$\pderiv{^2 \mathcal{L}}{}$

5. We can do the next partial derivative in the same way. This one is slightly easier to do:

$\pderiv{^2 \mathcalL}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho}$

6. Delimiters also need to occur in pairs, like curly braces and \begin and \end, so let's do them next:

$ \pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \right) $

7. Now we need to do the bits inside the brackets. First of all we have yet another partial derivative:

$ \pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \pderiv{v_i}{\rho_i} \right) $

8. Now we have a fraction following the partial derivative from the previous step. (Make sure you use braces for the exponential bit: \e^{v_i} ( ) is not the same as \e^v_i ( ). The command \e is defined as described earlier. Make sure you define it, preferably in the preamble.)

$ \pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \pderiv{v_i}{\rho_i} \frac{\e^{v_i}}{1-\e^{v_i}} \right) $

9. This is followed by times another fraction:

$ \pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \pderiv{v_i}{\rho_i} \frac{\e^{v_i}}{1-\e^{v_i}} + v_i \frac{}{} \right) $

10. The bottom part of the fraction (the denominator) is easier than the top, so let's do that first:

$\pderiv{^2 \mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \pderiv{v_i}{\rho_i} \frac{\e^{v_i}}{1-\e^{v_i}} + v_i \frac{}{(1-\e^{v_i})^2} \right)$

11. Now for the top part of the fraction (the numerator). To refresh your memory, it should look like:

That's a bit complicated, so let's break it down:

1. The first term is:
\e^{v_i}

2. The next term is another partial derivative:
\pderiv{v_i}{\rho_i}

3. Then we have:
(1-\e^{v_i})

4. Next we have to add on:
+\e^{2v_i}

5. And finally we have:
\pderiv{v_i}{\rho_i}

So the numerator is:

\e^{v_i}\pderiv{v_i}{\rho_i}(1-\e^{v_i})
+ \e^{2v_i}\pderiv{v_i}{\rho_i}


Inserting this into our code:

$\pderiv{^2\mathcal{L}}{{z_i^\rho}^2} = -\pderiv{\rho_i}{z_i^\rho} \left( \pderiv{v_i}{\rho_i} \frac{\e^{v_i}}{1-\e^{v_i}} + v_i \frac{\e^{v_i}\pderiv{v_i}{\rho_i}(1-\e^{v_i}) +\e^{2v_i}\pderiv{v_i}{\rho_i} }{(1-\e^{v_i})^2} \right)$

This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.