# Square bracket math mode

I need to change the two braces to two square brackets that are surrounding cos and sin in both equations.

\documentclass[oneside,10pt]{memoir}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{siunitx}

\newcommand*{\bfrac}[2]{\genfrac{\lbrace}{\rbrace}{0pt}{}{#1}{#2}}

\begin{document}
$$\Psi(r,\phi) = \begin{cases} \frac{A}{J_l (U)} J_l(\frac{U \cdot r}{a}) \bfrac{\cos(l\phi)}{\sin(l\phi)}; & r < a \\ \\ \frac{A}{K_l (U)} K_l(\frac{W \cdot r}{a})\bfrac{\cos(l\phi)}{\sin(l\phi)}; & r > a \end{cases}$$
\end{document}

• You were near: the command form is \lbrack and \rbrack Jan 12, 2018 at 13:02

You only need to modify your \bfrac command.

\documentclass[oneside,10pt]{memoir}
\usepackage[T1]{fontenc}

\usepackage{amsmath}
\usepackage{siunitx}

\newcommand*{\bfrac}[2]{\genfrac{\lbrace}{\rbrace}{0pt}{}{#1}{#2}}
\newcommand*{\Bfrac}[2]{\genfrac{[}{]}{0pt}{}{#1}{#2}}

\begin{document}
$$\Psi(r,\phi) = \begin{cases} \frac{A}{J_l (U)} J_l(\frac{U \cdot r}{a}) \bfrac{\cos(l\phi)}{\sin(l\phi)}; & r < a \\ \\ \frac{A}{K_l (U)} K_l(\frac{W \cdot r}{a})\Bfrac{\cos(l\phi)}{\sin(l\phi)}; & r > a \end{cases}$$
\end{document}