Questions tagged [functions]

For elementary questions about functions, notation, properties, and operations such as function composition. Consider also using the (graphing-functions) tag.

A function $f$ defined on a set $X$ is an assignment of an element in some set $Y$ to each element of $X$. The set $X$ is called the domain of the function and $Y$ is called the codomain. The elements of $X$ are the inputs to the function and the elements of $Y$ are the potential outputs. For some input $x \in X$, its corresponding output in $Y$ is denoted $f(x)$. Not every element of $Y$ needs to be the output corresponding to some input though: the subset of $Y$ containing the elements that are an output of the function is called the range of $f$. When a function $f$ has domain $X$ and codomain $Y$, this is signified by writing $f \colon X \to Y$, and the assignments of inputs to outputs is signified by writing $f\colon x \mapsto f(x)$.

If you have a function whose codomain is the domain of another function, you can compose those two functions. In symbols if you have a function $f\colon X \to Y$ and a function $g \colon Y \to Z$, their composite is a function $g\circ f\colon X\to Z$ defined by the assignment $g\circ f\colon x \mapsto g(f(x))$.

For many examples of functions, the domain and range of the function are topological spaces, meaning that they are equipped with some notion of geometry. In this case we like to think of the function $f\colon X\to Y$ geometrically as the subset of the points $(x,f(x))$ in the topological space $X \times Y$. This subset of all the input-output pairs is called the graph of $f$.

Often mathematics textbooks will define a function slightly more rigorously than this though. They'll say that a function $f \colon X \to Y$ is a relation $R$ on the set $X \times Y$ such that

  1. For each $x \in X$ there is some $y \in Y$ such that $xRy$. Each input needs an output.
  2. If $xRy$ and $xRz$, then $y=z$. Each input needs exactly one output.

Here are a bunch of examples of functions:

  • Many examples of functions covered in elementary and high school have as their domain and codomain the real numbers $\mathbf{R}$. A basic example is the function $f \colon \mathbf{R} \to \mathbf{R}$ defined by the rule $f(x) = x^2$. Thinking geometrically, the graph of $f$ is the set of all points $(x,x^2)$ in the plane $\mathbf{R}^2$, and this forms a parabola. Note that while the codomain of this function is $\mathbf{R}$, the range consists of only the non-negative real numbers.

  • Here's a silly example. For any set $X$ we can define an identity function $\mathbf{1}_X$ with domain and codomain $X$ such that $\mathbf{1}_X \colon x \mapsto x$.

  • Let $W$ denote the set of all strings of letters of the alphabet, so like $\text{npr}$ or $\text{asdfasdf}$ or $\text{butt}$ for example. And let $\mathbf{N}$ denote the set of natural numbers. We can define a function $\ell\colon W \to \mathbf{N}$ such that $\ell$ assigns to each word it's length. So $\ell(\text{defenestration}) = 14$. Also $\ell(\text{butt})=4$.

  • Using the same set $W$ in the last example, let's define another function $\tau\colon W \to W$ such that $\tau$ "reverses" a word. So $\tau(\text{defenestration}) = \text{noitartsenefed}$, and $\tau(\text{butt}) = \text{ttub}$. A few neat properties of $\tau$ that deserve to be pointed out, $\tau \circ \tau = \mathbf{1}_W$, and also $\ell\circ\tau = \ell$.

33723 questions
3
votes
1 answer

Question regarding Odd and Even function $g(x)=f(x)(f(x)+f(-x))$

Let $f\colon\mathbb{R} \to \mathbb{R}$. Define $g: \mathbb{R}\to \mathbb{R}$ by $g(x)=f(x)(f(x)+f(-x))$ Then which of following is/are correct? A. $g$ is even for all $f$ B. $g$ is odd for all $f$ C. $g$ is even if $f$ is even D. $g$ is even if $f$…
Taylor Ted
  • 3,408
3
votes
4 answers

Why is $\sin(x^{2})$ similar to $\sin(x) \cdot x$?

Why is $\sin(x^2)$ similar of $\ x \sin(x)$? I graphed it using desmos and when I look at it, the behavior as x approaches zero seems to be to oscillate less. Yet as x approaches infinity and negative infinity $\sin(x^2)$ oscillates between y=1…
3
votes
2 answers

What's the multiplier to morph the ramp of a sine wave period?

Let say I've this sine wave (which is sin(x * 2)): and I want to increase/decrese the ramp such as (sorry for my paint): I need to multiply the argument for... what? Tried log(x) but I get strange results.
markzzz
  • 61
3
votes
1 answer

The domain of a function defined by addition

Let $\space f(x)=-2+\ln (2x-1) \space$ which domain is $(\frac{1}{2},+\infty )$. Now let $h(x)=f(x)-f(\frac{x}{2}) \space $. What is the domain of $h$? I started to calculate $h$: $$\begin{align*} h(x)&=-2+\ln(2x-1)- \left[-2+\ln(\frac{2x}{2}-1)…
user24047
3
votes
5 answers

What does a "$\bmod{2 \pi}$ function" mean?

I read somewhere that cosine is a "$\bmod 2 \pi$ function". I think it means that it repeats every $2\pi$, but what is this "mod"?
Hassaan
  • 199
3
votes
2 answers

Prove a function in 2 variables is onto

Consider the function $h: N \times N \rightarrow N$ so that $h(a,b) = (2a +1)2^b - 1$, where $N=\{0,1,2,3,\dots\}$ is the set of natural numbers. Prove that it is onto. Tried taking various examples and value putting technique to see that most of…
3
votes
6 answers

How to solve $x= \sin(k- x)$?

Is there a way to solve $x = \sin (k-x)$ without a computer, that is with a pocket calculator or pencil and paper?
user177880
3
votes
3 answers

What does it means by saying "functions defined on the surface of a sphere"

upon the quest of understanding spherical harmonics, I came to the a saying "functions defined on the surface of a sphere". https://en.wikipedia.org/wiki/Spherical_harmonics Now what does it mean by "functions defined on the surface of a sphere"?…
3
votes
2 answers

How should an application handle the addition of a percentage?

Let's say a user inputs two different string, expecting a result for each one. They both contain either addition or subtraction of a percentage. How should this be handled? My immediate thoughts are that addition and subtraction are commutative, and…
3
votes
0 answers

Domain values of inverse funtion

If I'm plotting $$y=3e^{{x\over3}+1}$$ from $x=0$ to $x=1$ and on the same axes I want to plot its inverse $$y=3\ln\left({x\over3}\right)-3$$ but only for the domain values of $x$ given by the range of $f$ Would the inverse domain range be $x=8.15$…
stuart
  • 513
  • 4
  • 10
3
votes
2 answers

Find the value of function at $\,x=5$

If $\,f(x)\,$ is a non-constant polynomial of $\,x\,$ such that $\,f\left(x^3\right)-f\left(x^3-2\right)=f^2\left(x\right)+12\,$ is true for all $\,x\,$ then find the value of $\,f\left(5\right).\,$
3
votes
2 answers

Domain of a Logarithmic Quadratic Function

Find the domain of the following function: $$g(x) = \ln(x^2+3x+2)$$ Here's my approach: $$g(x) = \ln(x^2+3x+2)$$ $$g(x) = \ln(x+2)(x+1)$$ $$g(x) = \ln(x+2)+\ln(x+1)$$ Therefore, $$x+1>0$$ $$x>-1$$ And, $$x+2 > 0$$ $$x>-2$$ Both values on both sides…
3
votes
1 answer

Injective function on the domain of natural numbers

Find all injective functions $f:N \rightarrow N$ such that $$f(f(m)+f(n))=f(f(m))+f(n)$$ Where $m,n$ are natural numbers.
Tommy
  • 31
3
votes
6 answers

Why is $f(x)=\sqrt x $ not a function?

Why is $f(x)=\sqrt x$ not a function? I understand that the definition of a function states that every "input" must be related to exactly one "output", but I am curious as to the WHY.
3
votes
2 answers

If $ f(x) $is convex then $ yf(x/y)$ is convex

I am struggling with this question: Show that if $f(x)$ is convex then the function $ yf(x/y)$ is convex on $\{(x, y): y>0\}$. I have tried starting from the standard definition of convexity but it just leads to a lot of algebra that doesn't go…