| by Arround The Web | No comments

How to Make a Multiline Equation in LaTeX

Sometimes, we need to break some long equations in a document into multiple lines to make it easy to understand. In lengthy derivations, breaking the equations is essential to explain everything step by step.

That’s why LaTeX also provides some ways to break the equations. Still, many new users don’t know how to create multiline equations. In this tutorial, we will give you a complete information on how to write the multiline equations in LaTeX.

How to Make a Multiline Equation in LaTeX

In LaTeX, we use the amsmath package to display the mathematical equations in the document. However, it doesn’t give the splitting options, but you can use the {split} environment. The following source code illustrates how to write a multiline equation in LaTeX:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation} \label{eq1}

\begin{split}

A & = \frac{\pi r^2}{2} \\

& = \frac{1}{2} \pi r^2

\end{split}

\end{equation}

\end{document}

Output:

Similarly, you can write the long equation using the following source code:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}

\begin{split}

p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3 \\

12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3

\end{split}

\end{equation}

\end{document}

Output:

Now, let’s create the multiple equations using {split}, {equation}, and {multiline} codes in the source codes in LaTeX:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

Suppose we have:

\begin{equation}

2x+5y+3z+x^2+y^2+z^2+8 \\

\Rightarrow x=7, y=2, z=3

\end{equation}

Then we have:

[cc lang="bash" width="100%" height="100%" escaped="true" theme="blackboard" nowrap="0"]\begin{multline}

8x+2y+z+5x^2+3y^2+2z^2+12 \\

\Rightarrow x=2. y=3, z=5

\end{multline}

So please solve the following

\begin{equation}

\begin{split}

3x+6y+2z+3x^2+y^2+4z^2+12=35 \\

& \Rightarrow x=?, y=2, z=7

\end{split}

\end{equation}

\end{document}

Output:

Conclusion

LaTeX helps in solving the problem when it comes to inserting long and huge equations in the document. It makes it easy to separate the equation into different parts and display them separately with different alignments. Therefore, putting multiline equations is not a big deal now with the help of LaTeX.

Share Button

Source: linuxhint.com

Leave a Reply