# Double solution in equation mode

I Want to do give two solutions to an equation, and do something like that:

                      / 0
If c = 0    =>    x =
\ -b/a


Edit: I've tried the cases environment or using \left\{ ... \right., still a good idea but not exactly what wanted.

-
How about the cases environment from amsmath? See e.g. tex.stackexchange.com/questions/9065/… – Torbjørn T. Nov 3 '12 at 19:15
I would suggest you simply If $c=0$, then $x\in\{0,-b/a \}$. – Gonzalo Medina Nov 3 '12 at 19:18
@TorbjørnT. I think we should point that is similar question with (tex.stackexchange.com/questions/9065/…) unless JnxF wants something different – karathan Nov 3 '12 at 19:49
@TorbjørnT. I tried what you or Jorge Campos suggested, but I don't like it too much what does it looks like. – JnxF Nov 3 '12 at 19:59
@JnxF Well, I haven't seen that lines in math texts ever. I think that's why Torbjørn and G.Medina suggested alternatives. – c.p. Nov 3 '12 at 23:40

I would suggest something simple (without additional symbols that really don't bring anything good to the expression), as the first approach below; I also included something reproducing the image in the original question, but I don't like this option (of course, this is nothing but my personal opinion):

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\newcommand\tikzmark[1]{%
\tikz[remember picture,overlay,baseline=-0.5ex]\node[inner sep=3pt] (#1) {};}

\begin{document}

$\text{If } c=0\text{, then } x\in\{0,-b/a \}.$

$\text{If } c=0\text{, then } x=\tikzmark{a}\mspace{15mu} \begin{array}{l}\tikzmark{b}0 \\ \tikzmark{c}-b/a \end{array}$
\begin{tikzpicture}[remember picture,overlay]
\draw (a) -- (b);
\draw (a) -- (c);
\end{tikzpicture}

\end{document}


-
I also think like you. To say that x belongs to the set of answers would be most appropriate without having to use "drawings" to indicate something that already has a nomenclature. But in this case, I needed it for educational purposes, and would not include nomenclature. Thanks. Very useful. – JnxF Nov 3 '12 at 20:33
I'm more inclined to use words: "If c=0, then x=0 or x=-b/a". I dislike very much the "two case" notation: x can't be equal to two different things. – egreg Nov 4 '12 at 14:05
I just used that notation because my students used to use this notation in their written exercises last years, so I don't want to write down a notation nomenclature. I appreciate all your opinion. Thanks. – JnxF Nov 4 '12 at 14:44

For a change, without tikz:

\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}

\newcommand\neline{%
\raisebox{1ex}{\rotatebox{-20}{\ensuremath\diagup}}}
\newcommand\seline{%
\raisebox{-1ex}{\rotatebox{20}{\ensuremath\diagdown}}}
\newlength{\mylength}
\settowidth{\mylength}{\neline}

\begin{document}

$\text{If } c=0\text{, then } x = \neline\kern-\mylength\seline \begin{array}{l}0 \\ -b/a \end{array}$

\end{document}


As suggested by Enrico, it is better to use \makebox[0pt][l]{\neline}, then we don't have to measure the width. Further we can merge \neline and \seline to make a single macro:

\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}
%
\newcommand\neline{%
\makebox[0pt][l]{\raisebox{1ex}{\rotatebox{-20}{\ensuremath\diagup}}}
\raisebox{-1ex}{\rotatebox{20}{\ensuremath\diagdown}}}
%
\begin{document}
$\text{If } c=0\text{, then } x = \neline \begin{array}{l}0 \\ -b/a \end{array}$
\end{document}

-

you could also consider using the "cases" environment (but leaving the condition part empty).

$\text{If } c=0\text{, then } x=\begin{cases} 0 & \\ -\frac{b}{a} & \end{cases}$

-

Here's a slightly different option:

\documentclass{article}

\begin{document}
$\mbox{If } c=0\mbox{, then } x=\mathop{\left\langle\phantom{x^2}\right.}^1_{-\frac{b}{a}}$
\end{document}


-

You can use, in math mode, the command cases from amsmath. What you want could be something like this:

x = \begin{cases} 0,  \\
-\frac{b}{a},  \end{cases}


You might want to add text:

x = \begin{cases} 0 , \mbox{when ...}  \\
-\frac{b}{a}, \mbox{otherwise} \end{cases}

-