# I want to split a long equation in many lines

I have a long line in equation. I want to split it properly in two or three lines. I've been using \begin{split} and \end{split}, but still it is not in good position. The equation's code is below.

$$\begin{split} \frac{r(r-1)c_{0}}{z} + \\ & \sum_{0}^{\infty}[[(j+r)(j+r+1)c_{j+1} - [(j+r)(j+r-1) - l(l+1)]c_{j}] \\ &= 0, \end{split}$$

• (i) please help us to help you: provide complete but small document beginning with \documentclass{...} and ending with \end{document}. it is not fun to write from scratch missing part of code (which can be also essential), especially you already have this code ... (ii) welcome to tex.se! – Zarko Mar 22 '18 at 16:18

it's not clear what you mean with "in a good position" ...

one solution using split can be:

$$\begin{split} & \frac{r(r-1)c_{0}}{z} + \sum_{0}^{\infty}\Bigl[(j+r)(j+r+1)c_{j+1} \\ &\qquad - [(j+r)(j+r-1) - l(l+1)]c_{j}\Bigr] = 0, \end{split}$$


solution as you like to have:

\documentclass{article}
\usepackage{mamsmath}

\begin{document}
$$\begin{split} & \frac{r(r-1)c_{0}}{z} + \sum_{0}^{\infty}\Bigl[(j+r)(j+r+1)c_{j+1} \\ & - [(j+r)(j+r-1) - l(l+1)]c_{j}\Bigr] = 0, \end{split}$$
\end{document}


another solution (which I like the most) is with use of the package mathtools and its environment multlined:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
$$\begin{multlined}[0.7\linewidth] \frac{r(r-1)c_{0}}{z} + \sum_{0}^{\infty}\Bigl[(j+r)(j+r+1)c_{j+1} \\ - [(j+r)(j+r-1) - l(l+1)]c_{j}\Bigr] = 0, \end{multlined}$$
\end{document}


• Good position means that second line should start from the same position below the first. – Noor Aslam Mar 22 '18 at 16:18
• @NoorAslam "Good position" is very subjective: for example, I would move the second line even further to the right, and starting both lines from the very left seems quite bad to me for this equation (personal opinion). In summary: please edit the question and make your requirement explicit :-) – campa Mar 22 '18 at 16:25
• ok, than erase \qquad in my code ... however, i agree with @campa comment – Zarko Mar 22 '18 at 16:25
• @Zarko you have more experience than me in latex. I apperiate your opinion. Thank you so much – Noor Aslam Mar 22 '18 at 16:27

Using geometry for decent margins, it can fit on two lines:

 \documentclass[a4paper, 11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{mathtools}

\begin{document}

$$\begin{split} \frac{r(r-1)c_{0}}{z} &{}+ \sum_{0}^{\infty}\Bigl[(j+r)(j+r+1)c_{j+1} - [(j+r)(j+r-1) - l(l+1)]c_{j}\Bigr] \\ &= 0, \end{split}$$