Operations with functions: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 29: | Line 29: | ||
<math>(f \circ g)(x) = f(g(x))</math> | <math>(f \circ g)(x) = f(g(x))</math> | ||
The idea of composing a function is quite simple. We can nest as many functions as we want. The domain of the | The idea of composing a function is quite simple. We can nest as many functions as we want. Careful here! The domain of <math>f(g(x))</math> cannot surpass the domain of <math>g(x)</math> or the domain of <math>f(x)</math>. Forbidden inputs for <math>g(x)</math> may not be forbidden for <math>f(x)</math>, but we have to remember that we are calculating <math>g(x)</math> first and then <math>f</math> receives <math>g</math> to calculate something else. | ||
In all the previous cases we have the same condition about the domains of each function. If the intersection is empty, we can't perform the operation at all. The composite case for example. If <math>g(x) = -x^2 - 1</math> and <math>f(x) = \sqrt{x}</math> we can't compose them in the order <math>f(g(x))</math> because it won't produce any results and the graph won't exist at all for all real numbers. | In all the previous cases we have the same condition about the domains of each function. If the intersection is empty, we can't perform the operation at all. The composite case for example. If <math>g(x) = -x^2 - 1</math> and <math>f(x) = \sqrt{x}</math> we can't compose them in the order <math>f(g(x))</math> because it won't produce any results and the graph won't exist at all for all real numbers. |
Latest revision as of 17:32, 25 August 2022
Most textbooks have a section or chapter dedicated to proving the properties of real numbers. This is done because they are also true for functions and because the properties themselves are required to do the calculations. In linear algebra we learn the concept of vector spaces and that functions can obey to the same properties of one.
In this page I'm going to show how to operate with functions. Better say, how to read operations with functions. There are teachers of calculus that do exactly what I'm going to do, but others just assume that you already know it and skip it.
All textbooks have proofs for the same operations when doing calculations with limits, derivatives and integrals. As long as you are able to read and write operations with functions, extending it to limits, derivatives and integrals is quite natural.
Addition of functions
Let's say we have [math]\displaystyle{ f(x) = a }[/math] and [math]\displaystyle{ g(x) = b }[/math]. Suppose they are both different functions and [math]\displaystyle{ a \neq b \neq 0 }[/math] (I'm doing this just to avoid confusion with different letters but equal numbers). We all learn at school that [math]\displaystyle{ a + b = c }[/math]. For example: [math]\displaystyle{ 4 + 1 = 5 }[/math]. Also, we all learn that we can substitute one thing by another, provided that both mean the same thing or are equal to each other. So, if [math]\displaystyle{ f(x) = a }[/math] and [math]\displaystyle{ g(x) = b }[/math], can we write [math]\displaystyle{ f(x) + g(x) = c \ ? }[/math] Yes, we can (no pun with politics).
Now let's think of [math]\displaystyle{ c }[/math] as a third function, [math]\displaystyle{ h(x) = c }[/math]. But didn't we say that [math]\displaystyle{ c = a + b \ ? }[/math] Then [math]\displaystyle{ h(x) = a + b }[/math]. Now comes an important question: [math]\displaystyle{ h }[/math] is not just any function. What function is it? We just wrote that whatever value [math]\displaystyle{ c }[/math] is, it's always equal to the sum [math]\displaystyle{ a + b }[/math]. Therefore, our [math]\displaystyle{ h }[/math] function is always a sum of two other functions. Which ones? [math]\displaystyle{ f }[/math] and [math]\displaystyle{ g }[/math]. How do we write a sum of functions? Like this [math]\displaystyle{ f + g }[/math]. Therefore, it comes that [math]\displaystyle{ f + g = h }[/math].
After all that rather lengthy reasoning we can finally write [math]\displaystyle{ h(x) = f(x) + g(x) }[/math] is the same as [math]\displaystyle{ (f + g)(x) = f(x) + g(x) }[/math]. Which translates to "The sum of functions at a point is equal to calculate one function at that point and add it to the other function calculated at the same point".
Note: in some numerical methods class some teacher told that addition is a function. Look back. We had two different functions [math]\displaystyle{ f }[/math] and [math]\displaystyle{ g }[/math]. What was [math]\displaystyle{ h }[/math]? It was the sum of the other two functions. Ergo, the addition is a function. Think about the definition of a function, it maps numbers to other numbers. What is [math]\displaystyle{ h }[/math] doing? It's mapping the values of different functions at some point [math]\displaystyle{ x }[/math] to a certain result. In other words and in our case, it's mapping the sum of two numbers to a third one.
Second note: the intersection between the domains of both functions cannot be empty. Suppose the domain of one function is [math]\displaystyle{ x \gt 0 }[/math]. The domain of the other is [math]\displaystyle{ x \gt 10 }[/math]. The domain of the sum is obviously not going to include [math]\displaystyle{ [0, \ 10] }[/math], but [math]\displaystyle{ x \gt 10 }[/math] because they are also positive. What if one function is defined for [math]\displaystyle{ x \lt 0 }[/math] and the other for [math]\displaystyle{ x \gt 0 \ ? }[/math] We just cannot do the operation! Because if we choose a positive, one function is defined and the other is not. And the same thing happens if we choose a negative. Ergo, adding one function to another must obey to the condition that at least one element is part of both function's domains.
Product, quotient, multiply by a constant and composite functions
[math]\displaystyle{ (f \cdot g)(x) = f(x)g(x) }[/math]
[math]\displaystyle{ (f / g)(x) = f(x)/g(x) }[/math]
[math]\displaystyle{ (cf)(x) = cf(x) }[/math]
I'm not going to repeat the same lengthy reasoning. The process is the same.
[math]\displaystyle{ (f \circ g)(x) = f(g(x)) }[/math]
The idea of composing a function is quite simple. We can nest as many functions as we want. Careful here! The domain of [math]\displaystyle{ f(g(x)) }[/math] cannot surpass the domain of [math]\displaystyle{ g(x) }[/math] or the domain of [math]\displaystyle{ f(x) }[/math]. Forbidden inputs for [math]\displaystyle{ g(x) }[/math] may not be forbidden for [math]\displaystyle{ f(x) }[/math], but we have to remember that we are calculating [math]\displaystyle{ g(x) }[/math] first and then [math]\displaystyle{ f }[/math] receives [math]\displaystyle{ g }[/math] to calculate something else.
In all the previous cases we have the same condition about the domains of each function. If the intersection is empty, we can't perform the operation at all. The composite case for example. If [math]\displaystyle{ g(x) = -x^2 - 1 }[/math] and [math]\displaystyle{ f(x) = \sqrt{x} }[/math] we can't compose them in the order [math]\displaystyle{ f(g(x)) }[/math] because it won't produce any results and the graph won't exist at all for all real numbers.