Math & ScienceDepicting math equation derivation steps

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghantauke
Posts: 9
Joined: Wed Mar 02, 2011 2:50 am

Depicting math equation derivation steps

Post by ghantauke »

Hi,

I want a way to write down the steps of how I derived an equation. For example say I have to evaluate the equation 2x*3y where x=1 and y=2.

I write the derivation steps as follows.

2x*3y = 2*1*3*2 (From x=1, y=2)
........= 2*6
........= 12

Assume I want space in the place of the dots(.). (I put dots here because I couldn't align the "=" in all the lines as I wanted to in this post too)

I'm having a hard time aligning the "=" symbol in all the lines. Could someone please help me out?

I tried using \hspace but it doesn't work if I have only one element in the line.

Thanks in advance.
Last edited by ghantauke on Fri Mar 11, 2011 11:04 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Depicting math equation derivation steps

Post by mas »

You should take a look at the amsmath package. Use the align environment for typesetting multiline equations.

Code: Select all

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
  2x \times 3y &= 2\times 1 \times 3\times 2 \;\;(\text{for } x=1,\; y=2) \\
           &= 2*6 \\
           &= 12
\end{align*}

\end{document}

Regards,

sridhar

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
ghantauke
Posts: 9
Joined: Wed Mar 02, 2011 2:50 am

Re: Depicting math equation derivation steps

Post by ghantauke »

wow thanks u helped me out big time.
Post Reply