Functions of One Variable
Domain, range, and the handful of standard function shapes you must recognise on sight — the foundation the whole Calculus block stands on.
What you'll learn
- Domain (legal inputs) vs range (reachable outputs), and how to read them off a rule
- The shapes you must know on sight: polynomials, eˣ, ln x, sin/cos, and |x|
- Even vs odd functions, and what composition f(g(x)) does
- ln x is undefined for x ≤ 0; |x| is continuous everywhere but has a corner at 0
Before you start
Sketch x² on a scrap of paper. You did not build a table of values or plot points one by
one — you just knew the bowl shape and drew it. The same happens with a wave like
sin x: the picture arrives before any arithmetic does. That instant of recognition —
I know what this thing looks like — is the entire skill this short lesson builds.
The last chapter left you at the door of a curved world, asking how to read the slope of a bending curve and where it bottoms out. Every one of those questions begins by knowing which curve you are looking at. A small family of shapes turns up on every page of calculus, and once you can picture them, half the work of limits, continuity, and derivatives is already done before you pick up a pen.
Think of these shapes as the alphabet of calculus. A fluent reader does not sound out
letters one at a time — they take in whole words at a glance, and the meaning follows. Same
here: recognise the curve, and its behaviour near any point is half-read already. These
same shapes resurface the moment you do real machine learning — eˣ and ln x are the
guts of the sigmoid and log-loss, and the sharp corner of |x| is exactly where ReLU and
L1 regularisation live — so the instinct pays off long past the exam.
Domain and range
A function is just a rule that takes one number in and hands back one number out. Two questions pin any such rule down:
- Domain — which inputs are legal. A square root cannot take a negative, a logarithm cannot take zero or below, a fraction cannot divide by zero. Everything else is fair game.
- Range — which outputs are actually reached as the input sweeps across the domain.
Take f(x) = 1/x. Its domain is “all real x except 0,” because dividing by zero is
illegal; its range is “all real values except 0,” because no input ever drives the output
exactly to zero. Reading these two off the rule, before anything else, is the first reflex
GATE expects.
The standard shapes you must know on sight
You will never be asked to memorise exotic curves. You will be expected to know these five
instantly, the way you know the bowl of x²:
- Polynomials (
x,x²,x³, …) — defined for every real number; smooth, with no breaks and no corners. Even powers make a U-shaped bowl; odd powers run from bottom-left to top-right. - Exponential
eˣ— always positive (it never touches zero), passes through(0, 1), and grows ferociously to the right while flattening toward0on the left. - Natural log
ln x— the mirror ofeˣ. Defined only forx > 0, crosses zero atx = 1, and plunges to−∞asxapproaches0from the right. sin xandcos x— wavy and periodic, forever trapped in[−1, 1]. They never escape that band no matter how largexgrows.- Absolute value
|x|— a V-shape: it equalsxforx ≥ 0and−xforx < 0. Continuous everywhere, yet it carries a sharp corner atx = 0.
Even, odd, and composition
Two quick structural ideas ride on top of those shapes, and GATE leans on both:
- Even function:
f(−x) = f(x)— the graph is mirror-symmetric across the y-axis. Examples:x²,cos x,|x|. - Odd function:
f(−x) = −f(x)— the graph has rotational symmetry about the origin. Examples:x,x³,sin x. - Composition
f(g(x))means “dogfirst, then feed its result intof.” The inner output must be a legal input for the outer rule — and that single requirement is exactly what fixes the domain of a composition (you will see it bite in the worked example).
How GATE asks this
Functions rarely earn a question of their own. Instead this knowledge sits embedded
inside limit, continuity, and differentiability questions as a quiet first step: you must
already know that ln x needs a positive argument, that sin x can never exceed 1, or
that |x| has a corner — before the real question even begins. The wrapper is usually an
MCQ about a function’s domain, boundedness, or behaviour, and the function knowledge is
what unlocks it.
Worked example
For
f(x) = ln(x − 2), give the domain. Also state the range ofsin x, and say where|x|fails to be smooth.
Take the three parts one at a time.
Domain of ln(x − 2). A logarithm needs a strictly positive argument, so the rule
forces x − 2 > 0, that is x > 2. The domain is every real number greater than 2; the
point x = 2 itself is excluded, since there the argument is 0 and ln 0 is undefined.
Range of sin x. As x sweeps over all reals, sin x oscillates and lands on every
value between −1 and 1 inclusive. So the range is [−1, 1] — bounded, never escaping
the band.
Smoothness of |x|. The V-shape is continuous everywhere — you can draw it without
lifting the pen. Yet at x = 0 it carries a corner: the slope jumps from −1 on the
left to +1 on the right. That corner is precisely why |x| is not differentiable at
0, a fact the differentiability lesson will lean on directly.
A question to carry forward
You can now recognise the curves and read off where each one lives. But recognising a shape
is not the same as describing how it behaves right next to a particular point — and that
is what the slope question from the last chapter really demands. Look again at 1/x near
x = 0: the function is not even defined there, yet the curve clearly does something
dramatic as you creep toward zero. Here is the thread onward: how do we talk precisely about
the value a function is heading toward near a point, even when the function never actually
arrives — or never exists there at all?
In one breath
- A function maps one input to one output; domain = legal inputs, range =
outputs actually reached. Read both off the rule first (
1/x: allx ≠ 0, ally ≠ 0). - Know five shapes on sight: polynomials (smooth),
eˣ(always> 0, through(0,1)),ln x(onlyx > 0, zero at1),sin/cos(bounded in[−1, 1]),|x|(V-shape, corner at0). - Even:
f(−x) = f(x)(y-axis mirror). Odd:f(−x) = −f(x)(origin symmetry). - Composition
f(g(x)): the inner output must be a legal input for the outer rule — that is what constrains the domain. - Two traps:
ln xis undefined for allx ≤ 0;|x|is continuous but not smooth at0(continuity ≠ differentiability).
Practice
Quick check
Practice this in an interview
All questionsFirst-class functions can be stored in variables, passed as arguments, returned from other functions, and placed in data structures — just like any other object. This is the foundation for higher-order functions, decorators, callbacks, and functional programming patterns in Python.
Without a non-linear activation, any stack of linear layers collapses to a single linear transformation, giving a model no more expressive than logistic regression. Activation functions break linearity so the network can approximate arbitrarily complex functions.