Limits describe what a function is heading towards; continuity and differentiability describe whether its graph has gaps or sharp corners. GATE DA asks a limit almost every year (often a 0/0 form) and regularly asks whether a piecewise function, or ReLU, is continuous and differentiable.
You need: functions and logs (Refreshers Part 1) and derivatives (Refreshers 3.1). Quick check: what is the derivative of $x^3$? (It’s $3x^2$.) If that’s unfamiliar, Refreshers 3.1 takes 45 minutes and makes this module much easier.
Limits: where a function is heading
$\lim_{x\to a} f(x) = L$ means $f(x)$ gets as close as you like to $L$ when $x$ is close enough to $a$, whatever happens exactly at $a$.
A limit appears in almost every GATE DA paper, usually a “0/0” form that needs a standard limit, a conjugate, L’Hôpital’s rule or a Taylor series. They’re quick marks once you know the toolkit.
It’s like a run chase that ends exactly at the target: the run rate needed tells you where the scoreboard is heading even before the last ball.
A direct limit question in most papers, usually NAT.
Why limits? Some of the most useful quantities can’t be found by plugging in a number. The slope of a curve at a point is $\frac{f(x+h) - f(x)}{h}$ with $h = 0$, which is $\frac00$: meaningless as it stands. What we can do is watch what happens as $h$ gets closer to 0. The same “watch it approach” idea gives $e$, the Poisson distribution and the long-run behaviour of averages. A limit is the name for where a function is heading.
A table makes it concrete. $\frac{\sin x}{x}$ is $\frac00$ at $x = 0$, but at $x = 0.1$ it is $0.99833$ and at $x = 0.01$ it is $0.99998$. The values are closing in on 1, so $\lim_{x\to0}\frac{\sin x}{x} = 1$, even though the function has no value at 0 itself.
Look at $f(x) = \dfrac{x^2 - 4}{x - 2}$. At $x = 2$ it’s $\frac00$: undefined. But for every other $x$ you can cancel: $f(x) = x + 2$. So as $x$ approaches 2, $f(x)$ approaches 4. The function has a hole at $x = 2$, and the limit fills it in: $\lim_{x\to2} f(x) = 4$.
- One-sided limits: $x \to a^-$ (from the left) and $x \to a^+$ (from the right). The limit exists exactly when both exist and are equal.
- Limits at infinity: what happens as $x$ grows without bound. For a ratio of polynomials, only the leading terms matter: $\lim_{x\to\infty}\frac{3x^2 + 1}{x^2 - 5} = 3$.
- If $f$ is continuous at $a$ (no hole, jump or blow-up), the limit is just $f(a)$: substitute.
- $\dfrac{\sin x}{x} \to 1$, $\dfrac{1 - \cos x}{x^2} \to \dfrac12$
- $\dfrac{e^x - 1}{x} \to 1$, $\dfrac{\ln(1 + x)}{x} \to 1$
- $(1 + x)^{1/x} \to e$
Variants follow by substitution: $\frac{\sin 3x}{x} = 3\cdot\frac{\sin 3x}{3x} \to 3$; $\frac{\ln(1 + x^2)}{x^2} \to 1$.
- Factor and cancel (polynomials).
- Conjugate for square roots: multiply by $\frac{\sqrt{A} + B}{\sqrt{A} + B}$.
- Standard limits above, after a substitution.
- L’Hôpital’s rule: if the form is $\frac00$ or $\frac\infty\infty$, then $\lim\frac{f}{g} = \lim\frac{f'}{g'}$ (differentiate top and bottom separately). Repeat if needed.
- Taylor series (Part 2): replace each function by its first few terms.
Two tools in action. Conjugate: $\dfrac{\sqrt{x + 4} - 2}{x}$ is $\frac00$ at 0. Multiply top and bottom by $\sqrt{x+4} + 2$: the top becomes $(x + 4) - 4 = x$, which cancels, leaving $\dfrac{1}{\sqrt{x+4} + 2} \to \dfrac14$. L’Hôpital: $\dfrac{e^x - 1}{x}$ is $\frac00$ at 0; differentiate top and bottom separately to get $\dfrac{e^x}{1} \to 1$.
Each function has a problem point where plugging in gives 0/0. Zoom in around it: the graph has a single missing point (the hollow dot), and the limit is the height of that hole. The table shows values creeping up on it from both sides.
Evaluate the following limit: $$\lim_{x\to0}\frac{\ln\big((x^2 + 1)\cos x\big)}{x^2} = \underline{\hspace{3em}}.$$
Split the log of a product: $\ln\big((x^2+1)\cos x\big) = \ln(1 + x^2) + \ln(\cos x)$. So the limit is $\displaystyle\lim\frac{\ln(1 + x^2)}{x^2} + \lim\frac{\ln\cos x}{x^2}$.
$\ln(ab) = \ln a + \ln b$ turns one hard limit into two familiar ones.
First term: with $u = x^2 \to 0$, it’s $\frac{\ln(1 + u)}{u} \to 1$.
A standard limit after substitution.
Second term ($\frac00$): L’Hôpital gives $\dfrac{-\tan x}{2x} \to -\dfrac12$, since $\frac{\tan x}{x} \to 1$.
$\frac{d}{dx}\ln\cos x = \frac{-\sin x}{\cos x} = -\tan x$. (Or Taylor: $\ln\cos x \approx -\frac{x^2}{2}$.)
Total: $1 - \tfrac12 = $ 0.5.
Official key: 0.5.
Warm-up. Find $\displaystyle\lim_{x\to3}\frac{x^2 - 9}{x - 3}$.
Factor the top: $x^2 - 9 = (x - 3)(x + 3)$.
Cancel $(x - 3)$ to get $x + 3 \to 6$.
Warm-up. Find $\displaystyle\lim_{x\to\infty}\frac{2x + 1}{x - 4}$.
For large $x$ only the leading terms matter.
$\frac{2x}{x} = 2$. (Dividing top and bottom by $x$: $\frac{2 + 1/x}{1 - 4/x} \to 2$.)
$\displaystyle\lim_{t\to+\infty}\left(\sqrt{t^2 + t} - t\right) = $ ______ (Round off to one decimal place)
∞ − ∞ form. Multiply and divide by the conjugate $\sqrt{t^2 + t} + t$.
$\sqrt{t^2+t} - t = \dfrac{(t^2 + t) - t^2}{\sqrt{t^2 + t} + t} = \dfrac{t}{\sqrt{t^2 + t} + t} = \dfrac{1}{\sqrt{1 + 1/t} + 1} \to \dfrac12$. Official key: 0.5.
$\displaystyle\lim_{x\to0}\frac{\sin 3x}{x}$.
Write it as $3\cdot\frac{\sin 3x}{3x}$.
$3\times1 = 3$.
$\displaystyle\lim_{x\to0}\frac{e^{2x} - 1}{x}$.
Substitute $u = 2x$, or use L’Hôpital.
$2\cdot\frac{e^{2x} - 1}{2x} \to 2$. L’Hôpital: $\frac{2e^{2x}}{1} \to 2$.
$\displaystyle\lim_{x\to\infty}\frac{3x^2 + 1}{x^2 - 5}$.
Divide top and bottom by $x^2$.
$\frac{3 + 1/x^2}{1 - 5/x^2} \to 3$.
Find $\displaystyle\lim_{x\to0}\left(\frac{1 + \tan x}{1 + \sin x}\right)^{1/x^3}$. (Round off to two decimal places.)
This is a $1^\infty$ form. Take logs first, then write $\ln(1 + \tan x) - \ln(1 + \sin x)$ using $\ln(1 + u) = u - \frac{u^2}{2} + \cdots$ and the series for $\tan x$ and $\sin x$.
Call the limit $L$. Then $\ln L = \displaystyle\lim_{x\to0}\frac{\ln(1 + \tan x) - \ln(1 + \sin x)}{x^3}$, a $\frac00$ form.
Using $\ln(1 + u) = u - \frac{u^2}{2} + \cdots$, the numerator is $(\tan x - \sin x) - \frac12(\tan^2 x - \sin^2 x) + \cdots$.
Now $\tan x - \sin x = \left(x + \frac{x^3}{3}\right) - \left(x - \frac{x^3}{6}\right) + \cdots = \frac{x^3}{2} + \cdots$, while $\tan^2 x - \sin^2 x = x^4 + \cdots$ is too small to matter after dividing by $x^3$.
So $\ln L = \frac12$ and $L = e^{1/2} \approx 1.65$.
The limit $\displaystyle\lim_{x\to0}\frac{e^{ax} - 1 - \ln(1 + 2x)}{x^2}$ exists and is finite. Find $a$ and the value of the limit.
The top and bottom both vanish at 0. For the ratio to stay finite, the $x$ term on top must cancel. Expand to the $x^2$ term, or apply L’Hôpital once and ask what the new top must be at $x = 0$.
Expand: $e^{ax} - 1 = ax + \frac{a^2x^2}{2} + \cdots$ and $\ln(1 + 2x) = 2x - \frac{(2x)^2}{2} + \cdots = 2x - 2x^2 + \cdots$.
The numerator is $(a - 2)x + \left(\frac{a^2}{2} + 2\right)x^2 + \cdots$. Divided by $x^2$, the first term blows up unless $a = 2$.
With $a = 2$, the limit is $\frac{4}{2} + 2 = 4$.
(The L’Hôpital route agrees: after one round the quotient is $\dfrac{ae^{ax} - \frac{2}{1 + 2x}}{2x}$, whose top must vanish at 0, so $a = 2$; a second round gives $\dfrac{a^2e^{ax} + \frac{4}{(1 + 2x)^2}}{2} \to \dfrac{4 + 4}{2} = 4$.) So $a = 2$ and the limit is 4.
The value of $\displaystyle\lim_{x\to\infty} x\left(\sqrt{x^2 + 2x} - x - 1\right)$ is
- $0$
- $-\frac12$
- $\frac12$
- $+\infty$
The bracket tends to 0 and $x$ tends to $\infty$, so you need how fast the bracket shrinks. Write $\sqrt{x^2 + 2x} = x\sqrt{1 + 2/x}$ and expand $\sqrt{1 + u}$ to the $u^2$ term.
For large $x$, $\sqrt{x^2 + 2x} = x\sqrt{1 + u}$ with $u = \frac2x$, and $\sqrt{1 + u} = 1 + \frac u2 - \frac{u^2}{8} + \cdots$.
So $\sqrt{x^2 + 2x} = x\left(1 + \frac1x - \frac{1}{2x^2} + \cdots\right) = x + 1 - \frac{1}{2x} + \cdots$.
The bracket is $-\frac{1}{2x} + \cdots$, and multiplying by $x$ gives $-\frac12$. Stopping at the first-order term gives 0, the trap in (A); a sign slip in the $u^2$ term gives (C). Answer: (B) $-\frac12$.
- Try direct substitution first; only a $\frac00$, $\frac\infty\infty$ or $\infty - \infty$ needs more work.
- Use log rules and substitutions to reach a standard limit.
- Check that the form really is $\frac00$ or $\frac\infty\infty$ before applying L’Hôpital.
- Applying L’Hôpital to a form that isn’t indeterminate, which gives wrong answers.
- Differentiating the quotient with the quotient rule. L’Hôpital differentiates top and bottom separately.
- Assuming a limit equals the function’s value at the point; the function may not even be defined there.
- A limit is where f is heading near a, regardless of f(a); it exists when the left and right limits agree.
- Standard limits: sin x/x → 1, (1 − cos x)/x² → ½, (eˣ − 1)/x → 1, ln(1 + x)/x → 1.
- For indeterminate forms: factor, use a conjugate, substitute into a standard limit, apply L’Hôpital, or use Taylor.
$\displaystyle\lim_{x\to0}\frac{1 - \cos x}{x^2}$ is
$f(x) = \dfrac{|x|}{x}$. The limit as $x \to 0$
L’Hôpital’s rule can be applied directly to $\displaystyle\lim_{x\to0}\frac{x + 1}{x + 2}$?
Continuity and differentiability: no gaps, no corners
A function is continuous at a point if its graph has no gap or jump there, and differentiable if it also has no sharp corner: there’s a single well-defined tangent.
GATE asks this every year: piecewise functions whose pieces must join smoothly (2024 Q37), whether ReLU is differentiable (2025 Q48), and which combinations of differentiable functions stay differentiable (2025 Q24).
It’s like a road: continuous means no missing bridges; differentiable means no hairpin corners either, so you could drive it at speed without a sudden change of direction.
Piecewise functions, ReLU and absolute values, and “always differentiable?” MSQs.
Two pictures first. A jump: $f(x) = x + 1$ for $x \lt 1$ and $f(x) = 3$ for $x \ge 1$. Coming from the left the graph heads to height 2, but at $x = 1$ it is at 3: you’d have to lift your pen. That function is not continuous at 1. A corner: $|x|$ has slope $-1$ just left of 0 and $+1$ just right of it. The graph is unbroken, but there is no single tangent at 0, so $|x|$ is continuous but not differentiable there. Every question in this chapter checks for one of these two defects.
$f$ is continuous at $a$ if $\lim_{x\to a} f(x) = f(a)$: the limit exists, $f(a)$ exists, and they agree.
$f$ is differentiable at $a$ if $f'(a) = \lim_{h\to0}\frac{f(a+h) - f(a)}{h}$ exists. For that, the left slope (with $h \to 0^-$) must equal the right slope ($h \to 0^+$).
Differentiable ⇒ continuous, but not the other way round: $|x|$ and ReLU are continuous at 0 but have corners there (left slope ≠ right slope).
At each boundary point, write two equations:
- Values match (continuity): left piece = right piece at the boundary.
- Slopes match (differentiability): derivative of the left piece = derivative of the right piece there.
Two boundaries give four equations, enough for the unknown coefficients (and to check the options).
If $f$ and $g$ are differentiable at $c$: $f \pm g$, $fg$, and $f/g$ (when $g(c) \ne 0$) are differentiable at $c$. A composition $f(g(x))$ is differentiable at $c$ if $g$ is differentiable at $c$ and $f$ is differentiable at $g(c)$. Knowing $f$ only at $c$ isn’t enough for $f\circ g$.
This is the function from GATE 2024 Q37: $-x$ on the left, $ax^2 + bx + c$ in the middle, $x$ on the right. Adjust $a, b, c$ until the pieces meet (no jumps) and the slopes agree at both joins (no corners). The readout reports each condition at $x = -2$ and $x = 2$.
Let $f:\R\to\R$ be a function. (Note: $\R$ denotes the set of real numbers.)
$$f(x) = \begin{cases}-x, & \text{if } x \lt -2\\ ax^2 + bx + c, & \text{if } x\in[-2, 2]\\ x, & \text{if } x \gt 2\end{cases}$$Which ONE of the following choices gives the values of $a, b, c$ that make the function $f$ continuous and differentiable?
- $a = \frac14,\ b = 0,\ c = 1$
- $a = \frac12,\ b = 0,\ c = 0$
- $a = 0,\ b = 0,\ c = 0$
- $a = 1,\ b = 1,\ c = -4$
At $x = 2$: values $4a + 2b + c = 2$; slopes $4a + b = 1$ (the middle piece’s derivative $2ax + b$ at 2 must equal the right piece’s slope 1).
Left limit = right limit = value, and left slope = right slope.
At $x = -2$: values $4a - 2b + c = 2$ (the left piece gives $-(-2) = 2$); slopes $-4a + b = -1$.
The left piece $-x$ has slope $-1$.
Subtracting the two value equations gives $4b = 0$, so $b = 0$. Then $4a = 1$ gives $a = \frac14$, and $1 + c = 2$ gives $c = 1$. Answer (A).
Check: the middle piece $\frac{x^2}{4} + 1$ has value 2 and slope ±1 at ±2, matching both outer pieces. (This smooths out the corner of $|x|$.) Official key: (A).
Warm-up. $f(x) = x^2$ for $x \lt 2$ and $f(x) = ax$ for $x \ge 2$. Which $a$ makes $f$ continuous at 2?
Make the two pieces agree at $x = 2$.
Left: $2^2 = 4$. Right: $2a$. So $a = 2$.
Warm-up. Is $f(x) = |x - 1|$ differentiable at $x = 1$?
Compare the slope just left of 1 with the slope just right of 1.
Left slope $-1$, right slope $+1$: a corner, so no. (It is continuous there.)
Consider two functions $f:\R\to\R$ and $g:\R\to(1, \infty)$. Both functions are differentiable at a point $c$. Which of the following functions is/are ALWAYS differentiable at $c$? The symbol $\cdot$ denotes product and the symbol $\circ$ denotes composition of functions.
- $f \pm g$
- $f\cdot g$
- $\dfrac fg$
- $f\circ g + g\circ f$
Sums, products and quotients are safe if the denominator isn’t zero (and $g \gt 1$). For $f(g(x))$, you need $f$ differentiable at $g(c)$, which isn’t given.
(A), (B) ✓. (C) ✓ because $g \gt 1$, so it’s never zero. (D) ✗: $f\circ g$ needs $f$ to be differentiable at the point $g(c)$, and we only know about $f$ at $c$. (Similarly $g\circ f$ needs $g$ differentiable at $f(c)$.) Official key: A; B; C.
Which of the following statements is/are correct about the rectified linear unit (ReLU) activation function defined as ReLU($x$) = max($x$, 0), where $x\in\R$?
- ReLU is continuous everywhere
- ReLU is differentiable everywhere
- ReLU is not differentiable at $x = 0$
- ReLU($x$) = ReLU($ax$), for all $a\in\R$
Left slope at 0 is 0, right slope is 1. For (D), try $a = -1$ or $a = 2$.
(A) ✓: no jumps. (B) ✗ and (C) ✓: a corner at 0 (slopes 0 and 1). (D) ✗: ReLU(1) = 1 but ReLU(−1·1) = 0. Official key: A; C.
Let $f:\R\to\R$ be such that $|f(x) - f(y)| \le (x - y)^2$ for all $x, y\in\R$. Then $f(1) - f(0) = $ ______ (Answer in integer)
Divide by $|x - y|$ and let $y \to x$. What does that say about $f'(x)$?
$\left|\frac{f(x) - f(y)}{x - y}\right| \le |x - y| \to 0$, so $f'(x) = 0$ for every $x$: $f$ is constant. Hence $f(1) - f(0) = 0$. Official key: 0.
$f(x) = kx + 1$ for $x \lt 1$ and $f(x) = x^2 + 2$ for $x \ge 1$. For which $k$ is $f$ continuous? Is it then differentiable at 1? (Enter $k$.)
Match the values at 1: $k + 1 = 3$. Then compare slopes: $k$ versus $2x$ at 1.
$k + 1 = 1 + 2$ gives $k = 2$. Slopes: left 2, right $2\cdot1 = 2$. They match, so it’s differentiable too.
Let $a \gt 0$ and define $f(x) = \dfrac{1 - \cos(ax)}{x^2}$ for $x \lt 0$, $f(0) = b$, and $f(x) = \dfrac{\sqrt{1 + x} - 1}{x}$ for $x \gt 0$. Find $a$ and $b$ that make $f$ continuous at 0, and then the right-hand derivative $\displaystyle\lim_{h\to0^+}\frac{f(h) - f(0)}{h}$.
Find both one-sided limits at 0 and set them equal to $b$. For the right derivative, expand $\sqrt{1 + h}$ to the $h^2$ term.
Left: $1 - \cos(ax) = \frac{a^2x^2}{2} - \cdots$, so the left limit is $\frac{a^2}{2}$. Right: $\sqrt{1 + x} - 1 = \frac x2 - \frac{x^2}{8} + \cdots$, so the right limit is $\frac12$.
Continuity needs $\frac{a^2}{2} = \frac12 = b$, so $a = 1$ (since $a \gt 0$) and $b = \frac12$.
Right derivative: $f(h) = \frac12 - \frac h8 + \cdots$ for small $h \gt 0$, so $\frac{f(h) - \frac12}{h} \to -\frac18$.
(On the left, $f(x) = \frac12 - \frac{x^2}{24} + \cdots$, so the left derivative is 0. The two differ: $f$ is continuous but not differentiable at 0.) So $a = 1$, $b = 0.5$, right derivative $-0.125$.
Let $f(x) = ax^2 + bx$ for $x \le 1$ and $f(x) = x\ln x + 2$ for $x \gt 1$. If $f$ is differentiable at $x = 1$, find $f(-1)$.
Differentiable at 1 means two conditions: the values match at 1 and the slopes match at 1. That gives two equations in $a$ and $b$.
Values at 1: the left piece gives $a + b$; the right piece tends to $1\cdot\ln 1 + 2 = 2$. So $a + b = 2$.
Slopes at 1: the left piece has slope $2a + b$; the right piece has derivative $\ln x + 1$, which is 1 at $x = 1$. So $2a + b = 1$.
Subtracting, $a = -1$, and then $b = 3$.
$f(-1) = a(-1)^2 + b(-1) = -1 - 3 = -4$.
Which of the following statements is/are correct?
- $f(x) = |x^2 - 4x + 3|$ fails to be differentiable at exactly two points of $\R$.
- $g(x) = (x - 1)|x - 1|$ is differentiable at $x = 1$.
- $h(x) = |\sin x|$ is differentiable at $x = 0$.
- $k(x) = \max(x, x^2)$ is differentiable at $x = 1$.
For each one, find the left and right slopes at the suspicious point. An absolute value only creates a corner where the inside crosses zero with a non-zero slope.
(A) ✓. $x^2 - 4x + 3 = (x - 1)(x - 3)$ crosses zero at 1 and 3 with slopes $-2$ and $2$. Taking the absolute value flips the sign on one side, so the one-sided slopes are $\mp2$ at 1 and $\mp2$ at 3: two corners, and nowhere else.
(B) ✓. $\frac{g(x) - g(1)}{x - 1} = |x - 1| \to 0$ from both sides, so $g'(1) = 0$. The extra factor $(x - 1)$ smooths the corner.
(C) ✗. Near 0, $|\sin x| \approx |x|$: slopes $-1$ on the left and $1$ on the right.
(D) ✗. Just left of 1, $x \gt x^2$, so $k = x$ with slope 1; just right of 1, $k = x^2$ with slope 2. A corner. Answer: A; B.
- At every join of a piecewise function, check values first, then slopes.
- Remember the classic corners: $|x|$, ReLU and $\max/\min$ of functions.
- For compositions, ask where the outer function is being evaluated.
- Concluding differentiability from continuity alone.
- Checking only one boundary of a piecewise function.
- Assuming $f\circ g$ is differentiable at $c$ because $f$ is.
- Continuous at a: lim f(x) = f(a). Differentiable at a: left slope = right slope (so no corner).
- Differentiable ⇒ continuous, not conversely: |x| and ReLU are continuous everywhere but not differentiable at 0.
- Piecewise functions: match values and slopes at every boundary. Sums, products and quotients (non-zero denominator) preserve differentiability; compositions need care.
$|x - 3|$ is
A function with a jump at $x = 1$ is
$f(x) = x|x|$ at $x = 0$ is
$\displaystyle\lim_{x\to0}\frac{\ln(1 + 5x)}{x}$ is
Which is continuous at 0 but not differentiable there?
By L’Hôpital, $\displaystyle\lim_{x\to0}\frac{\sin x - x}{x^3}$ equals