2

If $f: [0,1] \rightarrow \mathbb{R}$, $f(x) = \sin x$

If $g: [1/2, 2] \rightarrow \mathbb{R}$, $g(x) = \cos x$

Is $h(x)= f(x) + g(x)$ a valid function directly

or

we need to specify $h:[1/2,1] \rightarrow \mathbb{R}$ and then say $h(x) = f(x) + g(x)$

I wish to know is it automatic or needs clarification?

jjagmath
  • 18,214
  • That looks fine with the domains given – Paul Jul 08 '23 at 10:01
  • So no need to specify [1/2,1] as per laws of maths and it's understandable as default. – Anshul Singhal Jul 08 '23 at 10:28
  • 2
    Sorry, your second option is correct, the domain is part of any function definition. For example, $f(x)=x^2$ defined on the whole real line or the non-negative half line are different functions. In the second case, the function is increasing and has the inverse $f^{-1}(x)=\sqrt{x}$, while in the first case it has no inverse. – Paul Jul 08 '23 at 10:50

3 Answers3

3

Strictly speaking, $f(x)$ and $g(x)$ can only be added if both of the functions have the same domains (and are left-total (exist everywhere on the domain)). Intuitively it seems obvious that the domain of $h$ is $\left[\frac{1}{2},1\right]$ but you do need to specify it.

Localth
  • 1,286
1

The domain and codomain are part of a function's definition so it must be unambiguously defined. This is because important properties of a function can be changed such as injectivity and surjectivity simply by changing the domain and codomain.

Here because the domains of $f(x)$ and $g(x)$ have the common intersection of $[1/2,1]$ the context suggests this should be the domain of $h(x)$ and can likely go unstated depending on the level of formality required. That being said, many simple errors can be uncovered by correctly identifying the domain and codomain. So your effort to clear up the ambiguity is a good habit and I would encourage it.

CyclotomicField
  • 11,018
  • 1
  • 12
  • 29
0

It's just a matter of definition. Let $f\colon D_f\to\mathbb R$ and $g\colon D_g\to\mathbb R$. We define $f+g\colon D_{f+g}\to \mathbb R$ where $D_{f+g}:=D_f\cap D_g$ and $(f+g)(x):=f(x)+g(x)$ for all $x\in D{f+g}$.

($f+g$ might be the empty function.)

Michael Hoppe
  • 18,103
  • 3
  • 32
  • 49