PYQ Vault

JEE Mains Maths · Differentiation

Differentiability of Piecewise Functions

Testing whether a function built from pieces, a composite or a running maximum is differentiable, and finding a derivative at one point from the limit that defines it.

Why this matters

Eighteen PYQs, sixteen of them multiple choice, and one from 2026. Nine make two pieces meet with matching slopes, or test whether they do; five handle a composite g(f(x)) or a running maximum or minimum; four study functions like x² sin(1/x) near 0, or find f′(0) from the limit that defines it. Three ideas cover the page.

Concept 1 of 3: Where two pieces join

A piecewise function is differentiable at a join exactly when the two pieces meet there and meet with the same slope. That gives two equations, so two unknown constants can be fixed. Continuity alone is not enough, since a corner is continuous. Equal slopes alone are not enough either: two pieces with the same slope at different heights make a jump.

Definition

  • Continuity at aa: left value = right value = f(a)f(a).
  • Differentiability at aa: continuity and left slope = right slope.
  • For formula pieces, each one-sided slope is that piece's derivative at aa.
  • A piece ∫0xg(t) dt\int_0^xg(t)\,dt has slope g(x)g(x).

Smooth join at x = a

f1(a)=f2(a)andf1′(a)=f2′(a)f_1(a)=f_2(a)\quad\text{and}\quad f_1'(a)=f_2'(a)

Worked example

Find aa and bb so that f(x)=x2+af(x)=x^2+a for x<2x<2 and f(x)=bx+1f(x)=bx+1 for x≥2x\ge2 is differentiable.
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2026 · 24 Jan 2026 Shift 1 · Q66Moderate

Example 1 · Differentiation · Differentiability of Piecewise Functions

Let α,β∈R\alpha,\beta \in R be such that the function f(x)={2α(x2−2)+2βx,x<1(α+3)x+(α−β),x≥1f\left( x \right)=\left\{ \begin{matrix} 2\alpha\left( x^{2}- 2 \right)+ 2\beta x & ,x < 1 \\ \left( \alpha + 3 \right)x +\left( \alpha - \beta \right) & ,x \geq 1 \end{matrix} \right. be differentiable at all x∈Rx \in R. Then 34(α+β)34(\alpha + \beta) is equal to

Continuity comes first

Matching slopes is not enough. xx for x<0x<0 and x+1x+1 for x≥0x\ge0 have slope 1 on both sides but jump at 0, so the function is not differentiable there. Write both equations.

Concept 2 of 3: Composites and running maxima

For g(f(x))g(f(x)), trouble can come only from points where ff is not differentiable, or where f(x)f(x) lands on a point where gg is not. Find those xx, write g(f(x))g(f(x)) as explicit pieces near each one, and test the join. A function like max⁡{h(t):t≤x}\max\{h(t):t\le x\} is the largest value so far: it follows hh while hh rises and stays flat after a peak.

Definition

  • g∘fg\circ f can fail only where ff fails or where f(x)f(x) hits a bad point of gg.
  • Write g(f(x))g(f(x)) in pieces near each such point, then test the join.
  • max⁡{h(t):t≤x}\max\{h(t):t\le x\} follows hh while hh rises and stays flat after a peak.
  • min⁡{h(t):t≤x}\min\{h(t):t\le x\} follows hh while hh falls and stays flat after a trough.

Chain rule at a point

(g∘f)′(a)=g′(f(a)) f′(a)when both derivatives exist(g\circ f)'(a)=g'\big(f(a)\big)\,f'(a)\quad\text{when both derivatives exist}

Worked example

f(x)=max⁡{t2:−1≤t≤x}f(x)=\max\{t^2:-1\le t\le x\} for x≥−1x\ge-1. Where in (−1,∞)(-1,\infty) is ff not differentiable?
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2023 · 11 April 2023 · Q170Moderate

Example 2 · Differentiation · Differentiability of Piecewise Functions

Let ff and gg be two functions defined by f(x)={x+1,x<0∣x−1∣,x≥0f(x) =\left\{ \begin{matrix} x + 1, & x < 0 \\ |x - 1|, & x \geq 0 \end{matrix} \right. and g(x)={x+1,x<01,x≥0g(x) =\left\{ \begin{matrix} x + 1, & x < 0 \\ 1, & x \geq 0 \end{matrix} \right.. Then (gof) (x) is

A bad inner function can be smoothed out

∣x∣|x| has a corner at 0, but ∣x∣2=x2|x|^2=x^2 is smooth. Test g∘fg\circ f itself at each suspect point; do not assume it fails because ff does.

Concept 3 of 3: The derivative from its definition

When a function has one formula away from a point and a separate value at it, the derivative there must come from the limit. For x2sin⁡1xx^2\sin\frac1x with value 0 at 0, the difference quotient is hsin⁡1h→0h\sin\frac1h\to0, so f′(0)=0f'(0)=0; yet f′(x)=2xsin⁡1x−cos⁡1xf'(x)=2x\sin\frac1x-\cos\frac1x has no limit at 0. The derivative exists everywhere but is not continuous. The limit also saves work: if f(0)=0f(0)=0, then f′(0)=lim⁡f(x)xf'(0)=\lim\frac{f(x)}{x}.

Definition

  • f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}.
  • xnsin⁡1xx^n\sin\frac1x with value 0 at 0: continuous for n≥1n\ge1, differentiable at 0 for n≥2n\ge2, with f′f' continuous at 0 for n≥3n\ge3.
  • If f(0)=0f(0)=0, then f′(0)=lim⁡x→0f(x)xf'(0)=\lim_{x\to0}\frac{f(x)}{x}.

Derivative at a point

f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}

Worked example

f(x)=x2sin⁡1xf(x)=x^2\sin\frac1x for x≠0x\ne0, f(0)=0f(0)=0. Find f′(0)f'(0), and decide whether f′f' is continuous at 0.
Practice this conceptself-check · 4 quick reps

The same idea in a real exam question:

JEE Mains · 2024 · 29 January 2024 · Q79Moderate

Example 3 · Differentiation · Differentiability of Piecewise Functions

Suppose
f(x)=(2x+2−x)tan⁡xtan⁡−1(x2−x+1)(7x2+3x+1)3f(x) =\frac{\left( 2^{x}+2^{- x} \right)\tan x\sqrt{\tan^{- 1}\left( x^{2}- x + 1 \right)}}{\left( 7x^{2}+ 3x + 1 \right)^{3}}
Then the value of f′(0)f^{'}(0) is equal to

f′ can exist without being continuous

For x2sin⁡1xx^2\sin\frac1x, the formula for f′(x)f'(x) has no limit at 0, but f′(0)=0f'(0)=0 from the definition. Never decide differentiability at a point by taking the limit of the derivative formula.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (3)

  • Where two pieces join

    Smooth join at x = a

    f1(a)=f2(a)andf1′(a)=f2′(a)f_1(a)=f_2(a)\quad\text{and}\quad f_1'(a)=f_2'(a)
  • Composites and running maxima

    Chain rule at a point

    (g∘f)′(a)=g′(f(a)) f′(a)when both derivatives exist(g\circ f)'(a)=g'\big(f(a)\big)\,f'(a)\quad\text{when both derivatives exist}
  • The derivative from its definition

    Derivative at a point

    f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}

Watch out for (3)

Test yourself on Differentiation

20 past JEE Mains questions from this chapter, timed at 48 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.