# How to place equations aligned one on each line?

I've been looking and trying for the past hour and I can't figure it out. I'm pretty new to LateX and I'm trying to display my Differential equations working but it's turning into a big mess.

I'm basically trying to get each equation on a line and aligned in the center. Here is what I've tried, but in vain:

\begin{equation}
\frac{dx}{dt} = -r(x-x_{e})\\
\frac{dx}{9} = -rdt\\
\int\frac{dx}{x-x_{e}} = \int -rdt\\
ln|x-x_{e}| = -rt + ln |C|
\end{equation}


Any help is greatly appreciated.

• Welcome, you are using the wrong environment. Try align and put ampersands (&) right before the equal signs. – Johannes_B May 15 '16 at 14:03
• Equation is for one-line equations. – Bernard May 15 '16 at 14:04
• If you don't care about alignment, use the gather environment. – Johannes_B May 15 '16 at 14:04
• Strange ODE this is ;-) – user31729 May 15 '16 at 14:16
• @ChristianHupfer the random 9 was to test if I was doing something wrong with the brackets ;) It's always good to have a single value for tracing purposes :-) – nTuply May 15 '16 at 15:36

I would use the align environment from mathtools here. Please have a look at the other small adjustments i made. \documentclass{article}
\usepackage{mathtools}
\usepackage{physics}
\begin{document}
\begin{align}
\dv{x}{t}                 &= -r(x-x_{e})\\
\frac{\dd x}{9}           &= -r\dd{t}\\
\int\frac{\dd x}{x-x_{e}} &= \int -r\dd{t}\\
\ln\abs{x-x_{e}}          &= -rt + \ln \abs{C}
\end{align}
\end{document}

• align is part of amsmath, not mathtools (though since mathtools includes amsmath anyways, it doesn't matter much). – Arun Debray May 15 '16 at 16:08
• @ArunDebray mathtools fixes many bugs from amsmath, so i silently skip over mentioning amsmath. – Johannes_B May 15 '16 at 16:16
• Instead of setting up a completely new information system for starters, they should fix the LaTeX-Wikibook. I wouldn't even mind a really big ShareLaTeX has fixed this page on every article their guy updates. – Johannes_B May 15 '16 at 16:18