# Thread: How to underline seperate algebraic terms?

1. ## How to underline seperate algebraic terms?

Hello all,

I'm doing my end of year math assignment, and it's my first time using Latex. My question regards underlining terms in algebraic expressions. In my textbook, they are underlined like this:

Is there any way I can do this using Latex? I tried using
Code:
\underline{+4a} \underline{+c} \underline{-7 \sqrt{b}} \underline{-5}
but it doesn't look good, the lines aren't even seperated:
$$\underline{+4a} \underline{+c} \underline{-7 \sqrt{b}} \underline{-5}$$
Does anyone know if/how I can make it look like the example from the textbook?

apex

2. ## Re: How to underline seperate algebraic terms?

Originally Posted by apex123
I'm doing my end of year math assignment, and it's my first time using Latex. My question regards underlining terms in algebraic expressions. In my textbook, they are underlined like this:
Is there any way I can do this using Latex? I tried using
Code:
\underline{+4a} \underline{+c} \underline{-7 \sqrt{b}} \underline{-5}
but it doesn't look good, the lines aren't even seperated:
$$\underline{+4a} \underline{+c} \underline{-7 \sqrt{b}} \underline{-5}$$
Does anyone know if/how I can make it look like the example from the textbook?
Will you take: $\underline{+4a+c-7 \sqrt{b}-5}$

OR does it need separation: $\underline{+4a}\;$$\underline{+c}\: \underline{-7 \sqrt{b}}\;$$ \underline{-5}\;$

3. ## Re: How to underline seperate algebraic terms?

Originally Posted by Plato
Will you take: $\underline{+4a+c-7 \sqrt{b}-5}$

OR does it need separation: $\underline{+4a}\;$$\underline{+c}\: \underline{-7 \sqrt{b}}\;$$ \underline{-5}\;$
Hi Plato, thanks for the reply. The second example would be perfect, although I'm a little confused by the syntax so I cannot modify it to suit my needs. Basically, in my assignment I am explaining how to solve a quadratic equation. Here is the part where I need to use underline:

Code:
Now we group the four terms into pairs and take out common factors:

\begin{align*}
3x^2 + 2x -8 &= \underline{3x^2 + 6x} \underline{- 4x -8}\\
&= 3x(x+2) - 4(x + 2)\\
&= (3x - 4)(x + 2)
\end{align*}
So on the first line in the {align*} blocks, the term pairs "3x^2 + 6x" and "-4x - 8" would be seperately underlined. I modified your second example and made it display what I wanted outside of the {align*} block, but when I try putting it into the block it fails to compile. Any ideas?

Edit: Never mind, I just worked it out

Code:
Now we group the four terms into pairs and take out common factors:

\begin{align*}
3x^2 + 2x -8 &= \underline{3x^2 + 6x} \text{ } \text{ } \underline{- 4x -8}\\
&= 3x(x+2) - 4(x + 2)\\
&= (3x - 4)(x + 2)
\end{align*}
Looks just how I wanted, thanks for your help!

4. ## Re: How to underline seperate algebraic terms?

Originally Posted by Plato
$\underline{+4a}\;$$\underline{+c}\: \underline{-7 \sqrt{b}}\;$$ \underline{-5}\;$
The code is [TEX]\underline{+4a}\; \underline{+c}\;\underline{-7 \sqrt{b}}\; \underline{-5}\;[/TEX]

$\displaystyle \underline{+4a}\; \underline{+c}\;\underline{-7 \sqrt{b}}\; \underline{-5}\;$