# multi line equation with full left brace, small right brace and text at right bottom of right brace

I want to write a three line equation with left curly brace for all three, right curly brace for bottom two ones and some text at right bottom of right curly brace. All with proper alignment. I wrote following code.

\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{flexisym}

\begin{document}

\begin{equation*}
\begin{aligned}
K_{\mathbb{A}_{Ui}} =\begin{cases}
D                =\ g^{ \frac{ (\alpha + r) }{\beta} }\\
\left.\begin {aligned}
&D_j           &=\ &g^r . H(j)^{r_j} \\
&D_j\textprime &=\ &g^{r_j}
\end{aligned}\right\} \forall j \in   \mathbb{A}_{Ui}
\end{cases}
\end{aligned}
\end{equation*}

\end{document}


It is giving some problems.

1. Second and Third lines are aligned but they are not aligned with the first one. I want alignment to occur at start of "D", "=" and "g" for all three.

2. Right now, the text at right of right curly brace is coming at center. I want it to shift down and come at bottom.

• BTW: Why are you using \textprime? A normal ' should be enough Apr 5 '19 at 9:48
– pba
Apr 5 '19 at 9:51
• Thanks. I will replace it.
– pba
Apr 5 '19 at 9:51
• flexisym should not really be used in any document, it is a companion of breqn which you are not using (and probably shouldn't) Apr 5 '19 at 9:54
• Ok. I will remote it.
– pba
Apr 5 '19 at 10:13

A solution with empheq:

\documentclass{article}
\usepackage{amssymb}
\usepackage{empheq}
\usepackage{bigdelim}
\usepackage{flexisym}

\begin{document}

\begin{empheq}[left ={K_{\mathbb{A}_{Ui}}=\empheqlbrace}]{alignat*=2}
&D_{\hphantom{j}} = g^{ \frac{ (\alpha + r) }{\beta} }\\
& D_j = g^r . H(j)^{r_j} & &\smash{\raisebox{-0.5\height}{$\biggr \rbrace$}\quad\begin{aligned}[t] \\\forall j \in \mathbb{A}_{Ui} \end{aligned}}\\%
& D_j' = g^{r_j}
\end{empheq}

\end{document}