# Write Two Equations at the Same Line in Latex

1. Aug 19, 2009

### S_David

Hello,

How can I write two differents equations at the same line using Latex? for example:

\begin{align} y_1(x)=&x^2\\ y_2(x)=&2x+1 \end{align}

2. Aug 19, 2009

### minger

You could either "jimmy" it by just putting spacing characters in between, or put them in a matrix.
$$y_1(x) = x^2 \,\,\,\,\, y_2(x) = 2x+1$$
Code (Text):

y_1(x) = x^2 \,\,\,\,\, y_2(x) = 2x+1

Or a slightly more elegant
$$\begin{array}{cc} y_1(x) = x^2 & y_2(x) = 2x+1 \\ \end{array}$$
Code (Text):
\begin{array}{cc}
y_1(x) = x^2 & y_2(x) = 2x+1 \\
\end{array}

3. Aug 19, 2009

### S_David

First, thank you for replying. Second, I want the equation numbers, and the two equations be at the two extreme edges (left and right) of the page. Can we do that?

4. Aug 20, 2009

### minger

OK, I got something. I had to switch to the tabular environment; it has some better column definition flexibility (furthermore, you really need to use the tabular* environment). Either way, you get the optional table width with you will typically want to use
Code (Text):
0.8\textwidth
or something like that. For the purpose of displaying it proprely on this webpage, I have chosen an arbitrary width. The
Code (Text):
}{@{\extracolsep{\fill}}
is important as it lets the columns have "rubber widths" so they decide how wide they should each be.
$$\begin{tabular*}{20cm}{@{\extracolsep{\fill}} l r } y_1(x) = x^2 & y_2(x) = 2x+1 \\ \end{tabular*}$$
Code (Text):

\begin{tabular*}{20cm}{@{\extracolsep{\fill}} l r }
y_1(x) = x^2 & y_2(x) = 2x+1 \\
\end{tabular*}

Hope that helps.

http://en.wikibooks.org/wiki/LaTeX/Tables

Last edited: Aug 20, 2009
5. Aug 20, 2009

### fatra2

Have you thought of minipage environment. It should allow you to do such a thing.

Cheers

6. Aug 20, 2009

### phanithegreat

$$P_h^a_n^i /, /, /, 985685 9//1//2$$

7. Aug 20, 2009

### S_David

Ok, thank you. you are right, minipage enviroment solves the issue. Here is the code:

$$\begin{minipage}{0.5\linewidth} y_1(x)=x^2 \end{minipage} \hspace{0.5cm} \begin{minipage}{0.5\linewidth} y_2(x)=2x+1 \end{minipage}$$

Thank you all guys.

Regards

8. Aug 20, 2009

### minger

Oh you wanted the equations numbered seperately. Well glad you found it.