GATE CS & DA Preparation Guide Module 4 – Engineering mathematics (CS section 1; DA sections 1-3)
Limits, MVT, integrals, Taylor series and optima
GATE CS and DA calculus: limits, continuity and differentiability, the mean value theorem, definite integrals, Taylor series and one-variable optima.
What you will learn
- Evaluate limits by algebra, standard limits and series, using L'Hôpital's rule only on 0/0 and ∞/∞ forms
- Test continuity and differentiability at a point, including piecewise functions
- Apply the mean value theorem and evaluate definite integrals with standard techniques
- Use Taylor series for limits and approximations, with a bound on the error
- Find the global optima of a function on a closed interval by comparing every candidate
Before you start
What you’ll learn · Before you start
What you will learn
- Evaluate limits by algebra, standard limits and series, using L'Hôpital's rule only on 0/0 and ∞/∞ forms
- Test continuity and differentiability at a point, including piecewise functions
- Apply the mean value theorem and evaluate definite integrals with standard techniques
- Use Taylor series for limits and approximations, with a bound on the error
- Find the global optima of a function on a closed interval by comparing every candidate
Before you start
On this page
(1 − cos x)/x² tends to 1/2 as x → 0: a NAT question wants one such number, which a fixed method finds. Section 1 of the GATE CS syllabus lists calculus as limits, continuity and differentiability, maxima and minima, the mean value theorem and integration; section 3 of the DA syllabus adds Taylor series and one-variable optimisation.
Limits yield to algebra, standard limits, series or L’Hôpital’s rule, which applies only to 0/0 and ∞/∞ forms. By the mean value theorem (MVT), a function continuous on [a, b] and differentiable on (a, b) has a point c in (a, b) where f′(c) equals the slope of the chord. Definite integrals rest on substitution, integration by parts and a few symmetry properties. Taylor series give limits and approximations, with a bound on the error. Global optima on [a, b] come from comparing f at the endpoints and the critical points.
Not affiliated
MySmartCoPilot is independent of IIT Madras, IISc and the IITs.
Limits: try algebra and series before the derivative rule
1. Limits (NAT). (1 − cos x)/x² → 1/2 as x → 0, because 1 − cos x = x²/2 − x⁴/24 + ⋯.
Substitute first. If that gives 0/0 or ∞/∞, an indeterminate form: A limit whose shape, such as 0/0 or ∞/∞, does not decide its value. It needs algebra, a series or L'Hôpital's rule, which applies directly to these two shapes only., factor, use standard limits or series, and only then L’Hôpital’s rule. The trap is L’Hôpital on a form that is not indeterminate. Step through the tools on example 1:
The drawing shows the whole scene; its 5 steps are listed below.
Every step as text
- Substitute first. Put x = 0 into (1 − cos x)/x². The top is 1 − 1 = 0 and the bottom is 0, so substitution gives 0/0, which is not a number.
- Name the form. 0/0 is an indeterminate form, so its shape says nothing about the value. Only 0/0 and ∞/∞ qualify for L'Hôpital's rule later on.
- Algebra. Factoring, cancelling or rationalising removes many 0/0 forms. Here 1 − cos x has no visible factor x to cancel, so move on.
- A series. The series of cos x gives 1 − cos x = x²/2 − x⁴/24 + ⋯, so the ratio is 1/2 − x²/24 + ⋯, which tends to 1/2.
- The rule, last. L'Hôpital's rule works here too, twice, through sin x/(2x) and cos x/2, and gives 1/2. Keep it for genuine 0/0 or ∞/∞ forms, after the other tools.
Checkpoint
Check: Limits by algebra, series and the derivative rule
Four series turn a limit into arithmetic
Four Maclaurin series: The Taylor series of a function about 0: the sum of f⁽ⁿ⁾(0)xⁿ/n! for n = 0, 1, 2, …, such as 1 + x + x²/2! + x³/3! + ⋯ for eˣ., Taylor series about 0, do most of the work:
| Function | Its Maclaurin series |
|---|---|
| eˣ | 1 + x + x²/2! + x³/3! + ⋯ |
| sin x | x − x³/3! + x⁵/5! − ⋯ |
| cos x | 1 − x²/2! + x⁴/4! − ⋯ |
| ln(1 + x) | x − x²/2 + x³/3 − ⋯ |
The trap is stopping before the first term that survives.
Stopping one term too early
In (e^(2x) − 1 − 2x)/x², stopping at e^(2x) ≈ 1 + 2x leaves 0 on top; the next term, 2x², survives, and the limit is 2, as the SymPy run below confirms.
Checkpoint
Check: Limits by algebra, series and the derivative rule
Continuity needs the values to meet, differentiability the slopes too
2. Differentiability (MCQ). |x − 2| is continuous at 2 but not differentiable there: the derivative is −1 from the left and +1 from the right.
To test a point, compare the left and right limits with the value, then the left and right one-sided derivative: The limit of (f(a + h) − f(a))/h as h tends to 0 from one side only. f is differentiable at a exactly when both one-sided derivatives exist and are equal.. Differentiability at a point implies continuity there, but not the other way round. The trap: |x| is continuous at 0 but not differentiable there. Step through both tests on example 2:
The drawing shows the whole scene; its 5 steps are listed below.
Every step as text
- The value. At x = 2 the function is |2 − 2| = 0.
- The limits. Just left of 2, f(x) = 2 − x, and just right of it, f(x) = x − 2. Both tend to 0 as x tends to 2.
- Continuity. The two one-sided limits equal f(2), so f is continuous at 2. The graph has no jump there.
- The slopes. The one-sided derivatives are the slopes of the two pieces, −1 from the left and +1 from the right.
- Differentiability. The slopes differ, so f is not differentiable at 2. The graph has a corner and no tangent there, although it is continuous.
Checkpoint
Check: Continuity, differentiability and the MVT
The mean value theorem promises a tangent parallel to the chord
3. The MVT (NAT). For f(x) = x² on [1, 3] the chord slope is (9 − 1)/2 = 4, and f′(c) = 2c = 4 gives c = 2.
Rolle’s theorem is the case f(a) = f(b), where f′(c) = 0. Check the conditions, then solve f′(c) = (f(b) − f(a))/(b − a). The trap is a c outside (a, b), or a corner inside it. Step through example 3:
The drawing shows the whole scene; its 4 steps are listed below.
Every step as text
- The conditions. x² is continuous on [1, 3] and differentiable on (1, 3), as every polynomial is, so the theorem applies.
- The chord. The chord joins (1, 1) and (3, 9), so its slope is (9 − 1)/(3 − 1) = 4.
- The tangent. The theorem promises a c in (1, 3) where the tangent is parallel to the chord, so f′(c) = 2c must equal 4.
- The point. c = 2, inside (1, 3). A solution outside the open interval would be a slip, because the theorem promises one inside.
Checkpoint
Check: Continuity, differentiability and the MVT
Definite integrals: look for symmetry before computing
4. Integrals (NAT). On [−1, 1], x³ is odd and x² even, so the integral of x³ + x² is 0 + 2/3 ≈ 0.667.
The tools are substitution, parts, odd and even symmetry, and f(x) against f(a − x). Integrals of an odd function: A function with f(−x) = −f(x), such as x³ or sin x. Its integral over any interval [−a, a] is 0. over [−a, a] are 0, and of an even function twice the integral over [0, a]. The trap is keeping the old limits after a substitution. The program checks five answers against the values worked by hand:
import math
from scipy.integrate import quad
from sympy import Abs, E, Rational, diff, exp, integrate, limit, oo, sin, symbols
x = symbols("x", real=True)
checks = [
("lim x->0 (e^(2x) - 1 - 2x) / x^2", limit((exp(2 * x) - 1 - 2 * x) / x**2, x, 0), 2),
("lim x->0 (sin 3x - 3x) / x^3", limit((sin(3 * x) - 3 * x) / x**3, x, 0), Rational(-9, 2)),
("lim x->oo (1 + 3/x)^(2x)", limit((1 + 3 / x) ** (2 * x), x, oo), E**6),
("integral of x e^x from 0 to 1", integrate(x * exp(x), (x, 0, 1)), 1),
("integral of |x - 1| from 0 to 3", integrate(Abs(x - 1), (x, 0, 3)), Rational(5, 2)),
]
for label, sympy_value, by_hand in checks:
agree = sympy_value == by_hand
print(f"{label:<34} SymPy {str(sympy_value):<7} by hand {str(by_hand):<7} agree {agree}")
# With f(x) + f(pi/2 - x) = 1 on [0, pi/2], the integral of f is half the length of the interval: pi/4.
value, error = quad(lambda t: math.sin(t) ** 3 / (math.sin(t) ** 3 + math.cos(t) ** 3), 0, math.pi / 2)
print(f"integral of sin^3 / (sin^3 + cos^3) on [0, pi/2]: quad {value:.12f}, pi/4 = {math.pi / 4:.12f}")
# One-sided difference quotients at 0: x|x| is differentiable there, |x| is not.
h = symbols("h", positive=True)
for f in (x * Abs(x), Abs(x)):
right = limit((f.subs(x, h) - f.subs(x, 0)) / h, h, 0)
left = limit((f.subs(x, -h) - f.subs(x, 0)) / (-h), h, 0)
verdict = "differentiable" if left == right else "not differentiable"
print(f"f(x) = {f}: derivative from the left {left}, from the right {right}: {verdict} at 0")
xp, xn = symbols("x", positive=True), symbols("x", negative=True)
print(f"derivative of x|x|: {diff(xp * Abs(xp), xp)} for x > 0 and {diff(xn * Abs(xn), xn)} for x < 0, so 2|x| everywhere") Output
lim x->0 (e^(2x) - 1 - 2x) / x^2 SymPy 2 by hand 2 agree True lim x->0 (sin 3x - 3x) / x^3 SymPy -9/2 by hand -9/2 agree True lim x->oo (1 + 3/x)^(2x) SymPy exp(6) by hand exp(6) agree True integral of x e^x from 0 to 1 SymPy 1 by hand 1 agree True integral of |x - 1| from 0 to 3 SymPy 5/2 by hand 5/2 agree True integral of sin^3 / (sin^3 + cos^3) on [0, pi/2]: quad 0.785398163397, pi/4 = 0.785398163397 f(x) = x*Abs(x): derivative from the left 0, from the right 0: differentiable at 0 f(x) = Abs(x): derivative from the left -1, from the right 1: not differentiable at 0 derivative of x|x|: 2*x for x > 0 and -2*x for x < 0, so 2|x| everywhere
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 calc_check.py
Each limit and integral agrees with the value worked by hand. The quad line confirms an integral that a symmetry settles in one step: sin³x/(sin³x + cos³x) and its value at π/2 − x add up to 1, so the integral over [0, π/2] is half the length of the interval, π/4. The last lines show the difference between x|x|, which is differentiable at 0 with derivative 2|x|, and |x|, whose derivatives from the left and the right disagree.
Checkpoint
Check: Definite integrals by symmetry
Global optima on a closed interval sit at endpoints, stationary points or corners
5. Optima (NAT). f(x) = x(6 − x) on [0, 4] has f′(x) = 6 − 2x = 0 at x = 3, f(3) = 9, while f(0) = 0 and f(4) = 8, so the maximum is 9.
The diagram lists where to look:
Where the global optima of f on [a, b] can be
Text description of the diagram
The chart reads from top to bottom.
- The goal: the global maximum and minimum of a continuous function f on a closed interval [a, b]. They exist, because f is continuous on a closed and bounded interval.
- A group titled "List every candidate" holds three kinds of point: the endpoints a and b; the stationary points, where f'(c) = 0 with c inside (a, b); and the points inside (a, b) where f' does not exist, such as a corner of |x - 1|.
- Evaluate f at every candidate.
- Compare: the largest value is the global maximum and the smallest is the global minimum.
A point outside [a, b] is never a candidate, and an endpoint is always one.
A continuous function on a closed interval has a global maximum and a global minimum, and each sits at one of three kinds of point. Local optima inside the interval are stationary point: A point where f′(x) = 0, such as x = 3 for 6x − x². With the endpoints and the corners, the stationary points are the candidates for the global optima of f on [a, b]. or corners, so the endpoints are the only extra candidates. Evaluating f at every candidate and comparing is exact, needs no second derivative and cannot miss an endpoint maximum.
The trap is ignoring the endpoints. Step through example 5:
The drawing shows the whole scene; its 4 steps are listed below.
Every step as text
- The derivative. f(x) = x(6 − x) = 6x − x², so f′(x) = 6 − 2x, which is 0 at x = 3. A polynomial has no corners, so there are no other points to add.
- The candidates. The candidates are the endpoints 0 and 4 and the stationary point 3, which lies inside [0, 4].
- The values. Evaluate f at each candidate: f(0) = 0, f(3) = 9 and f(4) = 8.
- The verdict. The largest value, 9 at x = 3, is the global maximum, and the smallest, 0 at the endpoint x = 0, is the global minimum. Leaving out the endpoints would lose the minimum.
Checkpoint
Check: Global optima on a closed interval
Practise: calculus in GATE’s formats
Practise all four ideas, starting with the one you know least.
Practice that adapts to you
Practise this lesson
16 questions about 8 ideas of this lesson. Each answer is explained at once, and what you get right is kept in this browser.
Taylor series, limits and the MVT: errors measured and conditions tested Pro: opens with a Pro, Premium or Ultimate pass
A series turns a hard limit into arithmetic, and its error bound says how many terms an approximation needs. This part measures that bound, works three limit families by series, shows a limit that L’Hôpital’s rule cannot do, and tests the conditions of Rolle’s theorem and the MVT.
In this part:
- Maclaurin polynomials of eˣ at 0.5, with the Lagrange bound measured
- Three limit families, worked by series
- Piecewise functions: continuity and differentiability, worked
- A limit that L’Hôpital’s rule cannot do
- Rolle’s theorem and the MVT: conditions tested, c found
2 runnable examples (Python) · about 5 minutes
Opening this part with your pass…
This part opens with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so this part can’t be opened at the moment. The free part above stands on its own. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
Integrals and optimisation: properties, improper integrals and the endpoint trap Pro: opens with a Pro, Premium or Ultimate pass
Many definite integrals fall to one property, and the usual optimisation mistake is a candidate left out. This part works the symmetry properties, decides which improper integrals converge, reproduces an optimiser stopping at a local maximum, and ends with an exercise and a ten-minute set.
In this part:
- Definite-integral properties, worked
- Improper integrals: which converge
- The optimiser that stopped at a local maximum, measured
- Find the global extrema on a closed interval
- Results of the sample tests
- Convexity and the second-derivative test
- A ten-minute set, with answers
- A rubric for the set
2 runnable examples (Python) · 1 exercise with sample tests · about 6 minutes
Opening this part with your pass…Pro part. It opens with the same pass as the part above.
Interview questions
-
Fresher · Warm-up
What is the difference between continuity and differentiability at a point, and which one implies the other?
A function is continuous at a when its limit there exists and equals f(a): the graph has no jump or hole. It is differentiable at a when the difference quotient (f(a + h) − f(a))/h has a limit as h → 0, so the graph has a tangent there. Differentiability implies continuity, because f(a + h) − f(a) is the quotient times h, which tends to 0. The reverse fails: |x − 2| is continuous at 2 but has slope −1 from the left and +1 from the right, so it is not differentiable there. To test a glued function, check that the pieces meet, then that their one-sided derivatives agree.
-
Fresher to mid
Find the global maximum and minimum of f(x) = |x − 1| + |x − 3| on [0, 4], and say where each is reached. Why does setting f′(x) = 0 not work here?
-
Fresher to mid
A candidate applies L'Hôpital's rule to the limit of (2x + cos x)/x as x → ∞, gets (2 − sin x)/1 and concludes that the limit does not exist. Is the conclusion right? What is the limit, and what exactly does the rule promise?
-
Fresher to mid
How many terms of the Maclaurin series of eˣ do you need to be sure that the error at x = 0.5 is below 10⁻⁴? Justify the number with an error bound, not with a calculator comparison.
Key takeaways
- For a limit, factor, use standard limits or series, and keep L’Hôpital’s rule for genuine 0/0 or ∞/∞ forms.
- Differentiable implies continuous, not the reverse; check the MVT’s conditions before solving for c.
- For an integral, look for symmetry first, odd or even and f(x) against f(a − x), before computing anything.
- For global optima on [a, b], compare f at the endpoints and the critical points, every time.
Terms in this lesson
- indeterminate form
- A limit whose shape, such as 0/0 or ∞/∞, does not decide its value. It needs algebra, a series or L'Hôpital's rule, which applies directly to these two shapes only.
- Maclaurin series
- The Taylor series of a function about 0: the sum of f⁽ⁿ⁾(0)xⁿ/n! for n = 0, 1, 2, …, such as 1 + x + x²/2! + x³/3! + ⋯ for eˣ.
- odd function
- A function with f(−x) = −f(x), such as x³ or sin x. Its integral over any interval [−a, a] is 0.
- one-sided derivative
- The limit of (f(a + h) − f(a))/h as h tends to 0 from one side only. f is differentiable at a exactly when both one-sided derivatives exist and are equal.
- stationary point
- A point where f′(x) = 0, such as x = 3 for 6x − x². With the endpoints and the corners, the stationary points are the candidates for the global optima of f on [a, b].
References
- GATE 2027 syllabus, Computer Science and Information Technology (section 1) (Indian Institute of Technology Madras (GATE 2027))
- GATE 2027 syllabus, Data Science and Artificial Intelligence (section 3) (Indian Institute of Technology Madras (GATE 2027))
- MIT OpenCourseWare 18.01SC Single Variable Calculus (Massachusetts Institute of Technology)
- SymPy tutorial: calculus (limit, diff, integrate, series) (SymPy Development Team)
- scipy.integrate: quad (SciPy)
- scipy.optimize.minimize_scalar (SciPy)
- math: exp and factorial (Python Software Foundation)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress