Examples of domain of a single variable function

From Applied Science

Note: from what I remember from school, I think no teacher ever complained about using ":" or "|".

[math]\displaystyle{ f(x) = x^2 }[/math] There is no restriction to which numbers we can calculate the square of. Any rational or irrational will do. i.e. The domain is all real numbers.
[math]\displaystyle{ f(x) = \sqrt{x} }[/math] We all learn at school that roots of negative numbers are complex numbers. Therefore, the domain is [math]\displaystyle{ \{x \in \mathbb{R} : x \geq 0\} }[/math]
[math]\displaystyle{ f(x) = 1/x }[/math] There is only one concern that is the division by zero. Excluding the [math]\displaystyle{ x }[/math] for which we would have a division by zero, the domain is everything else. i.e. [math]\displaystyle{ \{x \in \mathbb{R} : x \neq 0\} }[/math]
[math]\displaystyle{ f(x) = \log(x) }[/math] or [math]\displaystyle{ f(x) = \ln(x) }[/math] When log is written without a base, it's assumed that the base is [math]\displaystyle{ e }[/math] (sometimes it's base 10). The Euler's number. It's an irrational number 2.71... Logarithm is defined as the inverse of an exponential [math]\displaystyle{ \log_ba = x \iff b^x = a }[/math]. When we have powers it's impossible to generate negative numbers or the zero. Therefore, the domain is [math]\displaystyle{ \{x \in \mathbb{R} : x \gt 0\} }[/math].
[math]\displaystyle{ f(x) = x^x }[/math] First, [math]\displaystyle{ 0^0 }[/math] is undefined, there is no value for it. For any positive number we have rationals and irrationals, any positive number works. But what happens when the exponent it's a rational number? Then [math]\displaystyle{ x^{1/2} = \sqrt{x} }[/math]. What if [math]\displaystyle{ x \lt 0 \ ? }[/math] Then we have a tricky situation. [math]\displaystyle{ (-2)^{-2} = 1/(-2)^2 = 1/4 }[/math]. For integers, no problems. What about rationals? [math]\displaystyle{ (-1/2)^{-1/2} = -1/\sqrt{-1/2} }[/math]. Now we have a complex number. The function does exist for negative inputs, but it's going to be a series of disconnected points because there are always rationals in between two integers. Therefore, domain is [math]\displaystyle{ \{x \in \mathbb{R} : x \gt 0\} }[/math] to simplify calculations.
[math]\displaystyle{ f(g(x)) }[/math] First, look for the domain of [math]\displaystyle{ g(x) }[/math]. If there are no restrictions, then all reals are part of this function's domain. What about [math]\displaystyle{ f(x) \ ? }[/math] Some values that [math]\displaystyle{ g }[/math] calculate may be forbidden for [math]\displaystyle{ f }[/math], which means that those are not part of f's domain.
[math]\displaystyle{ f(x) = \sqrt{|x|} }[/math] The domain is all reals, but let's look at it as a piecewise function. For [math]\displaystyle{ x \gt 0 }[/math] we can ignore the modulus and treat it as [math]\displaystyle{ \sqrt{x} }[/math]. For [math]\displaystyle{ x \lt 0 }[/math] we have that [math]\displaystyle{ |-x| = x }[/math]. Therefore, a more precise way to define the domain is as the union of two sets, [math]\displaystyle{ \mathbb{R}^{-} \cup \mathbb{R}_ {*}^{+} }[/math].