If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Adding and subtracting functions

See how we can add or subtract two functions to create a new function.
Just like we can add and subtract numbers, we can add and subtract functions. For example, if we had functions f and g, we could create two new functions: f, plus, g and f, minus, g.

Adding two functions

Example

Let's look at an example to see how this works.
Given that f, left parenthesis, x, right parenthesis, equals, x, plus, 1 and g, left parenthesis, x, right parenthesis, equals, x, squared, minus, 2, x, plus, 5, find left parenthesis, f, plus, g, right parenthesis, left parenthesis, x, right parenthesis.

Solution

The most difficult part of combining functions is understanding the notation. What does left parenthesis, f, plus, g, right parenthesis, left parenthesis, x, right parenthesis mean?
Well, left parenthesis, f, plus, g, right parenthesis, left parenthesis, x, right parenthesis just means to find the sum of f, left parenthesis, x, right parenthesis and g, left parenthesis, x, right parenthesis. Mathematically, this means that left parenthesis, f, plus, g, right parenthesis, left parenthesis, x, right parenthesis, equals, f, left parenthesis, x, right parenthesis, plus, g, left parenthesis, x, right parenthesis.
Now, this becomes a familiar problem.
(f+g)(x)=f(x)+g(x)                             Define.=(x+1)+(x22x+5)        Substitute.=x+1+x22x+5                Remove parentheses.=x2x+6                                Combine like terms.\begin{aligned} (f+g)(x) &= f(x)+g(x) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\small{\gray{\text{Define.}}}\\\\ &= \left(x+1\right)+\left(x^2-2x+5\right) ~~~~~~~~\small{\gray{\text{Substitute.}}}\\\\ &= x+1+x^2-2x+5~~~~~~~~~~~~~~~~\small{\gray{\text{Remove parentheses.}}}\\\\ &=x^2-x+6~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\small{\gray{\text{Combine like terms.}}} \end{aligned}

We can also see this graphically:

The images below show the graphs of y, equals, f, left parenthesis, x, right parenthesis, y, equals, g, left parenthesis, x, right parenthesis, and y, equals, left parenthesis, f, plus, g, right parenthesis, left parenthesis, x, right parenthesis.
From the first graph, we can see that f, left parenthesis, 2, right parenthesis, equals, start color #1fab54, 3, end color #1fab54 and that g, left parenthesis, 2, right parenthesis, equals, start color #11accd, 5, end color #11accd. From the second graph, we can see that left parenthesis, f, plus, g, right parenthesis, left parenthesis, 2, right parenthesis, equals, start color #e07d10, 8, end color #e07d10.
So f, left parenthesis, 2, right parenthesis, plus, g, left parenthesis, 2, right parenthesis, equals, left parenthesis, f, plus, g, right parenthesis, left parenthesis, 2, right parenthesis because start color #1fab54, 3, end color #1fab54, plus, start color #11accd, 5, end color #11accd, equals, start color #e07d10, 8, end color #e07d10.
Now you try it. Convince yourself that f, left parenthesis, 1, right parenthesis, plus, g, left parenthesis, 1, right parenthesis, equals, left parenthesis, f, plus, g, right parenthesis, left parenthesis, 1, right parenthesis.
Evaluate each expression.
f, left parenthesis, 1, right parenthesis, equals
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, start text, p, i, end text or 2, slash, 3, space, start text, p, i, end text
g, left parenthesis, 1, right parenthesis, equals
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, start text, p, i, end text or 2, slash, 3, space, start text, p, i, end text
left parenthesis, f, plus, g, right parenthesis, left parenthesis, 1, right parenthesis, equals
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, start text, p, i, end text or 2, slash, 3, space, start text, p, i, end text

Let's try some practice problems.

In problems 1 and 2, let a, left parenthesis, x, right parenthesis, equals, 3, x, squared, minus, 5, x, plus, 2 and b, left parenthesis, x, right parenthesis, equals, x, squared, plus, 8, x, minus, 10.

Problem 1

Find left parenthesis, a, plus, b, right parenthesis, left parenthesis, x, right parenthesis.

Problem 2

Evaluate left parenthesis, a, plus, b, right parenthesis, left parenthesis, minus, 1, right parenthesis.
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, start text, p, i, end text or 2, slash, 3, space, start text, p, i, end text

Subtracting two functions

Subtracting two functions works in a similar way. Here's an example:

Example

p, left parenthesis, t, right parenthesis, equals, 2, t, minus, 1 and q, left parenthesis, t, right parenthesis, equals, minus, t, squared, minus, 4, t, minus, 1.
Let's find left parenthesis, q, minus, p, right parenthesis, left parenthesis, t, right parenthesis.

Solution

Again, the most complicated part here is understanding the notation. But after working through the addition example, left parenthesis, q, minus, p, right parenthesis, left parenthesis, t, right parenthesis means just what you'd think!
By definition, left parenthesis, q, minus, p, right parenthesis, left parenthesis, t, right parenthesis, equals, q, left parenthesis, t, right parenthesis, minus, p, left parenthesis, t, right parenthesis. We can now solve the problem.
=(qp)(t)=q(t)p(t)Define.=(t24t1)(2t1)Substitute.=t24t12t+1Distribute negative sign.=t26tCombine like terms.\begin{aligned} &\phantom{=}(q-p)(t) \\\\ &=q(t)-p(t)\quad\small{\gray{\text{Define.}}} \\\\ &= (-t^2-4t-1)-(2t-1)\quad\small{\gray{\text{Substitute.}}}\\\\ &=-t^2-4t-1-2t+1\quad\small{\gray{\text{Distribute negative sign.}}}\\\\ &=-t^2-6t \quad\small{\gray{\text{Combine like terms.}}}\end{aligned}
So left parenthesis, q, minus, p, right parenthesis, left parenthesis, t, right parenthesis, equals, minus, t, squared, minus, 6, t, point

Let's try some practice problems.

Problem 3

j, left parenthesis, n, right parenthesis, equals, 3, n, cubed, minus, n, squared, plus, 8
k, left parenthesis, n, right parenthesis, equals, minus, 8, n, squared, plus, 3, n, minus, 5
Find left parenthesis, j, minus, k, right parenthesis, left parenthesis, n, right parenthesis.

Problem 4

g, left parenthesis, x, right parenthesis, equals, 4, x, squared, minus, 7, x, plus, 2
h, left parenthesis, x, right parenthesis, equals, 2, x, minus, 5
Evaluate left parenthesis, h, minus, g, right parenthesis, left parenthesis, 3, right parenthesis.
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
  • an exact decimal, like 0, point, 75
  • a multiple of pi, like 12, space, start text, p, i, end text or 2, slash, 3, space, start text, p, i, end text

An application

One college states that the number of men, M, and the number of women, W, receiving bachelor degrees t years since 1980 can be modeled by the functions M, left parenthesis, t, right parenthesis, equals, 526, minus, t and W, left parenthesis, t, right parenthesis, equals, 474, plus, 2, t, respectively.
Let N be the total number of students receiving bachelors degrees at that college t years since 1980.
Write an expression for N, left parenthesis, t, right parenthesis.
N, left parenthesis, t, right parenthesis, equals

Challenge problem

The graphs of y, equals, f, left parenthesis, x, right parenthesis and y, equals, g, left parenthesis, x, right parenthesis are plotted on the grid below.
Which is the graph of y, equals, left parenthesis, f, plus, g, right parenthesis, left parenthesis, x, right parenthesis?
Choose 1 answer:
Choose 1 answer:

Want to join the conversation?

  • female robot amelia style avatar for user Ben Feldman
    why is 4(-1)^2 = 4? Shouldn't it be 16 because -4x-4 = 16?
    (8 votes)
    Default Khan Academy avatar avatar for user
    • duskpin sapling style avatar for user Iris Nogueroles Langa
      Good question! You solve the exponent first because this comes before multiplication in the order of operations (BIDMAS) where...

      B = Brackets (parentheses)
      I = Index (exponent, power)
      D = Division
      M = Multiplication
      A = Addition
      S = Subtraction

      Since I comes before M, you solve (-1)^2 = (-1) x (-1) = 1 first and then you multiply 4 x 1 so that the final answer is 4.
      (16 votes)
  • blobby green style avatar for user 793186
    I do not understand any of the graph sections. They are all very confusing and I cannot seem to get it
    (6 votes)
    Default Khan Academy avatar avatar for user
    • purple pi teal style avatar for user Avishek
      Please tell me exactly what you have trouble getting? The graph section shows what is going on visually when you combine the two functions. If you don't get why one function is graphed as a straight line and another as a curve (parabola) then I recommend finishing algebra basics & algebra 1 sections before starting algebra 2.
      (7 votes)
  • starky ultimate style avatar for user Caleb
    Under the heading subtracting two functions isn't the final answer -t^2-6t?
    (5 votes)
    Default Khan Academy avatar avatar for user
  • aqualine seed style avatar for user Seo-gyeong Han
    After adding a quadratic function and a linear function together like the first graph, why does it show new quadratic function, not linear function? I want to know how to show function after adding two different kinds of functions.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • purple pi purple style avatar for user StarryNight
      The standard form of a quadratic equation is ax^2+bx+c. Note that this formula contains a linear equation in it - the bx. When you add a linear equation you're just adding to the bx of the quadratic function (and possibly, the c). The resulting equation will still be quadratic, since it will still contain an x^2. Therefore, its graph is still quadratic.
      (3 votes)
  • male robot hal style avatar for user Pranav
    In the first set of questions, they tell you to evaluate some expressions, but there is no graph until you click the help option. Can someone fix this please?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • spunky sam green style avatar for user Vijay
    The last question was pretty good. Can someone recommend any other questions like that?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Robby Johnson
    In question 4 for Method 2 the equation is simplified first and THEN the values are added in which completely change the outcome. If you add in the value of x=3 first you get -60 not -16. That is very confusing because that is now how it was taught in previous examples. Why is it changed up with no explanation?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user shyam.skgpl
    6-(5*3-(12)*16/(-8))
    (1 vote)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      Follow order of operations rules (PEMDAS)
      1) Start with the parentheses.
      -- Do 5*3
      -- Do -12 * 16, then divide that by -8
      -- Subtract these 2 results
      2) Last, do 6 - the result of the above steps.
      Give it a try. comment back if you get stuck.
      (2 votes)
  • duskpin ultimate style avatar for user Panda
    In problem one, the answer should have an exponent based on what i got, but i can't seem to make one........or does the answer not include an exponent...
    (1 vote)
    Default Khan Academy avatar avatar for user
  • mr pants teal style avatar for user Ethan Stofel
    On the video subtracting functions they say the final answer is x^2 (or something like that) plus 4 but when I did the math it should be plus 3
    (1 vote)
    Default Khan Academy avatar avatar for user