Skip to main content

Registration is now open for this year's LibreFest! Join us virtually the week of July 13.

Register here
Mathematics LibreTexts

2.1 Algebraic Expressions

  • Page ID
    152884
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives

    By the end of this section, you will be able to:

    • identify the important features of a polynomial
    • add and subtract algebraic expressions
    • multiply algebraic expressions using distribution techniques such as FOIL
    • simplify expressions containing like terms

    Vocab tiiiiime! Let's learn the language we need to talk about algebraic expressions.

    Say I'm building a doghouse and I'm trying to calculate how much wood I need to buy. Everything depends on the size of the doghouse, right? And I could start describing size by talking about the height I want. But I don't know what height I want yet! It could be 2ft, or maybe 2.5ft, or maybe 2.789ft. Any of those real numbers could be good options, and anything I choose is going to affect how the rest of my calculations go. So instead of making the decision now, I use a nickname for the quantity "height of the doghouse," maybe oh I dunno like an \(h\). Then since \(h\) could be various options from a set of reasonable real numbers, it's called a variable. Then I could work with that nickname \(h\) during my calculations.

    A variable is a symbol (letter) that represents a quantity whose exact value we don't know yet, or whose exact value may be allowed to change (vary). If we take variables and real numbers and combine them using addition, subtraction, multiplication, division, powers, and radicals, the result is an algebraic expression.

    Say I have a spherical balloon, and I represent the radius with the variable \( r\). I can write an algebraic expression calculating the volume inside the balloon, \(4\pi r^3 \), using the variable, real numbers, and arithmetic. Algebraic expressions can look like all sorts of things:

    \[ 4x^3 - 5x^2 + 1, \quad \quad \frac{\sqrt{xyz}}{10}, \quad\quad (1+r)^{10t} \notag \]

    In that first example above, various pieces getting added or subtracted are called terms. The \(4\) multiplied on the front of the \(x^3\) term is called the coefficient of \(x^3\). Likewise, \(-5\) is the coefficient of the \(x^2\) term.

    Let's keep looking at \( 4x^3 - 5x^2 + 1 \). Expressions of the form \(a x^n\), some real number coefficient times a power of \(x\), are called monomials, and if you add two such terms, you get a binomial. Add up a bunch, and you get a polynomial. (Poly- is Latin for "many." Okay fine, it's originally Greek. But also Latin.) Polynomials are our bestest friends. We love them.

    Definition: Polynomial

    A polynomial in the variable \(x\) is an expression of the form

    \[ a_0 + a_1 x + a_2 x^2 + \cdots + a_n x^n, \notag \]

    or equivalently,

    \[ a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0, \notag \]

    where \( a_0, a_1, a_2, ..., a_n \) are real number coefficients, and \(n\) is a nonnegative integer.

    The degree of the polynomial is the highest power you see \(x\) raised to. That term, \( a_n x^n \), is the leading term, and the coefficient \(a_n\) is the leading coefficient. The plain ol' real number term, \( a_0\), is the constant term.

    Exercise \(\PageIndex{1}\)

    For each expression, identify whether it is a polynomial, and if so, tell its degree and leading coefficient.

    1. \( 3x + 2 \)
    2. \( x^2 + 9x + 17 \)
    3. \( 6e^x - x \)
    4. \( \frac{x^2 - 2}{x^3 + 1}\)
    Answer
    1. Yes, it is composed of powers of x with coefficients on them added together. That 2 is the constant term \( a_0\), and the highest power of \(x\) is 1, making this a degree one polynomial. The leading coefficient is the 3 on the \(x\) term.
    2. Yes, this is a degree two polynomial, and the leading coefficient is a secret 1, because \( x^2 = 1x^2 \).
    3. Nope! That \( 6e^x \) ruined everything.
    4. Nope! The expressions in the numerator and denominator are themselves polynomials, but since they're in a fraction, this is not a polynomial. It's a rational expression, which we'll deal with later.

    We can do all sorts of stuff with polynomials, like adding and subtracting them. For this, we're going to need a fun fact:

    Distributive Property of Addition

    For numbers (or variables) \(a, b,\) and \(c\), we have

    \[ a(b+c) = ab + ac. \notag \]

    Note: going from the left hand side to the right hand side is called distributing the \(a\) through the parentheses, and going backwards is called factoring out the \(a\) from both terms.

    You should buy that this works for regular numbers. Anybody wanna fight that \( 2(3+5) = 2\cdot 3 + 2 \cdot 5 = 6 + 10 = 16 \) is the same as \(2(3+5) = 2(8) = 16 \)? Didn't think so. I can use this property on variable terms as well, like this:

    \[ 11x + 7x = (11+7)x = 18x, \quad \text{or} \quad 4x - 6x = (4-6)x = -2x. \notag \]

    This particular technique is called combining like terms, aka terms that have the same exact variable(s) raised to the same exact power(s). So I can combine \(2xy\) with \(3xy\) to make \(5xy\), but I can't combine \(2xy\) with \(3x^2y\) because I don't have the same variables and same powers exactly.

    Example \(\PageIndex{1}\)
    1. Distribute: \( 4(a+b) \)
    2. Distribute: \( -7(2x + 11 + z) \)
    3. Factor: \( 3x + 6y \)
    4. Factor: \( 12x^2 - 12x \)
    5. Combine like terms: \( 3x - 4x^2 + 2 + x + 5x^2 \)
    Solution
    1. Apply the multiplication by 4 to both terms inside the parentheses: \( 4(a+b) = 4a + 4b \).
    2. ALERT!!! Be very careful when multiplying by that negative 7! \(-7(2x + 11 + z) = (-7)(2x) + (-7)(11) + (-7)(z) = -14x - 77 - 7z \).
    3. Both terms have a factor of 3 in them. If I take the 3 from the \(3x\), I have a leftover \(x\) in that term. If I take 3 from the \(6y\), I have \(2y\) left. So \( 3x + 6y = 3(x+2y) \).
    4. Both terms have the factors \(12\) and \(x\) in common. If I take \(12x\) out of \(12x^2\), there is a single \(x\) left over. How can I take \(12x\) out of \(12x\)? That's the whole thing?? But wait, \(12x = 12 \cdot x \cdot 1\), so there is only a \(1\) left over. Thus, \( 12x^2 - 12x = 12x(x - 1)\).
    5. I look for the terms that have the same power on the \(x\)... Bring the \(3x\) and \(x\) together, and then bring the \(-4x^2\) and \(5x^2\) together:
      \[ 3x + x - 4x^2 + 5x^2 + 2 = (3+1)x + (-4+5)x^2 + 2 = 4x + x^2 + 2. \notag \]
      (You don't have to write the middle part there going forward, I'm just emphasizing why it works.)
    Exercise \(\PageIndex{2}\)
    1. Distribute: \( -3(x+y) \)
    2. Factor: \( 4x^2 + 2xy + 2y^2 \)
    3. Combine like terms: \( x^3 + 2x^2 +5x - x^3 - 4x^2 + x + 6 \)
    4. Combine like terms: \( 2a + 3ab - b^2 + 5a - ab + b - 8 \)
    Answer
    1. \( -3x - 3y \)
    2. \( 2( 2x^2 + xy + y^2) \)
    3. \( -2x^2 + 6x + 6 \)
    4. \( 7a + 2ab - b^2 + b - 8 \)

    This is all we need to learn how to add and subtract polynomials!

    Adding and Subtracting Expressions

    Example \(\PageIndex{2}\)

    1. Add the polynomials \( (2x^3 + x^2 - 4) \) and \((x^4 - x^2 + x + 5) \) and simplify

    2. Subtract the polynomials \( (x^4 - x + 1) \) and \((2x^4 - 3x^2 - x + 2) \) and simplify.

    Solution

    1. We put the polynomials together with an addition:

    \[ (2x^3 + x^2 - 4) + (x^4 - x^2 + x + 5) \notag \]

    We can ignore those parentheses and combine all the like terms we see:

    \[ 2x^3 \textcolor{red}{+ x^2} \textcolor{blue}{- 4} + x^4 \textcolor{red}{- x^2} + x \textcolor{blue}{+ 5} = x^4 + 2x^3 + 1 \notag \]

    2. We put the polys together with a minus:

    \[ (x^4 - x + 1) - (2x^4 - 3x^2 - x + 2) \notag \]

    Before losing those parentheses, notice the subtraction needs to apply to everything inside the second polynomial! "Distribute" that minus throughout, and then combine like terms:

    \[ x^4 - x + 1 - 2x^4 + 3x^2 + x - 2 = x^4 - 2x^4 + 3x^2 - x + x + 1 - 2 = -x^4 + 3x^2 -1 \notag \]

    I want to open up the floor to more than just polynomial expressions for this concept. The Distributive Property of Addition is an equal-opportunity employer.

    \[ 2e^x + 3e^x = (2+3) e^x = 5 e^x, \quad \quad \sqrt{2} + 3 \sqrt{2} = (1+3)\sqrt{2} = 4\sqrt{2}, \quad \quad 4xy + 8xy = (4+8)xy = 12xy \notag \]

    In this sense, the phrase "like terms" feels a little looser, but I hope morally and spiritually you can see how the rule still applies.

    Multiplying Expressions

    Armed with the Distributive Property (and color coding), we valiantly sally forth against this uggo: \( (a+b)(c+d) \).

    distribute.png

    First, I treat \( (a+b)\) as if it's just a number and distribute through the \( (c+d)\). Then I distribute the \(c\)... and then I distribute the \(d\). I never heard this growing up because I'm an aged lady of 30 years, but the kids these days call it FOIL, meaning you multiply the First terms from each expression together, then the Outer terms, then the Inner terms, and finally the Last terms of each expression.

    FOIL - First, Outer, Inner, Last

    \[ (a + b)(c+d) = ac + ad + bc + bd \notag \]

    Back in my day, I just thought of it as making everybody shake hands with everybody, which I like because it extrapolates well to dealing with more than just binomials. See below. Just make \(a\) shake hands with \(d\) and \(e\), and then make \(b\) shake hands with \(d\) and \(e\), and so on. As if they're two soccer teams passing by each other being sportsmanlike. This is called expanding, by the way.

    distributing more.png

    Anyways, analogies aside, do some practice below.

    Example \(\PageIndex{3}\)

    Expand and simplify.

    1. \( (x-2)(x+3) \)
    2. \( (3x + 1)(y - 2) \)
    3. \( (a^2 + 2a - b)(3c + 4a) \)
    4. \(4(x+1)(x+2)\)
    Solution
    1. FOIL gives \( x^2 + 3x - 2x - 6 \) and we combine like terms to get \( x^2 + x - 6 \).
    2. FOIL gives \( 3xy - 6x + y - 2 \) and there are no like terms to combine.
    3. Expanding yields
      \[ 3a^2c + 4a^3 + 6ac + 8a^2 - 3bc - 4ab \notag \]
    4. FOILing and distributing, \(4(x+1)(x+2) = 4(x^2 + 3x + 2) = 4x^2 + 12x + 8\).
    Exercise \(\PageIndex{3}\)

    Expand and simplify.

    1. \( (z + 5)(z-7) \)
    2. \( (x-1)(x^2 + 2x + 1) \)
    3. \( (a + b)(a + b) \)
    Answer
    1. \( z^2 -2z - 35 \)
    2. \( x^3 + x^2 -x - 1 \)
    3. \( a^2 + 2ab + b^2 \)

    That last part in the exercise...wait a second... That's right, \( (a+b)(a+b) = (a+b)^2 \)! Remember how I said if I ever see you trying to bring a power through parentheses like \( (a+b)^c \longrightarrow a^c + b^c \) I would mail you a dead fish? (Did I say that? Well, I will.) This is why it's illegal!!

    \[ (a+b)^2 = (a+b)(a+b), \quad (a+b)^3 = (a+b)(a+b)(a+b), \quad (a+b)^4 = (a+b)(a+b)(a+b)(a+b), \text{ etc.} \notag \]

    Computing powers like that requires a lot of expanding, and it is NOT the same as just applying the power to each term! However, for the most commonly used products and powers, you can become familiar with some handy formulas. Here's a table. You can check every single one of these by expanding by hand.

    Expression Expansion
    \(( A + B)(A-B) \) \( A^2 - B^2 \) (This is called a difference of squares)
    \( (A+B)^2 = (A+B)(A+B) \) \( A^2 + 2AB + B^2 \)
    \( (A-B)^2 = (A-B)(A-B) \) \( A^2 - 2AB + B^2 \)
    \( (A+B)^3 = (A+B)(A+B)(A+B) \) \( A^3 + 3A^2B + 3A B^2 + B^3 \)
    \( (A-B)^3 = (A-B)(A-B)(A-B) \) \( A^3 - 3A^2 B + 3 AB^2 - B^3 \)

    (For a good time, ask your professor about Pascal's Triangle if you're interested in how symmetrical those last couple formulas came out.)

    The nice thing here is that in those formulas, \(A\) and \(B\) are stand-ins for anything you want, be it variable or expression. Let me demonstrate.

    Example \(\PageIndex{4}\)

    Expand and simplify.

    1. \( (x+1)(x-1) \)
    2. \( (a + 7)^2 \)
    3. \( (3z - \sqrt{2})^2 \)
    4. \( (x + 2y)^3 \)
    5. \( (4^x + 2)(4^x - 2) \)
    Solution
    1. Using the first formula with \(A = x \) and \(B = 1\), we have \( x^2 - 1^2 = x^2 - 1 \).
    2. Using \( A = a\) and \(B = 7 \), we get \( a^2 + 2(7)(a) + 7^2 = a^2 + 14a + 49 \).
    3. Using \( A = (3z) \) and \(B = \sqrt{2} \), we get \( (3z)^2 - 2(3z)(\sqrt{2}) + (\sqrt{2})^2 = 9z^2 - 6z \sqrt{2} + 2 \).
    4. Using \( A = 4^x \) and \( B = 2 \), we get \( (4^x)^2 - 2^2 = 4^{2x} - 4 \).

    All right, that's what I got for you. Try these and then go for the exercise section!

    Exercise \(\PageIndex{4}\)

    Simplify.

    1. \( (x+2)(x-4) + (x^2 - 1) \)
    2. \( (2x + \sqrt{3})^2 \)
    3. \( (x^3 + x^2) - (7x^2 + 3x) \)
    4. \( (a + b)(c+d)^2 \)
    5. \( 2(x+y)^2 \)
    Answer
    1. \(3x^2 -2x -9 \)
    2. \( 4x^2 + 4x \sqrt{3} + 3 \)
    3. \( x^3 - 6x^2 - 3x \) (This one didn't require any FOILing.)
    4. Watch out, that's \( (a+b)(c+d)(c+d) \), which becomes \( (a+b)(c^2 + 2cd + d^2) = ac^2 + 2acd + ad^2 + bc^2 + 2bcd + bd^2 \).
    5. \( 2x^2 + 4xy + 2y^2 \)

    This page titled 2.1 Algebraic Expressions is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Lydia de Wolf.

    • Was this article helpful?