Functions and Graphs — Reading, Sketching, Transforming

Learn functions and graphs with clear explanations, worked examples, and practice problems.

CBSE JEE-MAIN NEET 10 min read

What Is a Function, Really?

A function is a rule that assigns to each input exactly one output. The word “exactly one” is the critical part — if any input maps to two different outputs, it’s not a function.

Think of it like a machine: you put something in, exactly one thing comes out. Every vending machine is a function — press button A1, get one specific snack.

Formally, a function f:ABf: A \to B maps every element of set AA (domain) to exactly one element of set BB (co-domain). The set of actual output values is the range (which may be smaller than the co-domain).

Domain, Range, and Co-domain

Domain: Set of all valid inputs. When not specified, assume all real numbers for which the expression is defined.

Co-domain: The set the function maps into (often R\mathbb{R} by default).

Range: The set of actual outputs — the image of the domain under ff.

Finding the domain: identify values where the function “breaks.” Remove values that make a denominator zero, put a negative under an even root, or make a logarithm’s argument 0\leq 0.

Example: f(x)=1x2f(x) = \frac{1}{\sqrt{x-2}}

  • Denominator cannot be 0: x20x2\sqrt{x-2} \neq 0 \Rightarrow x \neq 2
  • Under square root must be non-negative: x20x2x - 2 \geq 0 \Rightarrow x \geq 2
  • Combined: x>2x > 2, so Domain =(2,)= (2, \infty)

Types of Functions

Injective (One-One) Functions

ff is injective if different inputs give different outputs: f(a)=f(b)a=bf(a) = f(b) \Rightarrow a = b.

Horizontal line test: If any horizontal line crosses the graph more than once, the function is not injective.

Surjective (Onto) Functions

f:ABf: A \to B is surjective if every element of BB is actually achieved: Range = Co-domain.

Bijective Functions

Both injective and surjective. Only bijective functions have well-defined inverses.

CBSE Class 12 regularly asks: “Show that f(x)=2x+3f(x) = 2x+3 is bijective.” Show injectivity by assuming f(a)=f(b)f(a) = f(b) and deriving a=ba = b. Show surjectivity by solving y=2x+3y = 2x+3 for any yRy \in \mathbb{R}, getting x=y32Rx = \frac{y-3}{2} \in \mathbb{R}.

Standard Functions and Their Graphs

1. Constant Function: f(x)=cf(x) = c

Horizontal line at height cc. Domain: R\mathbb{R}, Range: {c}\{c\}. Not injective (all inputs give same output), technically surjective only if co-domain is {c}\{c\}.

2. Identity Function: f(x)=xf(x) = x

Line through origin with slope 1. Domain and Range both R\mathbb{R}. Bijective.

3. Linear Function: f(x)=mx+cf(x) = mx + c

Straight line. Bijective for m0m \neq 0. Slope mm tells us steepness; cc is the y-intercept.

4. Quadratic Function: f(x)=ax2+bx+cf(x) = ax^2 + bx + c

Parabola. If a>0a > 0, opens upward (minimum at vertex). If a<0a < 0, opens downward (maximum at vertex).

Vertex: x=b2ax = -\frac{b}{2a}, y=cb24ay = c - \frac{b^2}{4a}

Not injective over full R\mathbb{R} (symmetric about vertex), but injective if restricted to one half.

5. Modulus Function: f(x)=xf(x) = |x|

V-shape with vertex at origin. Domain: R\mathbb{R}, Range: [0,)[0, \infty). Not injective.

x={xif x0xif x<0|x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}

6. Greatest Integer Function (Floor): f(x)=xf(x) = \lfloor x \rfloor

Also written [x][x]. Returns the greatest integer x\leq x. Graph is a staircase with closed left endpoint and open right endpoint on each step.

[2.7]=2[2.7] = 2, [1.3]=2[-1.3] = -2, [3]=3[3] = 3

7. Signum Function

sgn(x)={1if x>00if x=01if x<0\text{sgn}(x) = \begin{cases} 1 & \text{if } x > 0 \\ 0 & \text{if } x = 0 \\ -1 & \text{if } x < 0 \end{cases}

Range: {1,0,1}\{-1, 0, 1\}.

8. Exponential Function: f(x)=axf(x) = a^x, a>0,a1a > 0, a \neq 1

Domain: R\mathbb{R}, Range: (0,)(0, \infty). Always passes through (0,1)(0, 1).

  • If a>1a > 1: increasing (standard growth curve)
  • If 0<a<10 < a < 1: decreasing (decay curve)

9. Logarithmic Function: f(x)=logaxf(x) = \log_a x

Domain: (0,)(0, \infty), Range: R\mathbb{R}. Inverse of exponential. Passes through (1,0)(1, 0).

loga(xy)=logax+logay\log_a(xy) = \log_a x + \log_a y loga(xy)=logaxlogay\log_a\left(\frac{x}{y}\right) = \log_a x - \log_a y loga(xn)=nlogax\log_a(x^n) = n \log_a x logax=logbxlogba(change of base)\log_a x = \frac{\log_b x}{\log_b a} \quad \text{(change of base)}

Graph Transformations

Understanding transformations lets you sketch complex functions without plotting dozens of points.

Starting from a base graph y=f(x)y = f(x):

TransformationEffect on Graph
y=f(x)+cy = f(x) + cShift up by cc
y=f(x)cy = f(x) - cShift down by cc
y=f(x+c)y = f(x+c)Shift left by cc
y=f(xc)y = f(x-c)Shift right by cc
y=f(x)y = -f(x)Reflect about x-axis
y=f(x)y = f(-x)Reflect about y-axis
y=cf(x)y = cf(x), c>1c>1Vertical stretch
y=cf(x)y = cf(x), 0<c<10< c < 1Vertical compress
y=f(cx)y = f(cx), c>1c > 1Horizontal compress
y=f(x)y = \|f(x)\|Reflect negative parts above x-axis

For y=f(x+a)y = f(x+a) vs y=f(xa)y = f(x-a): “Inside the bracket, opposite direction.” f(x+2)f(x+2) shifts LEFT by 2 (not right). This trips up many students.

Worked Example: Sketch y=x24y = |x^2 - 4|

Step 1: Sketch y=x24y = x^2 - 4 (parabola, vertex at (0,4)(0,-4), crosses x-axis at ±2\pm 2).

Step 2: Any part of the curve below the x-axis gets reflected above it.

Step 3: The portion between x=2x = -2 and x=2x = 2 (where x24<0x^2 - 4 < 0) flips upward, creating a “W” shape.

Composition and Inverse

Composition fgf \circ g

(fg)(x)=f(g(x))(f \circ g)(x) = f(g(x))

We apply gg first, then ff. The domain of fgf \circ g is the set of xx where g(x)g(x) is in the domain of ff.

fggff \circ g \neq g \circ f in general. For example, f(x)=x2f(x) = x^2, g(x)=x+1g(x) = x+1: f(g(x))=(x+1)2f(g(x)) = (x+1)^2 but g(f(x))=x2+1g(f(x)) = x^2 + 1.

Inverse Function f1f^{-1}

If ff is bijective, then f1f^{-1} exists. The graph of f1f^{-1} is the mirror image of ff about the line y=xy = x.

Finding f1f^{-1}: Replace f(x)f(x) with yy, swap xx and yy, solve for yy.

Example: f(x)=3x5f(x) = 3x - 5. Let y=3x5y = 3x - 5. Swap: x=3y5x = 3y - 5. Solve: y=x+53y = \frac{x+5}{3}. So f1(x)=x+53f^{-1}(x) = \frac{x+5}{3}.

Verification: f(f1(x))=3x+535=xf(f^{-1}(x)) = 3 \cdot \frac{x+5}{3} - 5 = x. Correct.

Even and Odd Functions

Even function: f(x)=f(x)f(-x) = f(x) for all xx in the domain. Graph is symmetric about the y-axis. Examples: x2,x,cosxx^2, |x|, \cos x.

Odd function: f(x)=f(x)f(-x) = -f(x) for all xx in the domain. Graph has rotational symmetry about the origin. Examples: x,x3,sinxx, x^3, \sin x.

Neither: Most functions. Example: f(x)=x2+xf(x) = x^2 + x.

If the domain is symmetric about 0 (like [a,a][-a, a] or R\mathbb{R}), check even/odd by substituting x-x. If the domain is not symmetric (like [1,5][1, 5]), the question doesn’t arise.

Solved Examples

Example 1 — CBSE Level

Find the domain of f(x)=9x2f(x) = \sqrt{9 - x^2}.

We need 9x20x293x39 - x^2 \geq 0 \Rightarrow x^2 \leq 9 \Rightarrow -3 \leq x \leq 3.

Domain =[3,3]= [-3, 3]

Example 2 — JEE Main Level

If f(x)=x1+x2f(x) = \frac{x}{1+x^2}, check if it’s even, odd, or neither. Also find its range.

f(x)=x1+(x)2=x1+x2=f(x)f(-x) = \frac{-x}{1+(-x)^2} = \frac{-x}{1+x^2} = -f(x). So ff is odd.

For range: Let y=x1+x2y = \frac{x}{1+x^2}. Then yx2x+y=0yx^2 - x + y = 0. For real xx: discriminant 0\geq 0: 14y20y21412y121 - 4y^2 \geq 0 \Rightarrow y^2 \leq \frac{1}{4} \Rightarrow -\frac{1}{2} \leq y \leq \frac{1}{2}.

Range =[12,12]= \left[-\frac{1}{2}, \frac{1}{2}\right]

Example 3 — JEE Advanced Level

f:RRf: \mathbb{R} \to \mathbb{R} is given by f(x+y)=f(x)f(y)f(x+y) = f(x)f(y) for all x,yRx, y \in \mathbb{R} and f(1)=2f(1) = 2. Find f(n)f(n) for positive integer nn, and show that k=1nf(k)\sum_{k=1}^{n} f(k) forms a geometric series.

Setting x=y=0x = y = 0: f(0)=f(0)2f(0)=0f(0) = f(0)^2 \Rightarrow f(0) = 0 or 11. Since f(1)=20f(1) = 2 \neq 0, f(0)=1f(0) = 1.

Setting y=1y = 1: f(x+1)=f(x)f(1)=2f(x)f(x+1) = f(x) \cdot f(1) = 2f(x).

So f(2)=2f(1)=4f(2) = 2f(1) = 4, f(3)=2f(2)=8f(3) = 2f(2) = 8, …, f(n)=2nf(n) = 2^n.

Sum =2+4+8++2n=2(2n1)/(21)=2n+12= 2 + 4 + 8 + \cdots + 2^n = 2(2^n - 1)/(2-1) = 2^{n+1} - 2.

Common Mistakes to Avoid

Mistake 1: Confusing range and co-domain. Co-domain is what the function is defined to map into. Range is what it actually maps to. They can differ: f:RRf: \mathbb{R} \to \mathbb{R}, f(x)=x2f(x) = x^2 has co-domain R\mathbb{R} but range [0,)[0, \infty).

Mistake 2: Assuming f1f^{-1} always exists. Only bijective functions have inverses. f(x)=x2f(x) = x^2 doesn’t have an inverse over all of R\mathbb{R}.

Mistake 3: For [x][x] (floor function), students compute [2.3]=2[-2.3] = -2 instead of the correct 3-3. Floor always rounds DOWN (toward -\infty), not toward zero.

Mistake 4: Shifting direction: y=f(x+2)y = f(x+2) shifts LEFT, not right. The function reaches the same value at x=2x = -2 as the original reaches at x=0x = 0.

Mistake 5: In composite functions, the order matters. (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)) — apply the rightmost function first.

Practice Questions

Q1. Find the domain and range of f(x)=x1x+2f(x) = \frac{x-1}{x+2}.

Domain: x2x \neq -2, so R{2}\mathbb{R} \setminus \{-2\}. For range: y=x1x+2y(x+2)=x1x(y1)=12yx=12yy1y = \frac{x-1}{x+2} \Rightarrow y(x+2) = x-1 \Rightarrow x(y-1) = -1-2y \Rightarrow x = \frac{-1-2y}{y-1}, valid when y1y \neq 1. Range: R{1}\mathbb{R} \setminus \{1\}.

Q2. If f(x)=x2+1f(x) = x^2 + 1 and g(x)=2x1g(x) = 2x - 1, find (fg)(2)(f \circ g)(2).

g(2)=3g(2) = 3. f(g(2))=f(3)=9+1=10f(g(2)) = f(3) = 9 + 1 = 10.

Q3. Is f(x)=xxf(x) = x|x| even, odd, or neither?

f(x)=(x)x=(x)(x)=xx=f(x)f(-x) = (-x)|-x| = (-x)(|x|) = -x|x| = -f(x). So ff is odd.

Q4. Find the inverse of f(x)=2x+1x3f(x) = \frac{2x+1}{x-3}.

Let y=2x+1x3y = \frac{2x+1}{x-3}. Then y(x3)=2x+1yx3y=2x+1x(y2)=3y+1x=3y+1y2y(x-3) = 2x+1 \Rightarrow yx - 3y = 2x + 1 \Rightarrow x(y-2) = 3y+1 \Rightarrow x = \frac{3y+1}{y-2}. So f1(x)=3x+1x2f^{-1}(x) = \frac{3x+1}{x-2}.

Q5. Evaluate [3.7]+[1.2]+[0]+[2.9][3.7] + [-1.2] + [0] + [-2.9].

[3.7]=3[3.7] = 3, [1.2]=2[-1.2] = -2, [0]=0[0] = 0, [2.9]=3[-2.9] = -3. Sum =3+(2)+0+(3)=2= 3 + (-2) + 0 + (-3) = -2.

Q6. Describe the transformation from y=x2y = x^2 to y=(x3)2+4y = -(x-3)^2 + 4.

Shift right by 3, then reflect about x-axis, then shift up by 4. The parabola opens downward with vertex at (3,4)(3, 4).

FAQs

Q: What is the difference between “one-one” and “many-one” functions?

One-one (injective): distinct inputs always give distinct outputs. Many-one: at least two different inputs give the same output. f(x)=x2f(x) = x^2 is many-one since f(2)=f(2)=4f(2) = f(-2) = 4.

Q: Can a function be both even and odd?

Yes — only f(x)=0f(x) = 0 (the zero function) satisfies both f(x)=f(x)f(-x) = f(x) and f(x)=f(x)f(-x) = -f(x) simultaneously.

Q: In JEE, how often does greatest integer function appear?

Almost every year. Common question types: finding range of [f(x)][f(x)], evaluating limits involving [x][x], and solving equations like [x24]=0[x^2 - 4] = 0.

Q: How do I prove a function is bijective in CBSE?

Standard two-step proof: (1) Assume f(a)=f(b)f(a) = f(b) and show a=ba = b (injectivity). (2) For any yy in co-domain, find xx in domain with f(x)=yf(x) = y (surjectivity). Always show both steps explicitly.

Q: What is the significance of the vertical line test?

If any vertical line crosses the graph more than once, the curve does not represent a function — some x-value maps to multiple y-values. This visually checks the “exactly one output per input” rule.

Practice Questions