# How can I write the solving steps of a system of equations?

I'm trying to do the following in LaTeX:

The box at the end doesn't have to be there. I've tried using cases, from the amsmath package, but it doesn't align correctly with the equations on top, nor is the formatting very pretty:

This is the code I used:

\begin{align*}
\sum \vec{F} &= ma \\
\vec{R_n} + \vec{Fg} + \vec{F_a} &= ma \\

\begin{cases}
\vec{F_a} &= ma_c\\
\vec{R_n} - \vec{F_g} &= 0
\end{cases}

\begin{cases}
uR_n &= m\frac{v^2}{r}\\
R_n &= mg
\end{cases}

\begin{cases}
ug &= \frac{v^2}{r}\\
R_n &= mg
\end{cases}

\begin{cases}
\sqrt{ugr} &= v\\
\end{cases}
\end{align*}


Thanks in advance, I'm a LaTeX beginner :)

• When I saw this question in the Hot Network Questions, I was half-expecting to find an answer with a computer algebra system in TeX that will solve the equations by itself, then typeset the steps it took :-D – Jörg W Mittag Jan 2 '17 at 0:00
• That would've been awesome indeed, haha – Pada Jan 2 '17 at 11:43

Some improvements with mathtools and esvect (for nicer-looking arrow tips), and a slightly different layout:

\documentclass{article}
\usepackage{mathtools, esvect}

\begin{document}

\begin{align*}
& \mkern1.5mu \sum \vv{F} = ma \Leftrightarrow\vv*{R}{n} + \vv*{F}{g} + \vv*{F}{a} = ma \\
\Leftrightarrow & \begin{dcases}
\vv{F_a} = ma_c\\
\vv*{R}{n} - \vv*{F}{g} = 0
\end{dcases}
%
\Leftrightarrow \begin{dcases}
uR_n = m\frac{v^2}{r}\\
R_n = mg
\end{dcases}
%
\Leftrightarrow \begin{dcases}
ug = \frac{v^2}{r}\\
R_n = mg
\end{dcases}\\
\Leftrightarrow & \hspace*{\fboxsep} \boxed{\sqrt{ugr} = v}
\end{align*}

\end{document}


• I'm curious, why do you use literal $\Sigma$ and $\surd$ characters in the source? Are there advantages? – andrepd Jan 2 '17 at 1:04
• @andrepd: Actually, I don't use them in the source (LaTeX wouldn't compile them). Simply, my editor is configured to display a number of maths symbols and Greek letters, but saves them as latex commands. I shouldn't have posted the display, but the saved file, and I forgot to check. I'll fix that in a moment. Thanks for pointing it! – Bernard Jan 2 '17 at 2:09
• Is it possible for LaTex to detect where margins are, and adjust the cases equations accordingly? With a longer system, things get a bit... badly formatted (the big lines are the margins). And using //in the third case doesn't seem to help either :(. What am I doing wrong? – Pada Jan 2 '17 at 11:51

The following should be a good starting point. Please observe removing most of your ampersands. Id you really need iff as in the picture, I can corect my example, but this version seems to be more standard one.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
& \sum \vec{F} = ma \\
&\iff  \vec{R_n} + \vec{Fg} + \vec{F_a} = ma \\
&\iff    \begin{cases}
\vec{F_a} = ma_c\\
\vec{R_n} - \vec{F_g} = 0
\end{cases}
%
\iff  \begin{cases}
uR_n = m\frac{v^2}{r}\\
R_n = mg
\end{cases}
%
\iff \begin{cases}
ug = \frac{v^2}{r}\\
R_n = mg
\end{cases}
%
\iff \begin{cases}
\boxed{\sqrt{ugr} = v}\\
\strut
\end{cases}
\end{align*}

\end{document}


\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
& \sum \vec{F} = ma \\
\Leftrightarrow{}
& \vec{R_n} + \vec{Fg} + \vec{F_a} = ma \\
\Leftrightarrow{}
& \begin{cases}
\vec{F_a} &= ma_c\\
\vec{R_n} - \vec{F_g} &= 0
\end{cases}
\Leftrightarrow
\begin{cases}
uR_n &= m\frac{v^2}{r}\\
R_n &= mg
\end{cases}
\Leftrightarrow
\begin{cases}
ug &= \frac{v^2}{r}\\
R_n &= mg
\end{cases}
\Leftrightarrow
\begin{cases}
\sqrt{ugr} &= v\\
\end{cases}
\end{align*}
\end{document}

• What's the difference between using Leftrightarrow{} and Leftrightarrow? – Pada Jan 2 '17 at 11:44
• @Pada Try both versions and observe the spacing. The braces {} simulate an operand for the relation symbol \Leftrightarrow, which adds an appropriate space. Without the braces there is no operand, so the aligned stuff follows immediately after the arrow. – gernot Jan 2 '17 at 13:58
• I see, it's subtle but it is indeed there. – Pada Jan 2 '17 at 15:00