# what exactly is a function of function?$f(x)=2x$ ,$g=3f$, what exactly is $g$?

The question: a function $$f(x)=2x$$ with the domain $$[1,2]$$ the codomain $$[2,4]$$ the image $$[2,4]$$ when we take a transformation of this function like $$g=3f$$, what exactly is this $$g$$ function is?

My guess:

1. we can think $$g$$ is the function that takes the domain of $$f$$ as its own domain, so $$g$$ is a function $$g(x)=6x$$ with the domain $$[1,2]$$ and the codomain $$[6,12]$$.$$x\in[1,2]$$
2. we can think $$g$$ is the composition function $$g=h\circ f$$ ,here $$f(x)=2x$$ with the domain $$[1,2]$$,$$h(x)=3x$$,with the domain$$[2,4]$$.

Both of them can make sense, so which one is right?

• $g(x)=3f(x)=3(2x)=6x$ Commented May 25, 2019 at 5:08
• $g$ is a composition of two functions $f : [1,2] \to [2,4]$ and $2* : \mathbb{R} \to \mathbb{R}$, the domain of $g$ is the domain of $f$ (i.e. $[1,2]$). The codomain of $g$ is the codomain of $2*$ (i.e. $\mathbb{R}$). Please note that codomain of a function can be larger than the image. Commented May 25, 2019 at 5:20
• @achillehui Ecne though this is not the OP's major concern, there is a caveat here as we better allow composition only when the domain of $g$ is the co-domain of $f$. For example, pretty statements like "the composition of two onto functions is onto" would fail here. We can either make second domain and first codomain equal by saying that the codomain (not image, of course) of $f$ is $\Bbb R$, or by restricting the the domain of the multiplication (so compose $g={3*}|_{[2,4]}\circ f$), or by saying $g={3*}\circ i\circ f$ where $i$ is the inclusion $[2,4]\to \Bbb R$. Commented May 25, 2019 at 6:05

## 1 Answer

Assuming $$f$$ takes values in some set where it makes sense to multiply by $$3$$, the function $$g=3f$$ denotes the function with the same domain as $$f$$ whose value at $$x$$ is $$3$$ times the value of $$f$$ at $$x$$.

But you are right that you can think of $$3f$$ as a composite function, too. Define the function $$h(x)=3x$$. Then $$g=3f$$ is the composite function $$h\circ f$$. But still, the domain of $$h\circ f$$ is the same as the domain of $$f$$.

Your confusion in the second interpretation is that you are thinking that $$h=g$$. No! Rather, $$g=h\circ f$$.

• In summary, $g=3f$ is always a function with the domain same as $f$. Both of my guesses can be right, actually, they are just the same thing because they have the same domain same mapping rule. but I just make a mistake in the second interpretation about not knowing $g$ is a composite function. Thank you, such a great answer. Commented May 25, 2019 at 6:05
• But you are simply wrong (or at best, misleading) to write that $g(y)=3y$. This notation implies $g$ multiplies its inputs by $3$. This is not correct: in fact, $g$ multiplies its inputs by $6$. Of course, I know you mean $y=3x$. But the notation $g(y)=3y$ obscures the fact that $g$ has the same domain as $f$. The way to be precise here is to write what I did. Commented May 25, 2019 at 16:44
• yeah, I am wrong in my description, indeed there should be $h(y)=3y$. Commented May 26, 2019 at 1:45