Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Functions and inverses

The quadratic formula says that the solutions of ax2+bx+c=0 depend on the three coefficients, and that dependence is not itself an equation. It is a rule: hand it three numbers and it hands back an answer, every time, without ambiguity.

Mathematics has a name for such a rule and a machinery for handling it, and building that machinery is what this lesson does. It assumes only the algebra of the previous two lessons, and it produces the object that the rest of the course studies almost exclusively.

What a function is, exactly

A function is a rule that assigns to each input exactly one output. Three things must be given before the rule is fully specified: the set of allowed inputs, called the domain; the set the outputs are drawn from, the codomain; and the rule itself. Writing f(x)=3x+1 gives only the third, and the other two are usually left implicit as "whatever real numbers make sense".

The demand for exactly one output is the whole of the definition and it is stricter than it looks. The rule "y is a number whose square is x" is not a function, because x=9 yields both 3 and -3. This is why 9 is defined to mean 3 and not -3: the square root symbol has to name one number, and the choice of the non-negative one is a convention adopted to rescue functionhood. It is also why the quadratic formula carries an explicit ± rather than hiding two answers inside one symbol.

The notation f(x) is worth reading carefully, because it is not multiplication. It means the output of f at the input x, and f alone is the name of the function while f(x) is the name of a number. Sloppiness here is harmless in easy cases and disastrous when functions start being fed to other functions, which happens later in this lesson.

Domain: where the rule refuses to run

Two things stop a formula in its tracks over the reals, both met already. Division by zero is barred, so f(x)=1/(x-2) has domain every real except 2. Even roots of negatives do not exist on the real line, so g(x)=x-4 needs x-40, giving domain x4. Everything else is allowed, and a polynomial has every real number in its domain.

Domain can also be imposed from outside rather than discovered from the formula. If A(r)=πr2 is the area of a circle of radius r, then A(-3)=9π is arithmetically fine and physically meaningless, so the domain is r>0 because of what the function is for. Modelling almost always narrows a domain this way, and forgetting to say so is how a model gets used outside the range where it was ever true.

The range is what actually comes out: the set of values f(x) takes as x runs over the domain. Range is generally harder to find than domain, because it requires knowing the behaviour of the whole rule rather than checking for prohibited operations. For f(x)=x2 with domain all reals, the range is y0, since squares are never negative and every non-negative number is a square.

Example. Give the domain and range of g(x)=x-4+1.

The root demands x4, so that is the domain. As x runs from 4 upward, x-4 runs from 0 upward, its square root runs from 0 upward taking every non-negative value, and adding 1 shifts all of it, so the range is y1. A check: g(13)=9+1=4, and g(20)=16+1=5.

Now you. Give the domain and range of h(x)=3-x+5.

Answer

The domain is x-5. The root takes every value from 0 upward, and subtracting it from 3 takes 3 downward without limit, so the range is y3. Check: h(-5)=3 and h(4)=3-3=0.

A function need not be a formula

The formula is the commonest presentation but not the definition, and holding the two apart pays off. A table of values is a function if no input appears twice with different outputs. The mapping from a date to the closing price of an index is a function with no formula at all. A rule given in words, such as "round to the nearest integer", is a function.

Piecewise definitions matter in practice because so much of the world is written in bands. United Kingdom income tax in the 2024/25 year charges nothing on the first 12{,}570 pounds, 20 per cent on income between there and 50{,}270, and 40 per cent from there to 125{,}140. That is one function of income, defined by different formulas on different stretches.

On an income of 30{,}000 pounds the tax is 0.20×(30{,}000-12{,}570)=3{,}486 pounds. On 60{,}000 it is 0.20×(50{,}270-12{,}570)+0.40×(60{,}000-50{,}270)=7{,}540+3{,}892=11{,}432 pounds. Note what the calculation shows: the higher rate applies only to the part of the income above the threshold, so crossing a band boundary never reduces take-home pay. That single fact, which is a property of the function, is the one most often got wrong in public argument about tax.

Composition, and why order matters

Feeding the output of one function into another gives a new function, written (fg)(x)=f(g(x)) and read "f after g". The inner function runs first, which is the reverse of the reading order, and it is a common source of error.

Take f(x)=3x+1 and g(x)=x2. Then f(g(2))=f(4)=13, while g(f(2))=g(7)=49. Composition is not commutative, and unlike the commutativity of multiplication this failure is normal rather than exotic: doubling then adding three is a different rule from adding three then doubling, as anyone who has applied a discount before or after tax knows.

Composition also inherits domain restrictions from both parts. In f(g(x)) the input must be in the domain of g, and the value g(x) must then be in the domain of f. With g(x)=x-4 and f(u)=u, the composition needs x4 even though each function separately is happy with any real. Checking both conditions, not just the visible one, is the discipline.

Example. With f(x)=2x-5 and g(x)=x2+1, find f(g(3)), g(f(3)), and a formula for f(g(x)).

g(3)=10, so f(g(3))=20-5=15. In the other order, f(3)=1, so g(f(3))=1+1=2. In general f(g(x))=2(x2+1)-5=2x2-3, and a check at x=3 gives 18-3=15, agreeing.

Now you. With the same two functions, find a formula for g(f(x)) and evaluate it at x=4.

Answer

g(f(x))=(2x-5)2+1=4x2-20x+26. At x=4 that is 64-80+26=10, which matches f(4)=3 then g(3)=10.

Running a function backwards

An inverse of f is a function f-1 that undoes it: f-1(f(x))=x for every x in the domain, and f(f-1(y))=y for every y in the range. The superscript is unfortunate notation, since f-1 does not mean 1/f, and only context distinguishes them.

Not every function has one, and the reason is the same strictness that defined functions in the first place. If two different inputs give the same output, the inverse would have to send that output back to both, and it would not be a function. So f is invertible exactly when it is injective, meaning distinct inputs always give distinct outputs. The function f(x)=x2 on all the reals is not injective, since f(3)=f(-3)=9, and it therefore has no inverse.

The standard repair is to shrink the domain until injectivity holds. Restrict f(x)=x2 to x0 and it becomes injective, with inverse y. The restriction is a genuine choice: x0 would have worked equally well and would give -y as the inverse. Conventions of this kind, chosen for convenience and then treated as inevitable, are behind the odd-looking domain restrictions on the inverse trigonometric functions two lessons from the end of this course.

Finding an inverse algebraically is a routine. Write y=f(x), solve for x in terms of y using the laws of lesson two, and rename the variables at the end.

Inverses in practice

Example. Find the inverse of f(x)=(2x-1)/(x+3), and state where each function is defined.

Set y=(2x-1)/(x+3) and multiply through by x+3, which is legal since x-3: y(x+3)=2x-1, so xy+3y=2x-1. Gather the x terms on one side: xy-2x=-1-3y, so x(y-2)=-(3y+1) and x=(3y+1)/(2-y). Hence f-1(x)=(3x+1)/(2-x). The domain of f excludes -3 and the domain of f-1 excludes 2, and these correspond: 2 is the value f approaches but never takes, so it is missing from the range of f. Check numerically: f(5)=9/8=1.125, and f-1(1.125)=(3.375+1)/(0.875)=4.375/0.875=5.

Now you. Find the inverse of g(x)=(x+5)/(x-2) and check it at x=7.

Answer

y(x-2)=x+5 gives x(y-1)=2y+5, so g-1(x)=(2x+5)/(x-1). Checking, g(7)=12/5=2.4, and g-1(2.4)=(4.8+5)/1.4=9.8/1.4=7.

The most familiar inverse pair in daily use is temperature conversion. Fahrenheit from Celsius is F(c)=9c/5+32, a function built from a stretch and a shift, and undoing those in reverse order gives C(f)=5(f-32)/9. Check: F(37)=66.6+32=98.6, and C(98.6)=5×66.6/9=37. The two scales agree at exactly one temperature, where c=9c/5+32, which solves to c=-40, a linear equation of the kind the previous lesson handled.

What is still missing

A function has now been defined, restricted, composed and inverted, all algebraically. What has not happened is seeing one. Asking whether f(x)=x3-3x+1 is injective, or what its range is, or how many solutions f(x)=0 has, is hard work by algebra alone and nearly immediate once the function is drawn.

Turning a rule into a picture requires a device for holding an input and its output at once, and that device is the coordinate plane. It arrives in the next lesson, and with it the observation that injectivity, range, and the number of solutions of an equation are all visible at a glance.