Definition (function). Given sets X,Y=∅, a functionf:X→Y is a rule that associates to everyx∈Xone and only oney∈Y.
X is the domain, Y the codomain; x is the independent variable, y=f(x) the dependent one. Notations: x↦f(x), XfY. The key words are "every" and "one and only one"; it is not required that every y be reached, nor reached by a single x.
For X={1,2,3,4}, Y={1,2,3}: f(1)=f(2)=f(3)=1, f(4)=3 is a function (several x may share an image, and 2∈Y may be missed); giving 1 two images is not a function; leaving 4 without an image is not a function.
Examples: f:R→R, f(x)=2x (real functions of a real variable f:X⊆R→R are the object of Calculus 1); f:R2→R, f(x,y)=x2+y2 (several variables); sequencesf:N→R, written an instead of f(n) and denoted (an)n≥n0.
Natural domain
The natural domain of a formula is the largest subset of R (or Rn) where all the operations make sense. Typical conditions: denominators =0; radicands of even-index roots ≥0; arguments of logarithms >0.
Example.f(x)=x2−11 needs x2−1=0, so Dom(f)=R∖{−1,1}. For f(x,y)=x2+y2−11: Dom(f)={(x,y):x2+y2=1}, the plane minus the unit circle.
Graph
Definition (graph).Γf={(x,f(x)):x∈X}⊆X×Y.
For f:X⊆R→R, Γf⊆R2 is a curve in the plane. Γf is a set of points, f is a rule. For f(x)=2x, Γf is the line through the origin with slope 2.
Vertical line test. A curve is the graph of a function y=f(x)iff every vertical line meets it at most once (two points (x0,y1), (x0,y2) with y1=y2 would give x0 two images). A circle is not the graph of a function. The domain is the projection of Γf on the x-axis.
Image and preimage
Let f:X→Y.
Image. For A⊆X, A=∅: f(A)={f(x):x∈A}⊆Y. The image of f is f(X), which may be strictly smaller than Y.
Preimage. For B⊆Y: f←(B)={x∈X:f(x)∈B}⊆X. It can be empty; f←(Y)=X.
(The notation f−1(B) is used by many books but is dangerous: it is confused with the inverse function, which may not exist.)
Examples. For f(x)=x2: f([−1,2])=[0,4] (minimum 0 at x=0, maximum 4 at x=2). For f(x)=2x: f(R)=R, f([−1,3])=[−2,6], f←([−1,3])=[−21,23].
On the graph: f(X) is the projection of Γf on the y-axis; f←(B) is the projection on the x-axis of the part of the graph with y∈B.
Graphical method for equations and inequalities. Preimages of intervals are solution sets:
Preimage
Set
On the graph
f←([a,b])
a≤f(x)≤b
graph between the lines y=a, y=b
f←([a,+∞))
f(x)≥a
graph abovey=a
f←((−∞,a])
f(x)≤a
graph belowy=a
f←({a})
f(x)=a
graph meetsy=a
f←([0,+∞))
f(x)≥0
the sign of f
Example: the line y=r>0 cuts the V-shaped graph of ∣x∣ at x=±r and the V lies above it for x≤−r or x≥r, which is ∣x∣≥r⟺x≤−r∨x≥r.
Definition (composite). Let f:X→Y, g:V→W. If f(X)⊆V (all values of f lie in the domain of g), then
g∘f:X→W,x↦g(f(x))First f, then g.
Words.f = "square", g = "add 1": g∘f is x↦x2+1, while f∘g is x↦(x+1)2: order matters.
Domain of a composite, in practice: (1) write the formula g(f(x)) and find where it makes sense; (2) intersect with the domain of f.
Example.f(x)=x, g(x)=x2−1.
f∘g(x)=x2−1, defined for x≤−1 or x≥1: Dom=(−∞,−1]∪[1,+∞).
g∘f(x)=(x)2−1=x−1, but its domain is Dom(f)=[0,+∞), notR: g(f(−4)) does not exist. Simplifying a formula does not enlarge the domain.
Hence Dom(g∘f)⊆Dom(f) and in general g∘f=f∘g.
Operations between real functions
For f,g:X→R, defined pointwise: (f±g)(x)=f(x)±g(x), (f⋅g)(x)=f(x)g(x), gf(x)=g(x)f(x) where g(x)=0, ∣f∣(x)=∣f(x)∣. E.g. f=x2, g=x−1: (f⋅g)(x)=x3−x2, gf=x−1x2 for x=1.
Graphs obtained from the graph of f
New function
What happens to Γf
f(x+a)
horizontal translation by −a (to the left if a>0)
f(x)+a
vertical translation by a (up if a>0)
f(∣x∣)
keep the part x≥0 and reflect it across the y-axis (the part x<0 is discarded); the result is always even
∣f(x)∣
the part above the x-axis stays, the part below is reflected upwards
Why the sign is "reversed": the value that f takes at x0, f(x+a) takes where x+a=x0, i.e. at x=x0−a. So ex−1 is ex shifted right by 1 and cosh(x+a) has its minimum at x=−a. For y=x2−1 (negative for −1<x<1), y=∣x2−1∣ reflects that arc above the axis.
Starting from a few elementary functions (powers, exponential, logarithm, trigonometric) and using operations and composition one builds all the functions studied in the course, such as e3sin2x−8x3+1+sin(3x): to study a complicated function, recognise how it is assembled.
Common mistakes
Thinking a function must reach the whole codomain (that is surjectivity).
Confusing image (starts from x, lands in Y) with preimage (starts from a set of y, lands in X).
Not finding the domain before working with a formula; finding the domain of a composite only from the simplified formula.
Reversing the order in g∘f; thinking g∘f=f∘g.
Versione ripasso
Functionf:X→Y: to every x∈X one and only one y∈Y. X domain, Y codomain. Need not reach all of Y. Sequences are functions N→R, written an.
Natural domain: largest set where the formula makes sense: denominator =0, even-root radicand ≥0, log argument >0. Example: x2−11 has Dom=R∖{−1,1}.
GraphΓf={(x,f(x))}⊆R2. Vertical line test: a curve is a graph iff every vertical line meets it at most once. Domain = projection on x-axis.
Image / preimage:f(A)={f(x):x∈A}, f←(B)={x:f(x)∈B}. f(X) = projection on the y-axis. Example f(x)=2x: f([−1,3])=[−2,6], f←([−1,3])=[−21,23]. For x2: f([−1,2])=[0,4].
Graphical method:f(x)≥a where the graph is above y=a; f(x)=a at the intersections; sign of f = f←([0,+∞)). supf=supf(X), similarly inf,max,min.
Compositiong∘f(x)=g(f(x)) (first f), requires f(X)⊆Dom(g). Domain: find where g(f(x)) makes sense, then intersect with Dom(f).
f=x, g=x2−1: f∘g=x2−1 on (−∞,−1]∪[1,+∞); g∘f=x−1 but only on [0,+∞).
g∘f=f∘g in general.
Operations are pointwise: f±g, fg, f/g (where g=0), ∣f∣.
Graph transformations:
f(x+a): shift by −a horizontally (left for a>0); ex−1 is ex shifted right by 1.
f(x)+a: shift up by a.
f(∣x∣): keep x≥0, reflect across the y-axis (even).
∣f(x)∣: reflect the negative part upwards.
Mistakes: image vs preimage; forgetting the domain; wrong order of composition; using the simplified formula for the domain of a composite.