# How to align equations like this?

So I want to align this equation such that dx/dt all align in the same line as the picture given for reference.

$$\left.\begin{matrix} \frac{dx}{dy}=a(y-x)+u\\ \frac{dy}{dt}=-xz+cy \\ \frac{dz}{dt}=xy-bz\\ \frac{du}{dt}=xz+du \end{matrix}\right\}$$


You want aligned, rather than matrix.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\left. \begin{aligned} \frac{dx}{dy} &= a(y-x)+u \\ \frac{dy}{dt} &= -xz+cy \\ \frac{dz}{dt} &= xy-bz \\ \frac{du}{dt} &= xz+du \end{aligned} \right\}

\end{document}


I want to align this equation such that dx/dt all align in the same line

I suggest you load the mathtools package and use a drcases environment.

\documentclass{article}
\usepackage{mathtools} % for 'drcases' environment
\begin{document}
$$\begin{drcases} \frac{dx}{dy}=a(y-x)+u \\ \frac{dy}{dt}=-xz+cy \\ \frac{dz}{dt}=xy-bz \\ \frac{du}{dt}=xz+du \end{drcases}$$
\end{document}

• +1. I've taken the liberty of switching your code to a drcases environment.
– Mico
Commented May 1, 2023 at 12:34
• I too like this method +1 Commented May 1, 2023 at 15:54
• @Mico You're always welcome. Thank youuuuuuuuuuuuuuuuuuuuuuuuuu. Commented May 1, 2023 at 19:25

I had to make some assumptions about document settings, but something like this?

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$\left. \begin{matrix} \frac{dx}{dy} = &a(y-x)+u\\ \frac{dy}{dt} = &-xz+cy \\ \frac{dz}{dt} = &xy-bz\\ \frac{du}{dt} = &xz+du \end{matrix} \right\}$$
\end{document}


If you don't care about aligning the equations in the middle of the page you could use the code below. (using the ams math package). (P.S. Use the ampersand character &, to set the points where the equations are vertically aligned.)

\begin{align*}
\frac{dx}{dy} &=a(y-x)+u\\
\frac{dy}{dt} &=-xz+cy \\
\frac{dz}{dt} &=xy-bz\\
\frac{du}{dt} &=xz+du
\end{align*}


Here's the result you will get:

• Judging by the OP's code, it would appear to be desirable to be able to assign a single equation number to the four-line expression. How might your code be adapted to permit achievning this objective?
– Mico
Commented May 1, 2023 at 13:24
• If that's the desirable result, then @egreg 's got correct answer. So we could wrap the code in the align envinormnet, with an equation environment and \left \right\}. Commented May 1, 2023 at 13:30