Lesson 35 of 36 · Beyond basic maths (optional)

Derivatives and optimisation

Optional: derivative rules, maxima and minima, profit maximisation with MR = MC, and partial derivatives and gradients of two-variable functions.

About 25 minutes

In this lesson

  • Differentiate powers, exponentials, logarithms, products, quotients and compositions by hand.
  • Find a maximum or minimum where the first derivative is zero and confirm it with the second derivative, or with the vertex formula for a parabola.
  • Maximise profit by setting marginal revenue equal to marginal cost, and check that the result is a maximum.
  • Compute partial derivatives and the gradient of a function of two variables.

The idea

Why this lesson is optional

Bocconi's current test page describes quantitative reasoning as numerical and logical problems using basic mathematics, and it publishes no topic list. A 2024 sample test on Bocconi's website, which the current page does not link to and which may not reflect today's form, included an item on the gradient of a function of two variables. Nothing confirms that calculus appears on the current test. Treat this lesson as extra preparation for that possibility, after the core quantitative reasoning lessons.

What a derivative measures

The derivative f′(x)f'(x) is the slope of the graph of ff at the point xx: how fast ff changes per unit change in xx. For a straight line the slope is the same everywhere; for a curve it changes from point to point. In economics the derivative of a total is called a marginal quantity. If C(Q)C(Q) is the total cost of QQ units, the marginal cost C′(Q)C'(Q) is approximately the extra cost of one more unit.

The rules you need

Function Derivative Example
xnx^n nxn−1n x^{n-1} (4x3)′=12x2(4x^3)' = 12x^2
a constant 00 (500)′=0(500)' = 0
ekxe^{kx} kekxk e^{kx} (e3x)′=3e3x(e^{3x})' = 3e^{3x}
ln⁡x\ln x 1x\frac{1}{x} (5ln⁡x)′=5x(5\ln x)' = \frac{5}{x}
uvuv u′v+uv′u'v + uv' (xex)′=ex+xex(x e^x)' = e^x + x e^x
uv\frac{u}{v} u′v−uv′v2\frac{u'v - uv'}{v^2} (xx+1)′=1(x+1)2\left(\frac{x}{x+1}\right)' = \frac{1}{(x+1)^2}
f(g(x))f(g(x)) f′(g(x)) g′(x)f'(g(x))\, g'(x) (ln⁡(x2+1))′=2xx2+1\left(\ln(x^2 + 1)\right)' = \frac{2x}{x^2 + 1}

Sums are differentiated term by term, and a constant factor stays where it is. The power rule also covers roots and reciprocals once they are written as powers: x=x1/2\sqrt{x} = x^{1/2} has derivative 12x−1/2=12x\frac{1}{2}x^{-1/2} = \frac{1}{2\sqrt{x}}, and 1x=x−1\frac{1}{x} = x^{-1} has derivative −1x2-\frac{1}{x^2}.

The chain rule says: differentiate the outside function with the inside left alone, then multiply by the derivative of the inside. For (3x+1)4(3x + 1)^4 the outside is a fourth power and the inside is 3x+13x + 1, so the derivative is 4(3x+1)3×3=12(3x+1)34(3x + 1)^3 \times 3 = 12(3x + 1)^3. The rule for ekxe^{kx} in the table is the chain rule at work: the inside, kxkx, has derivative kk.

Maxima and minima

At a maximum or minimum of a smooth function, away from the ends of its domain, the graph is momentarily flat, so f′(x)=0f'(x) = 0. Points where this happens are stationary points. To tell which kind you have, look at the second derivative f′′(x)f''(x), the derivative of f′f':

  • f′′(x0)<0f''(x_0) < 0: the curve bends downwards there, so x0x_0 is a local maximum;
  • f′′(x0)>0f''(x_0) > 0: it bends upwards, so x0x_0 is a local minimum;
  • f′′(x0)=0f''(x_0) = 0: the test is silent; look at how the sign of f′f' changes on either side.

A point where f′′f'' changes sign is a point of inflection, where the curve switches between bending down and bending up. "Local" matters: a local maximum is the highest point nearby, not necessarily the highest value overall. When xx is restricted to an interval, compare the stationary values with the values at the ends.

Parabolas without calculus

For f(x)=ax2+bx+cf(x) = ax^2 + bx + c the derivative is 2ax+b2ax + b, which is zero at

x=−b2a.x = -\frac{b}{2a}.

That is the vertex, and the formula can be used without any calculus. If a<0a < 0 the parabola opens downwards and the vertex is its maximum; if a>0a > 0 it is its minimum. The vertex also lies midway between the roots, which gives a check: −x2+10x-x^2 + 10x has roots 0 and 10 and its maximum at x=5x = 5, and indeed −102×(−1)=5-\frac{10}{2 \times (-1)} = 5.

Marginal revenue, marginal cost and profit

Profit is revenue minus cost, π(Q)=R(Q)−C(Q)\pi(Q) = R(Q) - C(Q). Setting its derivative to zero gives R′(Q)=C′(Q)R'(Q) = C'(Q): marginal revenue equals marginal cost. The logic is plain. While one more unit adds more to revenue than to cost, producing it raises profit; the best output is where the two are equal.

MR=MC\text{MR} = \text{MC} is only the first condition. It can also hold where profit is at a minimum, so check the second derivative: profit is at a maximum when π′′(Q)=R′′(Q)−C′′(Q)<0\pi''(Q) = R''(Q) - C''(Q) < 0, that is, where marginal cost is rising faster than marginal revenue. When the price pp is fixed, R=pQR = pQ, so MR=p\text{MR} = p and the condition becomes p=MCp = \text{MC} with marginal cost rising. When the price falls as the firm sells more, marginal revenue is below the price: with demand P=a−bQP = a - bQ, revenue is aQ−bQ2aQ - bQ^2 and MR=a−2bQ\text{MR} = a - 2bQ.

Fixed costs have derivative zero. They change the level of profit but not the output that maximises it.

Partial derivatives and the gradient

A function of two variables, f(x,y)f(x, y), has two partial derivatives. For ∂f∂x\frac{\partial f}{\partial x}, treat yy as a fixed number and differentiate with respect to xx; for ∂f∂y\frac{\partial f}{\partial y}, do the reverse. For f(x,y)=x2y+3y2f(x, y) = x^2 y + 3y^2:

∂f∂x=2xy,∂f∂y=x2+6y.\frac{\partial f}{\partial x} = 2xy, \qquad \frac{\partial f}{\partial y} = x^2 + 6y.

The gradient collects them into a vector, in this order: ∇f=(∂f∂x,∂f∂y)\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right). At (1,2)(1, 2) it is (4,13)(4, 13). The gradient points in the direction in which ff rises fastest, and at an interior maximum or minimum both partial derivatives are zero.

In economics the partial derivatives of a production function are marginal products: ∂Q∂L\frac{\partial Q}{\partial L} is roughly the extra output from one more unit of labour with capital held fixed. For a Cobb–Douglas function Q=AKαLβQ = A K^{\alpha} L^{\beta} the exponents also describe returns to scale: if α+β=1\alpha + \beta = 1, doubling both inputs doubles output; if the sum is above 1, output more than doubles; below 1, it less than doubles.

Worked examples

Example 1: Classifying stationary points

Find and classify the stationary points of f(x)=x3−6x2+9x+2f(x) = x^3 - 6x^2 + 9x + 2, and find its point of inflection.

  1. Differentiate term by term: f′(x)=3x2−12x+9=3(x2−4x+3)=3(x−1)(x−3)f'(x) = 3x^2 - 12x + 9 = 3(x^2 - 4x + 3) = 3(x - 1)(x - 3).

  2. Stationary points are where f′(x)=0f'(x) = 0: x=1x = 1 and x=3x = 3.

  3. Second derivative: f′′(x)=6x−12f''(x) = 6x - 12. At x=1x = 1 it is −6<0-6 < 0, a local maximum; at x=3x = 3 it is 6>06 > 0, a local minimum.

  4. Values: f(1)=1−6+9+2=6f(1) = 1 - 6 + 9 + 2 = 6 and f(3)=27−54+27+2=2f(3) = 27 - 54 + 27 + 2 = 2. Check: between the two points ff should be falling, and f′(2)=12−24+9=−3<0f'(2) = 12 - 24 + 9 = -3 < 0.

  5. Inflection: f′′(x)=0f''(x) = 0 at x=2x = 2, and f′′f'' is negative before 2 and positive after, so the sign changes. f(2)=8−24+18+2=4f(2) = 8 - 24 + 18 + 2 = 4. The point (2,4)(2, 4) lies midway between (1,6)(1, 6) and (3,2)(3, 2), as it does for every cubic with two stationary points.

Answer

Local maximum at (1,6)(1, 6), local minimum at (3,2)(3, 2), point of inflection at (2,4)(2, 4). Stopping at f′(x)=0f'(x) = 0 and calling both points maxima is the tempting error; the second derivative shows that x=3x = 3 is a minimum.

Example 2: Profit with a linear demand curve

A firm faces the demand curve P=100−2QP = 100 - 2Q and has total cost C(Q)=20Q+300C(Q) = 20Q + 300. Which output maximises profit, and what is the maximum profit?

  1. Revenue is price times quantity: R(Q)=(100−2Q)Q=100Q−2Q2R(Q) = (100 - 2Q)Q = 100Q - 2Q^2.

  2. Profit: π(Q)=100Q−2Q2−20Q−300=−2Q2+80Q−300\pi(Q) = 100Q - 2Q^2 - 20Q - 300 = -2Q^2 + 80Q - 300, a parabola opening downwards because a=−2<0a = -2 < 0.

  3. Vertex, no calculus needed: Q=−802×(−2)=20Q = -\frac{80}{2 \times (-2)} = 20.

  4. Second route with marginals: MR=100−4Q\text{MR} = 100 - 4Q and MC=20\text{MC} = 20, equal when 4Q=804Q = 80, so Q=20Q = 20. And π′′(Q)=−4<0\pi''(Q) = -4 < 0, so this is a maximum.

  5. Profit at Q=20Q = 20: −2(400)+80(20)−300=−800+1600−300=500-2(400) + 80(20) - 300 = -800 + 1600 - 300 = 500. Check: the price is 100−40=60100 - 40 = 60, revenue 60×20=120060 \times 20 = 1200, cost 400+300=700400 + 300 = 700, profit 500.

Answer

Output 20, at a price of 60, gives the maximum profit of 500. Setting the price equal to marginal cost, 100−2Q=20100 - 2Q = 20, gives Q=40Q = 40, where profit is −300-300: when the price falls as the firm sells more, marginal revenue is below the price, so price = MC is the wrong condition.

Example 3: MR = MC with a cubic cost

A firm sells every unit at a fixed price of 60. Its total cost is C(Q)=13Q3−5Q2+36Q+100C(Q) = \frac{1}{3}Q^3 - 5Q^2 + 36Q + 100. Find the profit-maximising output and the profit there.

  1. With a fixed price, MR=60\text{MR} = 60. Marginal cost: C′(Q)=Q2−10Q+36C'(Q) = Q^2 - 10Q + 36.

  2. Set them equal: Q2−10Q+36=60Q^2 - 10Q + 36 = 60, so Q2−10Q−24=0Q^2 - 10Q - 24 = 0, which factorises as (Q−12)(Q+2)=0(Q - 12)(Q + 2) = 0. Output cannot be negative, so Q=12Q = 12.

  3. Second-order check: π′′(Q)=−C′′(Q)=−(2Q−10)\pi''(Q) = -C''(Q) = -(2Q - 10), which is −14-14 at Q=12Q = 12. Negative, so profit is at a maximum.

  4. Profit: revenue 60×12=72060 \times 12 = 720; cost 17283−720+432+100=576−720+432+100=388\frac{1728}{3} - 720 + 432 + 100 = 576 - 720 + 432 + 100 = 388; profit 720−388=332720 - 388 = 332.

  5. Second route: π(Q)=60Q−C(Q)=−13Q3+5Q2+24Q−100\pi(Q) = 60Q - C(Q) = -\frac{1}{3}Q^3 + 5Q^2 + 24Q - 100, so π(12)=−576+720+288−100=332\pi(12) = -576 + 720 + 288 - 100 = 332.

Answer

Q=12Q = 12, with profit 332. Keeping Q=−2Q = -2 as a second answer is the slip to avoid: it solves the equation but means nothing as an output.

Example 4: Marginal products in a Cobb–Douglas function

Output is Q=10K0.5L0.5Q = 10K^{0.5}L^{0.5}, where KK is capital and LL is labour. Find ∂Q∂L\frac{\partial Q}{\partial L} and ∂Q∂K\frac{\partial Q}{\partial K} at K=16K = 16, L=4L = 4.

  1. Hold KK fixed and apply the power rule to LL: ∂Q∂L=10K0.5×0.5L−0.5=5KL\frac{\partial Q}{\partial L} = 10K^{0.5} \times 0.5L^{-0.5} = 5\sqrt{\frac{K}{L}}.

  2. At K=16K = 16, L=4L = 4: 54=105\sqrt{4} = 10.

  3. Second route: fix K=16K = 16 first, so Q=10×4×L0.5=40LQ = 10 \times 4 \times L^{0.5} = 40\sqrt{L}, an ordinary function of LL. Its derivative is 402L=20L\frac{40}{2\sqrt{L}} = \frac{20}{\sqrt{L}}, which is 1010 at L=4L = 4.

  4. In the same way, ∂Q∂K=5LK=5×12=2.5\frac{\partial Q}{\partial K} = 5\sqrt{\frac{L}{K}} = 5 \times \frac{1}{2} = 2.5. The gradient at this point, in the order (K,L)(K, L), is (2.5,10)(2.5, 10).

Answer

The marginal product of labour is 10 and that of capital is 2.5: one more unit of labour adds roughly 10 units of output. Since 0.5+0.5=10.5 + 0.5 = 1, the function has constant returns to scale. Substituting both K=16K = 16 and L=4L = 4 before differentiating is the tempting error: it turns QQ into the constant 80, whose derivative is 0. Fix only the variable you are not differentiating.

Common traps

  • Multiplying the derivatives of a product

    The derivative of uvuv is u′v+uv′u'v + uv', not u′v′u'v'. For x2exx^2 e^x the product of derivatives gives 2xex2xe^x, but the correct derivative is 2xex+x2ex2xe^x + x^2e^x. Differentiate one factor at a time and add the two terms.

  • Dropping the inside derivative

    The chain rule multiplies by the derivative of the inside: (e5x)′=5e5x(e^{5x})' = 5e^{5x}, not e5xe^{5x}. A quick check is to rewrite when you can: ln⁡(2x)=ln⁡2+ln⁡x\ln(2x) = \ln 2 + \ln x, so its derivative is 1x\frac{1}{x}, and the chain rule agrees, 22x=1x\frac{2}{2x} = \frac{1}{x}.

  • Treating every stationary point as a maximum

    f′(x)=0f'(x) = 0 holds at minima and some inflection points too, and MR=MC\text{MR} = \text{MC} can hold where profit is lowest. Always check the sign of the second derivative, or the sign of f′f' on either side, before calling a point a maximum.

  • Price = MC when the price is not fixed

    Marginal revenue equals the price only when the price does not depend on output. With a demand curve P=a−bQP = a - bQ, marginal revenue is a−2bQa - 2bQ, so set that, not the price, equal to marginal cost.

  • Setting the other variable to zero

    In a partial derivative the other variable is held constant, not set to zero: ∂∂x(x2y)=2xy\frac{\partial}{\partial x}(x^2 y) = 2xy, not 2x2x and not 0. Only terms with no xx at all, such as 3y23y^2, vanish when you differentiate with respect to xx.

Check yourself

Answer each question before you open its answer.

Question 1: Product and chain rules together

Quantitative reasoning: derivatives

If f(x)=x3e2xf(x) = x^3 e^{2x}, what is f′(1)f'(1)?

  1. A.2e22e^2
  2. B.4e24e^2
  3. C.5e25e^2
  4. D.6e26e^2
Show the answer

Answer: C. 5e25e^2

Working

Product rule with u=x3u = x^3 and v=e2xv = e^{2x}: u′=3x2u' = 3x^2 and, by the chain rule, v′=2e2xv' = 2e^{2x}. So f′(x)=3x2e2x+2x3e2x=x2e2x(3+2x)f'(x) = 3x^2 e^{2x} + 2x^3 e^{2x} = x^2 e^{2x}(3 + 2x), and f′(1)=e2×5=5e2f'(1) = e^2 \times 5 = 5e^2. Check by logarithms: ln⁡f=3ln⁡x+2x\ln f = 3\ln x + 2x, so f′f=3x+2\frac{f'}{f} = \frac{3}{x} + 2, which is 5 at x=1x = 1; with f(1)=e2f(1) = e^2, f′(1)=5e2f'(1) = 5e^2.

Why the other options are wrong

  • A. Keeps only x3×2e2xx^3 \times 2e^{2x}, the term from differentiating the exponential; the product rule also needs the term 3x2e2x3x^2 e^{2x}.
  • B. Treats e2xe^{2x} as its own derivative, dropping the chain-rule factor 2, and gets 3e2+e23e^2 + e^2.
  • D. Multiplies the two derivatives, 3x2×2e2x3x^2 \times 2e^{2x}; the derivative of a product is not the product of the derivatives.

What carries over

For a product, differentiate each factor in turn and add the two terms; inside an exponential, multiply by the derivative of the exponent.

Question 2: Which output maximises profit?

Quantitative reasoning: optimisation

A firm sells every unit at a fixed price of 30. Its total cost is C(Q)=Q3−15Q2+78Q+24C(Q) = Q^3 - 15Q^2 + 78Q + 24. Which output maximises profit?

  1. A.Q=2Q = 2
  2. B.Q=5Q = 5
  3. C.Q=8Q = 8
  4. D.Both Q=2Q = 2 and Q=8Q = 8
Show the answer

Answer: C. Q=8Q = 8

Working

With a fixed price, MR=30\text{MR} = 30. Marginal cost is C′(Q)=3Q2−30Q+78C'(Q) = 3Q^2 - 30Q + 78. Setting them equal: 3Q2−30Q+48=03Q^2 - 30Q + 48 = 0, so Q2−10Q+16=0Q^2 - 10Q + 16 = 0 and (Q−2)(Q−8)=0(Q - 2)(Q - 8) = 0. Second derivative of profit: π′′(Q)=−C′′(Q)=−(6Q−30)\pi''(Q) = -C''(Q) = -(6Q - 30), which is +18+18 at Q=2Q = 2 (a minimum) and −18-18 at Q=8Q = 8 (a maximum). Check with values: at Q=8Q = 8, revenue 240 and cost 512−960+624+24=200512 - 960 + 624 + 24 = 200, profit 40; at Q=2Q = 2, revenue 60 and cost 8−60+156+24=1288 - 60 + 156 + 24 = 128, profit −68-68; producing nothing gives −24-24.

Why the other options are wrong

  • A. Solves MR=MC\text{MR} = \text{MC} correctly but keeps the smaller root; there marginal cost is falling and π′′(2)=18>0\pi''(2) = 18 > 0, so profit is at a local minimum.
  • B. This is where marginal cost is lowest, 6Q−30=06Q - 30 = 0, not where marginal cost equals the price.
  • D. Treats every solution of MR=MC\text{MR} = \text{MC} as a maximum; the second-derivative test separates them, and profit is 40 at one and −68-68 at the other.

What carries over

MR = MC gives candidates; the second derivative of profit, or the sign of the slope of MC, picks the maximum.

Question 3: Gradient of a two-variable function

Quantitative reasoning: partial derivatives

What is the gradient of f(x,y)=3x2y+y2f(x, y) = 3x^2 y + y^2 at the point (1,2)(1, 2)?

  1. A.(6,7)(6, 7)
  2. B.(12,7)(12, 7)
  3. C.(12,4)(12, 4)
  4. D.(7,12)(7, 12)
Show the answer

Answer: B. (12,7)(12, 7)

Working

With yy held constant, ∂f∂x=6xy\frac{\partial f}{\partial x} = 6xy (the y2y^2 term gives 0), which is 6×1×2=126 \times 1 \times 2 = 12 at (1,2)(1, 2). With xx held constant, ∂f∂y=3x2+2y=3+4=7\frac{\partial f}{\partial y} = 3x^2 + 2y = 3 + 4 = 7. So the gradient is (12,7)(12, 7). Check by fixing one variable first: f(x,2)=6x2+4f(x, 2) = 6x^2 + 4 has derivative 12x=1212x = 12 at x=1x = 1, and f(1,y)=3y+y2f(1, y) = 3y + y^2 has derivative 3+2y=73 + 2y = 7 at y=2y = 2.

Why the other options are wrong

  • A. Differentiates 3x2y3x^2 y with respect to xx as 6x6x, dropping the factor yy; yy is held constant, not removed.
  • C. Treats 3x2y3x^2 y as a constant when differentiating with respect to yy; it contains yy, so its partial derivative is 3x23x^2.
  • D. Has the right partial derivatives in the wrong order; the gradient lists the derivative with respect to xx first.

What carries over

A partial derivative holds the other variable constant, and the gradient lists the partial derivatives in the order of the variables.

Key points

  • Power rule: xnx^n becomes nxn−1nx^{n-1}; for products, quotients and compositions use the product, quotient and chain rules, never the product of derivatives.

  • At a smooth interior maximum or minimum f′(x)=0f'(x) = 0; at such a stationary point, f′′<0f'' < 0 means a local maximum and f′′>0f'' > 0 a local minimum.

  • A parabola ax2+bx+cax^2 + bx + c has its vertex at x=−b2ax = -\frac{b}{2a}: a maximum if a<0a < 0, a minimum if a>0a > 0.

  • Profit peaks where MR = MC and the second derivative of profit is negative; fixed costs do not move the best output.

  • A partial derivative holds the other variables constant; the gradient lists the partial derivatives as a vector.

All questions here are original and written for UniExamer; none comes from the test maker.

Written by the UniExamer team with AI assistance. Every worked example and check question was re-solved by an independent checker before publication. No subject expert has reviewed this lesson yet. If you find a mistake, write to support@uniexamer.com.

Poćwicz ten temat

Nowe pytania z tej umiejętności, z rozwiązaniami. Ćwiczenia wymagają Single Exam Pass lub Plus.