Quarry School

Combine two functions with arithmetic

Subject: MathematicsLeans on: SubstitutionLeans on: Subtracting parenthesesLeans on: FactoringLeans on: DomainLeans on: Shared factorLeans on: Multiplying powers
Level 2 · BuildingAbout 21 min read11 new terms
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Imagine two pay envelopes for the same year.

    Rule

    (f + g)(x) = f(x) + g(x); (f − g)(x) = f(x) − g(x); (fg)(x) = f(x)·g(x); (fg)(x) = f(x)g(x).
    Use inputs allowed by both functions; for the quotient also require g(x) ≠ 0.

    Step

    1. 1. Find the requested operation and its order. g − f means the g answer minus the f answer.

    2. 2. Use the same input in both original functions, because their outputs must refer to the same starting value.

    3. 3. Record where both formulas work and, for division, where the bottom output is nonzero.

    4. 4. Put each whole expression in parentheses before combining it. Simplify while keeping every original domain restriction.

    5. 5. Check one permitted input directly in the original functions.

    Question

    Let f(x) = x + 1 and g(x) = 2x. Find their sum, difference f − g, product, and quotient f divided by g at input 2. The question asks you to get both outputs at 2, then combine those outputs in four ways. Plan: evaluate both functions at the same input 2, combine their outputs in four ways, then derive the four combined formulas.

    Answer

    Sum: 7.
    Difference: −1.
    Product: 12.
    Quotient: 34.

    Trap

    Subtracting only the first term of a function. (x2 − 1) − (x − 1) subtracts the entire second expression, so both of its signs change.

    Strategy

    1. Write the accepted inputs of each original function. Keep inputs accepted by both.

    2. For a quotient, solve bottom function = 0 to locate the additional inputs to remove. Plug each proposed excluded input back into that bottom.

    3. Substitute the formulas with parentheses around the whole second expression.

    4. Simplify and keep all original exclusions. Check using the two original outputs.

    Term

    Function

    Definition

    A rule that gives exactly one output for each input it accepts.

    Term

    Input

    Definition

    The starting value you give a function. It goes inside the parentheses in function notation.

    Term

    Output

    Definition

    The answer a function produces from an accepted input.

    Term

    Evaluate

    Definition

    Find the output of a function or the value of an expression for a given input.

    Term

    Algebraic operations

    Definition

    The familiar actions of addition, subtraction, multiplication, and division, applied to numbers or expressions.

    Term

    Sum of functions

    Definition

    A new function that adds two outputs produced from the same input. Both original functions must accept that input.

    Term

    Difference of functions

    Definition

    A new function that subtracts one output from another at the same input. Subtract the entire second expression.

    Term

    Product of functions

    Definition

    A new function that multiplies two outputs produced from the same input. Both original functions must accept that input.

    Term

    Quotient of functions

    Definition

    A new function that divides two outputs at the same input. Both outputs must exist, and the bottom output must not be zero.

    Term

    Ratio

    Definition

    A comparison made by division. The first amount is divided by the second, so the second must not be zero.

    Term

    Domain

    Definition

    All inputs for which a function is defined.

    Term

    Inner function

    Definition

    The function evaluated first in a composition. Its output becomes the next function's input.

    Term

    Outer function

    Definition

    The function evaluated second in a two-function composition. It receives the inner function's output.

    Term

    Substitution

    Definition

    Replacing a variable with a number or expression everywhere that variable appears. Parentheses hold a multi-term replacement together.

    Term

    Reciprocal

    Definition

    One divided by a nonzero number. A fraction's reciprocal swaps its top and bottom, and their product is 1.

    Term

    Decomposition

    Definition

    Writing a function as a composition of simpler functions by naming an inside job and an outside job.

    Term

    Intersection

    Definition

    The values shared by all the sets or conditions being combined.

    Term

    Formula

    Definition

    A written rule using numbers, symbols, and operations to describe how a quantity is calculated.

    Term

    Table

    Definition

    An organized display of matching values. In a function table, each input and its output share a column or row.

    Term

    Graph

    Definition

    A picture of coordinate pairs. A function graph shows each input horizontally and its output vertically.

    Term

    Denominator

    Definition

    The bottom of a fraction. It names the divisor and cannot be zero.

    Term

    Real number

    Definition

    A number on the ordinary number line, including negatives, zero, fractions, and numbers such as 2.

    Term

    Nonnegative

    Definition

    Greater than or equal to zero. Zero is included, while positive means greater than zero and excludes zero.

    Term

    Difference of squares

    Definition

    One squared expression minus another. It factors into the first expression minus the second, times the first plus the second.

    Term

    Factor

    Definition

    One of the quantities multiplied together in a product.

    Term

    Factoring

    Definition

    Rewriting an expression as a product of factors without changing its value.

    Term

    Cancellation

    Definition

    Dividing a fraction's top and bottom by the same nonzero factor. It preserves the value on the original domain.

    Term

    Fraction

    Definition

    One number divided by another nonzero number. The top is divided by the bottom; equal pieces give a picture of its size.

    Term

    Linear

    Definition

    A formula built from a constant times the input plus a constant. Its graph is a straight line.

    Term

    Constant function

    Definition

    A function that gives the same output for every input it accepts.

    Term

    Hole

    Definition

    One missing graph point, shown with an open dot. Its input does not have that plotted value.

    Term

    Solve

    Definition

    Find every input that makes a stated equality or inequality true. This differs from evaluating at a given input.

    Term

    Endpoint

    Definition

    A boundary number at an end of an interval. A bracket includes it; a parenthesis leaves it out.

    Term

    Like terms

    Definition

    Terms with the same variable part and powers. Their number factors can be added or subtracted.

    Term

    Distribute

    Definition

    Multiply each term inside parentheses by the outside factor.

    Term

    Numerator

    Definition

    The top of a fraction. It is the amount divided by the denominator.

    Term

    Power

    Definition

    The result of repeatedly multiplying a number or expression by itself. A positive whole-number exponent counts the copies.

    1 In plain words

    Imagine two pay envelopes for the same year. One person earned f(x) dollars and another earned g(x) dollars. To find their household income, you open both envelopes and add the amounts. You use the same year for both people. Algebraic operations on functions work this way: get two answers at the same input, then add, subtract, multiply, or divide those answers. You are making a new function from two old ones. A sum of functions adds the outputs. A difference of functions subtracts them. A product of functions multiplies them. A quotient of functions divides them, provided the bottom answer is not zero.

    2 Picture it

    f(2) = 3g(2) = 424−22468f(2) = 3g(2) = 4−11234−22468
    At shared input 2, the solid line gives height 3 and the dashed line gives height 4; their sum is 7.

    Reminder

    Reminder: Substitution, Subtracting parentheses, Factoring, Domain, Shared factor, Multiplying powers
    • Substitution. Replace the input letter everywhere: x2 − 1 at x = 3 gives 32 − 1 = 8.
    • Subtracting parentheses. A minus outside reverses every sign: −(x − 1) = −x + 1.
    • Factoring. x2 − 1 = (x − 1)(x + 1), because the middle terms cancel when multiplied.
    • Domain. A denominator cannot be zero: 1x−1 excludes x = 1.
    • Shared factor. x2 − x = x·x − x·1 = x(x − 1). Distributing x rebuilds the two terms.
    • Multiplying powers. x·x2 = x·x·x = x3, because three copies of x are multiplied.

    3 Why

    Each original function gives exactly one output at an allowed input. Arithmetic then combines those two numbers into one new answer, so the result is another function. Both original answers must exist: an unavailable answer cannot be added or multiplied. Division needs one more check, because no number multiplied by zero can give a nonzero numerator. Units also matter. Two incomes measured in dollars can be added. Dollars and hours describe different things, so their sum would not represent a meaningful total.

    4 The rule

    (f+g)(x)=f(x)+g(x); (f−g)(x)=f(x)−g(x); (fg)(x)=f(x)·g(x); (fg)(x)=f(x)g(x).

    Use inputs allowed by both functions; for the quotient also require g(x)≠0.

    The same idea, five ways

    Say it

    f plus g of x; f times g of x; f divided by g of x

    Write it

    Put one input into both recipes, then combine their two outputs.

    In math
    • (f + g)(x) = f(x) + g(x)
    • (f−g)(x)=f(x)−g(x)
    • (fg)(x) = f(x)·g(x)
    • (fg)(x)=f(x)g(x)
    • f + g names a recipe; (f + g)(2) names its output at 2
    Like

    Two pay envelopes for the same year.

    See it

    (f + g)(2) = f(2) + g(2)

    (fg)(2) = f(2)·g(2)

    The final parentheses hold the input 2

    The same idea, other ways

    As two envelopes

    At one year, open both pay envelopes. Adding their amounts gives the total for that year; using different years would answer a different question. At year 2, the two incomes are 38400 and 43600 dollars. Together they give 82000 dollars in the pictured household column.

    input youtput I(y)078000180000282000384000486000588000↓ evaluate: input given, read the output below it
    Each household output adds the two incomes in that year.
    With two small outputs

    If f(2) = 3 and g(2) = 4, the sum at 2 is 7 and the product at 2 is 12. You combine 3 and 4 after evaluating, rather than putting 3 through g.

    1234
    Multiplying output 3 by output 4 gives 12; a product uses both outputs independently.

    Part 1: Sum of functions

    A sum collects two amounts. If f and g represent incomes in the same currency and year, their sum is household income. Both amounts must exist before you can add them.

    • (f + g)(x) = f(x) + g(x).
    • The domain is the intersection of the original domains: inputs accepted by both.
    • The shared input may be a date or an item name instead of a number; both outputs must be real numbers.
    • Addition and subtraction need matching units or two unitless outputs. If two price rules for the same book give 12 dollars and 8 dollars, their sum is 20 dollars because the quantities match.

    f(x) = x + 1

    g(x) = 2x

    (f + g)(x) = 3x + 1

    Reminder

    Reminder: Function notation
    • Function notation. The name chooses a recipe and the parentheses supply its input: f(3) is the f output at input 3.

    The same idea, five ways

    Say it

    Sum of functions

    Write it

    A sum collects two amounts. If f and g represent incomes in the same currency and year, their sum is household income. Both amounts must exist before you can add them.

    In math
    • (f + g)(x) = f(x) + g(x).
    • The domain is the intersection of the original domains: inputs accepted by both.
    • The shared input may be a date or an item name instead of a number; both outputs must be real numbers.
    • Addition and subtraction need matching units or two unitless outputs. If two price rules for the same book give 12 dollars and 8 dollars, their sum is 20 dollars because the quantities match.
    Like

    A sum collects two amounts. If f and g represent incomes in the same currency and year, their sum is household income. Both amounts must exist before you can add them.

    See it

    f(x) = x + 1

    g(x) = 2x

    (f + g)(x) = 3x + 1

    Worked example

    Add formulas

    For f(x) = x + 1 and g(x) = 2x, find (f + g)(x). You want one formula for the total output at any input. Plan: use the quantity or input named in the question, write the first result, then finish the stated operation.

    Show the steps and the answer
    23x + 1inputoutput7
    The sum formula matches adding the separate outputs.
    1. (f+g)(x)=(x+1)+2x.A sum adds the original function outputs.
    2. x+2x+1=3x+1.One x and two x amounts make three x amounts.
    Answer
    (f + g)(x) = 3x + 1, for every real x.
    Double-check At x = 2, f(2) + g(2) = 3 + 4 = 7 and 3(2) + 1 = 7.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: f(2) + g(3) is (f + g)(2).
    The g function received a different input.
    ✓ Instead: (f + g)(2) uses f(2) + g(2).

    Tips and tricks

    • Write the input beside both function names before adding.

    Part 2: Difference of functions

    A difference compares two outputs at one input. Think of money earned minus money spent in one month. Subtract the whole second amount, including every term in its formula. In a cup-selling model, profit is revenue minus cost. If R(x) = 3x and C(x) = 0.75x + 18 dollars, profit is 2.25x − 18 dollars. At 24 cups, 72 dollars earned minus 36 dollars spent leaves 36 dollars.

    • (g−f)(x)=g(x)−f(x).
    • Subtraction order matters: a − b and b − a usually differ.

    (g−f)(x)=(x2−1)−(x−1)

    =x2−1−x+1

    =x2−x=x(x−1)

    Reminder

    Reminder: Pulling out a factor
    • Pulling out a factor. x2 − x = x·x − x·1 = x(x − 1), because both terms contain x.

    The same idea, five ways

    Say it

    Difference of functions

    Write it

    A difference compares two outputs at one input. Think of money earned minus money spent in one month. Subtract the whole second amount, including every term in its formula. In a cup-selling model, profit is revenue minus cost. If R(x) = 3x and C(x) = 0.75x + 18 dollars, profit is 2.25x − 18 dollars. At 24 cups, 72 dollars earned minus 36 dollars spent leaves 36 dollars.

    In math
    • (g−f)(x)=g(x)−f(x).
    • Subtraction order matters: a − b and b − a usually differ.
    Like

    A difference compares two outputs at one input. Think of money earned minus money spent in one month. Subtract the whole second amount, including every term in its formula. In a cup-selling model, profit is revenue minus cost. If R(x) = 3x and C(x) = 0.75x + 18 dollars, profit is 2.25x − 18 dollars. At 24 cups, 72 dollars earned minus 36 dollars spent leaves 36 dollars.

    See it

    (g−f)(x)=(x2−1)−(x−1)

    =x2−1−x+1

    =x2−x=x(x−1)

    Worked example

    Subtract the whole linear formula

    OpenStax problem

    Let f(x) = x − 1 and g(x) = x2 − 1. Find (g − f)(x). You want the g output minus the whole f output. Plan: keep the second output in parentheses, change both of its signs, then collect matching terms.

    Show the steps and the answer

    (x2−1)−(x−1)

    =x2−1−x+1

    =x2−x

    1. (g−f)(x)=(x2−1)−(x−1).The requested order is g minus f.
    2. =x2−1−x+1.Subtracting x − 1 means adding its opposite, −x + 1.
    3. =x2−x=x(x−1).The constants −1 and +1 cancel, and both remaining terms contain a factor x.
    Answer
    (g − f)(x) = x2 − x = x(x − 1), for every real x.
    Double-check At x = 3, g(3) − f(3) = 8 − 2 = 6; 32 − 3 = 6.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: (x2−1)−(x−1)=x2−x−2.
    The final −1 was subtracted, so it becomes +1.
    ✓ Instead: x2−1−x+1=x2−x.

    Tips and tricks

    • Put parentheses around the second function before distributing the subtraction.

    Part 3: Product of functions

    A product multiplies two outputs at the same input. If one output is a price per ticket and the other is the number of tickets, their product is the total price. Multiplication may change the units.

    • (fg)(x) = f(x)·g(x).
    • The product needs both functions defined, but an output of zero is allowed.
    x³x2x²2x²
    An area model with sides x + 2 and x2.

    Reminder

    Reminder: Function notation
    • Function notation. The name chooses a recipe and the parentheses supply its input: f(3) is the f output at input 3.

    The same idea, five ways

    Say it

    Product of functions

    Write it

    A product multiplies two outputs at the same input. If one output is a price per ticket and the other is the number of tickets, their product is the total price. Multiplication may change the units.

    In math
    • (fg)(x) = f(x)·g(x).
    • The product needs both functions defined, but an output of zero is allowed.
    Like

    A product multiplies two outputs at the same input. If one output is a price per ticket and the other is the number of tickets, their product is the total price. Multiplication may change the units.

    See it
    x³x2x²2x²
    The same picture again: An area model with sides x + 2 and x2.

    Worked example

    Multiply a line by a square

    Let f(x) = x + 2 and g(x) = x2. Find (fg)(x). You want to multiply their outputs at the same x. Plan: use the quantity or input named in the question, write the first result, then finish the stated operation.

    Show the steps and the answer

    (x+2)x2

    =x3+2x2

    1. (fg)(x)=(x+2)x2.The product multiplies f(x) by g(x).
    2. =x·x2+2·x2=x3+2x2.Distribution multiplies both terms, and x times x2 contains three factors x.
    Answer
    (fg)(x) = x3 + 2x2, for every real x.
    Double-check At x = 2, f(2)g(2) = 4 × 4 = 16; 23 + 2(22) = 8 + 8 = 16.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: (fg)(x) means f(g(x)).
    The product multiplies outputs; composition passes one output into another function.
    ✓ Instead: (fg)(x) = (x + 2)x2.

    Tips and tricks

    • A multiplication dot belongs between the two output expressions.

    Part 4: Quotient of functions

    A quotient is a ratio: one output divided by another at the same input. The denominator is the bottom expression. It must not be zero, even if later cancellation makes the formula look harmless. The same cost model gives average cost per cup as 0.75x+18x, for x > 0 cups. At 24 cups, 3624 = 32 dollars per cup. Zero cups cannot supply a cost per cup because division by zero fails.

    • (gf)(x) = g(x)f(x), with both functions defined and f(x) ≠ 0.
    • Equal functions need matching domains and matching outputs, not only matching simplified formulas.
    1excluded(−∞, 1) ∪ (1, ∞)
    (−∞, 1) and (1, ∞) on a number line.

    Reminder

    Reminder: Function notation
    • Function notation. The name chooses a recipe and the parentheses supply its input: f(3) is the f output at input 3.

    The same idea, five ways

    Say it

    Quotient of functions

    Write it

    A quotient is a ratio: one output divided by another at the same input. The denominator is the bottom expression. It must not be zero, even if later cancellation makes the formula look harmless. The same cost model gives average cost per cup as 0.75x+18x, for x > 0 cups. At 24 cups, 3624 = 32 dollars per cup. Zero cups cannot supply a cost per cup because division by zero fails.

    In math
    • (gf)(x) = g(x)f(x), with both functions defined and f(x) ≠ 0.
    • Equal functions need matching domains and matching outputs, not only matching simplified formulas.
    Like

    A quotient is a ratio: one output divided by another at the same input. The denominator is the bottom expression. It must not be zero, even if later cancellation makes the formula look harmless. The same cost model gives average cost per cup as 0.75x+18x, for x > 0 cups. At 24 cups, 3624 = 32 dollars per cup. Zero cups cannot supply a cost per cup because division by zero fails.

    See it
    1excluded(−∞, 1) ∪ (1, ∞)
    The same picture again: (−∞, 1) and (1, ∞) on a number line.

    Worked example

    Cancel without restoring the forbidden input

    OpenStax problem

    For f(x) = x − 1 and g(x) = x2 − 1, find (gf)(x). You want the g output divided by the f output and the inputs where that division works. Plan: use the quantity or input named in the question, write the first result, then finish the stated operation.

    Show the steps and the answer

    x2−1x−1

    =(x+1)(x−1)x−1

    = x + 1 only when x ≠ 1

    1. (gf)(x)=x2−1x−1. Require x≠1.The original bottom x − 1 is zero at 1.
    2. x2−1=(x+1)(x−1).Multiplying these factors gives x2 − x + x − 1, so the middle terms cancel.
    3. (x+1)(x−1)x−1=x+1, while keeping x≠1.A common nonzero factor can be divided out; at 1 that factor is zero, so cancellation was never legal there.
    Answer
    • (gf)(x) = x + 1, with x ≠ 1.
    • Domain: (−∞, 1) ∪ (1, ∞).
    Double-check At x = 3, g(3)f(3) = 82 = 4 and x + 1 = 4. At x = 1 the original expression is 00, so it has no defined quotient.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: The quotient is the unrestricted function x + 1.
    That line accepts input 1, but the original quotient does not.
    ✓ Instead: Use x + 1 with x ≠ 1; the domain is part of the function.

    Tips and tricks

    • Write excluded inputs before factoring.

    5 How

    1. Find the requested operation and its order. g − f means the g answer minus the f answer.
    2. Use the same input in both original functions, because their outputs must refer to the same starting value.
    3. Record where both formulas work and, for division, where the bottom output is nonzero.
    4. Put each whole expression in parentheses before combining it. Simplify while keeping every original domain restriction.
    5. Check one permitted input directly in the original functions.

    Combine two functions and keep their domains

    1
    Is the operation division?
    YesAlso remove every input giving a zero bottom output before canceling.
    NoUse the overlap of the original domains.
    ↓
    2
    Did cancellation hide a forbidden input?
    YesKeep it excluded; a shorter formula cannot restore a missing original output.
    NoKeep the domain you recorded.
    1. Write the accepted inputs of each original function. Keep inputs accepted by both.
    2. For a quotient, solve bottom function = 0 to locate the additional inputs to remove. Plug each proposed excluded input back into that bottom.
    3. Substitute the formulas with parentheses around the whole second expression.
    4. Simplify and keep all original exclusions. Check using the two original outputs.

    6 Worked example

    Worked example

    The same input, four different combinations

    Let f(x) = x + 1 and g(x) = 2x. Find their sum, difference f − g, product, and quotient f divided by g at input 2. The question asks you to get both outputs at 2, then combine those outputs in four ways. Plan: evaluate both functions at the same input 2, combine their outputs in four ways, then derive the four combined formulas.

    Show the steps and the answer

    Same input: 2

    f(2) = 3; g(2) = 4

    3+4=7;3−4=−1

    3×4=12;3÷4=34

    1. f(2)=2+1=3 and g(2)=2×2=4.Both functions receive input 2, so both answers describe that same input.
    2. (f+g)(2)=3+4=7.The sum adds the two outputs.
    3. (f−g)(2)=3−4=−1.The written order puts the f output first.
    4. (fg)(2)=3×4=12.The product multiplies the outputs.
    5. (fg)(2)=34.The quotient divides the f output by the nonzero g output.
    6. As formulas, (f+g)(x)=(x+1)+2x=3x+1 and (f−g)(x)=(x+1)−2x=1−x.Only matching x terms combine; the written subtraction order stays fixed.
    7. (fg)(x)=(x+1)(2x)=2x2+2x, and (fg)(x)=x+12x, requiring x≠0.Distribution multiplies both terms. The quotient removes the input 0 that makes 2x zero.
    Answer
    • Sum: 7.
    • Difference: −1.
    • Product: 12.
    • Quotient: 34.
    Double-check Undo each output operation at input 2: 7 − 4 = 3 checks the sum; −1 + 4 = 3 checks the difference; 12 ÷ 4 = 3 checks the product; 34 × 4 = 3 checks the quotient. The four combined formulas derived above also give these answers at 2.

    Ladder: from easy to exam-hard

    Try each rung before you open its steps.

    Rung 1 of 6

    Subtract one constant output

    Let p(x) = x + 5 and q(x) = 2. This is a constant function: it returns the same output 2 for every input. Find (p − q)(x). You want the first output minus 2. Plan: write the original outputs with parentheses, record any forbidden input, then simplify and check.

    Show the steps and the answer
    0x + 3inputoutput3
    Subtracting a constant shifts the output by that amount.
    1. (p−q)(x)=(x+5)−2.Subtraction acts on the two outputs.
    2. =x+3.5−2=3.
    Answer
    x + 3, for every real x.
    Double-check At 0, 5 − 2 = 3, matching 0 + 3.

    Rung 2 of 6

    Subtract a whole function: (g − f)(x)

    Let f(x) = x2 − 5x + 2 and g(x) = 3x2 + x − 5. Find (g − f)(x), simplify it, and state its domain. Then check your formula at x = 2 using the original functions.

    Show the steps and the answer
    1. Find the operation and its order: (g−f)(x) means the g output minus the f output, g(x)−f(x).Subtraction does not commute: f − g would give the opposite of every value. Here f is listed first in the problem, but it must go second.
    2. Use the same input x in both original functions: g(x)=3x2+x−5 and f(x)=x2−5x+2.(g − f)(x) subtracts two outputs that come from one starting value, so both formulas must use that same x.
    3. Record where both formulas work. f and g are polynomials, so each accepts every real number. This is a difference, not a quotient, so no bottom output has to be kept nonzero. Domain of g−f: all real numbers, (−∞,∞).An input is allowed in g − f exactly when it is allowed in both g and f. The extra nonzero condition applies only to division.
    4. Put each whole expression in parentheses: (g−f)(x)=(3x2+x−5)−(x2−5x+2).The minus sign subtracts all of f(x), not just its first term. The parentheses keep the three terms of f(x) together.
    5. Distribute the minus sign to every term in the second parentheses: 3x2+x−5−x2+5x−2.Subtracting (x2 − 5x + 2) is the same as adding −x2 + 5x − 2, so all three signs flip. Dropping the parentheses would subtract only the x2 and give the wrong answer 2x2 − 4x − 3.
    6. Combine like terms: (3x2−x2)+(x+5x)+(−5−2)=2x2+6x−7.Only terms with the same power of x combine. Neither f nor g had a restriction, so the domain is still all real numbers after simplifying.
    7. Check x=2 directly in the original functions: g(2)=3(2)2+2−5=9 and f(2)=(2)2−5(2)+2=−4, so g(2)−f(2)=9−(−4)=13. The formula gives 2(2)2+6(2)−7=8+12−7=13, so they match.Working from f and g separately tests the order and every sign change. The dropped-parentheses answer would give −3 here, and the reversed order f − g would give −13.
    Answer
    • (g−f)(x)=2x2+6x−7
    • domain: all real numbers, (−∞, ∞).
    Double-check At x = 2: g(2) − f(2) = 9 − (−4) = 13, and 2(2)2 + 6(2) − 7 = 13. At x = −1: g(−1) = 3(−1)2 + (−1) − 5 = −3 and f(−1) = (−1)2 − 5(−1) + 2 = 8, so g(−1) − f(−1) = −3 − 8 = −11, and 2(−1)2 + 6(−1) − 7 = 2 − 6 − 7 = −11. Both inputs agree.

    Work to write

    1. (g−f)(x)=g(x)−f(x)
    2. (g−f)(x)=(3x2+x−5)−(x2−5x+2)
    3. =3x2+x−5−x2+5x−2
    4. =2x2+6x−7
    5. Domain: all real numbers, (−∞, ∞), because f and g are polynomials and there is no division
    6. Check x = 2: g(2) − f(2) = 9 − (−4) = 13 and 2(2)2 + 6(2) − 7 = 13

    Rung 3 of 6

    Factor a difference of squares

    Rewrite x2 − 16 as a product. You want two factors whose multiplication recreates the original expression. Plan: recognize x2 − 42, use the difference and sum of x and 4, then multiply to check.

    Show the steps and the answer
    x²4xx−4x−16−4x4
    The opposite middle terms disappear when added.
    1. 16=42, so x2−16=x2−42.This is a difference of two squares.
    2. x2−42=(x−4)(x+4).Expanding gives x2 + 4x − 4x − 16; the middle terms cancel.
    Answer
    (x−4)(x+4).
    Double-check At x = 6, 36 − 16 = 20 and (6 − 4)(6 + 4) = 2 × 10 = 20.

    Rung 4 of 6

    Factor and retain the hole

    Let p(x) = x2 − 16 and q(x) = x − 4. Find (pq)(x) and its domain. You want a quotient formula and every permitted input. Plan: write the original outputs with parentheses, record any forbidden input, then simplify and check.

    Show the steps and the answer
    4hole(−∞, 4) ∪ (4, ∞)
    The open dot keeps the original excluded input visible.
    1. Start with x2−16x−4 and record x≠4.The original denominator must be nonzero.
    2. Factor the top: (x−4)(x+4)x−4.x2 − 16 is a difference of squares.
    3. Cancel the factor x−4 to obtain x+4, still with x≠4.The cancellation divides by a factor known to be nonzero only on that restricted domain.
    Answer
    • (pq)(x)=x+4,x≠4.
    • Domain: (−∞, 4) ∪ (4, ∞).
    Double-check At 6 the original quotient is 202 = 10, matching 6 + 4. Input 4 still produces 00 in the original quotient.

    Rung 5 of 6

    A product and a quotient with two original exclusions

    Let p(x) = x − 3 and q(x) = x2 − 9. Find (pq)(x), (pq)(x), their domains, and whether they are the same function. You want to multiply the outputs, then divide them. Plan: identify the original bottom zeros before factoring or canceling.

    Show the steps and the answer
    −33(−∞, −3) ∪ (−3, 3) ∪ (3, ∞)
    Both original bottom zeros, −3 and 3, remain open after cancellation.
    1. (pq)(x)=(x−3)(x2−9).A product multiplies outputs at one shared input.
    2. =x·x2+x(−9)+(−3)x2+(−3)(−9).Every term in the first group multiplies every term in the second.
    3. =x3−9x−3x2+27=x3−3x2−9x+27.x·x2 contains three x factors, and two negative factors make positive 27.
    4. For the quotient, start with x−3x2−9. Solve x2−9=0, so x2=9 and x=3 or x=−3.This finds both inputs that would make the original bottom zero, so both must be removed.
    5. Check: 32−9=0 and (−3)2−9=0. Exclude both 3 and −3.Substitution confirms that both original divisions fail.
    6. Factor x2−9=(x−3)(x+3). Then x−3(x−3)(x+3)=1x+3, with both exclusions retained.Canceling a common nonzero factor preserves outputs only where the original quotient existed.
    7. At x=4, (pq)(4)=1×7=7 and (pq)(4)=17.Two different outputs at one shared allowed input prove the functions are different.
    Answer
    • (pq)(x) = x3 − 3x2 − 9x + 27, domain (−∞, ∞).
    • (pq)(x) = 1x+3, domain (−∞, −3) ∪ (−3, 3) ∪ (3, ∞).
    • They are different functions.
    Double-check At 4, the expanded product gives 64 − 48 − 36 + 27 = 7. The shorter quotient gives 14+3 = 17. At 3 its original form is 00, so 3 stays excluded.

    Rung 6 of 6

    The domains of the two ingredients differ

    Let f(x) = x+6 and g(x) = 2x−5. Find f + g, f − g, fg, f/g and g/f with their domains. You want formulas and the inputs each operation can accept. Plan: overlap the two original domains, then remove any zero bottom output for each quotient.

    Show the steps and the answer
    −65[−6, 5) ∪ (5, ∞)
    The overlap includes the root boundary −6 but excludes the fraction input 5.
    1. f needs x+6≥0, so x≥−6. g needs x−5≠0, so x≠5.The root requires a nonnegative inside, and the fraction requires a nonzero bottom.
    2. The overlap is [−6,5)∪(5,∞).Arithmetic needs both original outputs at the same starting input.
    3. (f+g)(x)=x+6+2x−5; (f−g)(x)=x+6−2x−5; (fg)(x)=2x+6x−5.Apply the requested operation to the two complete outputs.
    4. For f/g, g(x) never equals zero on its domain, since its top is 2. Thus (fg)(x)=x+6×x−52=(x−5)x+62.Division multiplies by the reciprocal of the nonzero bottom output.
    5. For g/f, also require x+6≠0. It equals zero at x=−6, because −6+6=0. Remove −6.This finds and confirms the extra starting input that would make the quotient bottom zero.
    6. (gf)(x)=2(x−5)x+6, with domain (−6,5)∪(5,∞).The bottom combines the original fraction bottom and the root output; both must stay nonzero.
    Answer
    • (f + g)(x) = x+6 + 2x−5, domain [−6, 5) ∪ (5, ∞).
    • (f − g)(x) = x+6 − 2x−5, domain [−6, 5) ∪ (5, ∞).
    • (fg)(x) = 2x+6x−5, domain [−6, 5) ∪ (5, ∞).
    • (fg)(x) = (x−5)x+62, domain [−6, 5) ∪ (5, ∞).
    • (gf)(x) = 2(x−5)x+6, domain (−6, 5) ∪ (5, ∞).
    Double-check At −6, f gives 0 and g gives −211, so their sum exists and equals −211. The quotient g/f fails because its bottom output is 0. At 5, g fails before any arithmetic, so even the shorter f/g formula cannot use 5.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: A product must exclude inputs where either output is zero.
    Multiplication by zero has the valid answer zero. Only division forbids a zero bottom.
    ✓ Instead: A product requires both functions to be defined; a quotient additionally requires its denominator output to be nonzero.
    ✗ Not this: (f + g)(2) = 2f + 2g.
    f and g name recipes. The final parentheses supply input 2 to both recipes rather than multiplying the recipes.
    ✓ Instead: (f + g)(2) = f(2) + g(2) = 3 + 4 = 7 in the main example.
    ✗ Not this: After x−3x2−9 becomes 1x+3, only −3 is excluded.
    At x = 3, the original expression is 00. Canceling has hidden that failed input.
    ✓ Instead: Keep x ≠ −3 and x ≠ 3 in the simplified quotient.
    ✗ Not this: The domain of f + g for the last rung is [−6, ∞).
    At x = 5, g gives 20, so there is no second output to add.
    ✓ Instead: Both original domains must hold: [−6, 5) ∪ (5, ∞).

    Tips and tricks

    • Know cold.
      Arithmetic gives both functions the same input. Memory cue: same input, two answers, one operation.
      Composition runs the inner function first. Memory cue: read ∘ as after, so f ∘ g means f after g.
      Replace every input slot with the whole expression. Memory cue: every slot gets the whole package.
      Check both domain gates. Memory cue: gate 1 checks x, gate 2 checks the first answer.
      An ordinary root permits zero; a denominator forbids it. Memory cue: root zero can stay, bottom zero goes away.
      When decomposing, identify the last operation. Memory cue: the last calculator step is the outer function.
    • Understand, then rebuild when needed.
      Expanded sums, products, factorizations, and composition formulas can be recreated with substitution and distribution. Do not memorize each final formula.
      Rebuild a table or graph path by carrying the inner output to the outer input.
      Rebuild domain intervals from the allowed points and the endpoint checks.
      Rebuild a decomposition by identifying the final operation, then recomposing to check.
    • Put on the cheat sheet for study.
      Arithmetic: (f + g)(x) = f(x) + g(x); (f − g)(x) = f(x) − g(x); (fg)(x) = f(x)·g(x); (fg)(x) = f(x)g(x). Use the shared domain, with g(x) ≠ 0 for the quotient.
      Composition: (f ∘ g)(x) = f(g(x)). Its domain keeps x allowed by g and g(x) allowed by f.
      Roots: A needs A ≥ 0; 1A needs A > 0.
      Square expansion: (a + b)2 = a2 + 2ab + b2. Difference of squares: a2 − b2 = (a − b)(a + b).
      Intervals: brackets include finite endpoints, parentheses exclude them, and infinity always takes parentheses.
      This is a study sheet. For a closed-book exam, practice recalling the short definitions and rebuilding the rest without looking.
    • A function name before parentheses means input: f(2) reads f of 2. A number before parentheses means multiplication: 3(2) = 6.

    7 The trap

    Subtracting only the first term of a function. (x2 − 1) − (x − 1) subtracts the entire second expression, so both of its signs change.

    Problems marked OpenStax come from Precalculus 2e by Jay Abramson, published by OpenStax, under the CC BY-NC-SA 4.0 licence. Access for free at https://openstax.org/books/precalculus-2e/pages/1-introduction-to-functions.