# equations overlaping equation number in cases environment

I'm working with a long equation in case environment, the problem is that the equation overlaps the equation number... any ideas on how to solve that problem.

I've thought on aligning it all to the left, tried flushleft but i can't manage it to work.

  \begin{numcases}{\phi(x) =}
-\frac{e^{-\frac{x}{k}}T_0\Big(-ke^{\frac{L}{2k}}-e^{\frac{x}{k}}(k+x)+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k-x)\Big)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  $x \in [0,\frac{L}{2}],$   \\
\frac{e^{-\frac{L+2x}{2k}}T_0\Big(-ke^{\frac{3L}{2k}}+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k+L-x)+e^{\frac{L+x}{k}}(-k+L-x)\Big)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  $x \in [\frac{L}{2},L].$
\end{numcases}

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 15 '15 at 15:19
• possible duplicate: nested equations numbering – barbara beeton Apr 15 '15 at 15:55

## 2 Answers

Here is one possibility.

\documentclass{article}
\usepackage{mathtools}
\usepackage{empheq}

\begin{document}
\begin{empheq}[left={\phi(x) =\empheqlbrace}]{align}
&-\frac{e^{-\frac{x}{k}}T_0(A)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  x \in \biggl[0,\frac{L}{2}\biggr],   \\
&\frac{e^{-\frac{L+2x}{2k}}T_0(B)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  x \in \biggl[\frac{L}{2},L\biggr].
\end{empheq}
where
\begin{align*}
A &= -ke^{\frac{L}{2k}}-e^{\frac{x}{k}}(k+x)+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k-x) \\
B &=  -ke^{\frac{3L}{2k}}+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k+L-x)+e^{\frac{L+x}{k}}(-k+L-x)
\end{align*}
\end{document} • that is a possibility but i was trying to avoid that – Sebas Apr 15 '15 at 15:38
• @Sebas Why to avoid. This is the best possibility, keeping your readers in mind. :-) – user11232 Apr 15 '15 at 15:40
• because I've another similar system and i would have to add four more equations A, B, C and D – Sebas Apr 15 '15 at 15:46

There's no hope of having those long formulas in one line.

1. The denominator is the same, so you can move it in front of \phi(x)
2. The denominators can be split across two or three lines
3. numcases should not be used

Example

\documentclass{article}
\usepackage{amsmath,empheq}

\begin{document}

\begin{empheq}[
left={2\bigl(1+e^{\frac{L}{2k}}\bigr)GJ_t\phi(x)=\empheqlbrace}
]{align}
&\begin{aligned}
&-e^{-\frac{x}{k}}T_0\Bigl(-ke^{\frac{L}{2k}}-e^{\frac{x}{k}}(k+x) \\
&\qquad+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k-x)\Bigr),
\end{aligned}
&  x \in \biggl[0,\frac{L}{2}\biggr],   \\[2ex]
&\begin{aligned}
&e^{-\frac{L+2x}{2k}}T_0\Bigl(-ke^{\frac{3L}{2k}} \\
&\qquad+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k+L-x) \\
&\qquad+e^{\frac{L+x}{k}}(-k+L-x)\Bigr),
\end{aligned}
&  x \in \biggl[\frac{L}{2},L\biggr].
\end{empheq}

\end{document} 