# How to have equation number for the below equation

I am trying to put the equation number for the below expression. how to do it?

\documentclass[12pt,a4paper]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

$\Phi_{1}= \left\{ \begin{array}{ll} a(x) & x\leq \frac{1}{3} \\ b(x) & x> \frac{1}{3} \\ \end{array} \right.$

\end{document}

• Welcome! You can use empheq. See e.g. tex.stackexchange.com/a/258879. – Schrödinger's cat Apr 5 at 6:19
• Use $$...$$ instead of $...$. – Henri Menke Apr 5 at 6:20
• The question is a bit ambiguous. Are you looking for \documentclass[a4paper,10pt]{article} \usepackage{amsmath} \usepackage{empheq} \begin{document} \begin{empheq}[left={\Phi_{1}=\empheqlbrace\,}]{align} a(x)\;, &\quad\text{if}~ x\leq \frac{1}{3}\;, \notag\\ b(x)\;, &\quad\text{if}~x> \frac{1}{3} \;. \end{empheq} \end{document}? – Schrödinger's cat Apr 5 at 6:26
• Remember that amsmath <= mathtools. – Sebastiano Apr 5 at 10:47

Like this:

For such equations is in amsmath defined environment cases. For its numbering you should insert in equation environment as stated @Henri Menke in his comment:

\documentclass[12pt,a4paper]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{xcolor}  % <---

\begin{document}

$$\color{blue!70!black} <--- \Phi_{1} = \begin{cases} a(x) & x\leq \frac{1}{3} \\ b(x) & x> \frac{1}{3} \\ \end{cases}$$

\end{document}


Edit (1): If you like to have only this equation in blue color, than after add for example \color{blue!70!black}, as is added now in above MWE.

Edit (2): However, if you like to have all math expressions colored, than two solutions are provided in answer of Stefan Kottwitz and in answer of David Carlisle. Considering them in above MWE, you will get:

and

respectively. Difference between them is color of equation numbers.

• How to change the color of the equation to blue – Vijay Kumar S Apr 5 at 7:24
• Load the (x)color package and add \color{blue} just after . – Bernard Apr 5 at 8:50