Skip to main content

Differentiation — Diagnostic Tests

Unit Tests

Tests edge cases, boundary conditions, and common misconceptions for differentiation.

UT-1: Implicit Differentiation — Second Derivative Trap

Question:

A curve is defined implicitly by x2+xy+y2=7x^2 + xy + y^2 = 7.

(a) Find dydx\dfrac{dy}{dx} in terms of xx and yy.

(b) Find d2ydx2\dfrac{d^2y}{dx^2} in terms of xx and yy.

(c) A student computes d2ydx2\dfrac{d^2y}{dx^2} by implicitly differentiating the original equation twice and gets a different answer from part (b). Explain why the student's answer could be correct but in a different form, and show they are equivalent.

[Difficulty: hard. Tests second derivative via implicit differentiation and the subtlety of substituting dydx\frac{dy}{dx} back.]

Solution:

(a) Differentiate implicitly with respect to xx:

2x+y+xdydx+2ydydx=02x + y + x\frac{dy}{dx} + 2y\frac{dy}{dx} = 0

(x+2y)dydx=(2x+y)(x + 2y)\frac{dy}{dx} = -(2x + y)

dydx=2x+yx+2y\frac{dy}{dx} = -\frac{2x + y}{x + 2y}

(b) Differentiate dydx\dfrac{dy}{dx} with respect to xx using the quotient rule:

d2ydx2=(x+2y)(2+dydx)(2x+y)(1+2dydx)(x+2y)2\frac{d^2y}{dx^2} = -\frac{(x + 2y)\left(2 + \frac{dy}{dx}\right) - (2x + y)\left(1 + 2\frac{dy}{dx}\right)}{(x + 2y)^2}

Expand the numerator:

=(x+2y)(2+dydx)(2x+y)(1+2dydx)(x+2y)2= -\frac{(x + 2y)(2 + \frac{dy}{dx}) - (2x + y)(1 + 2\frac{dy}{dx})}{(x + 2y)^2}

Substitute dydx=2x+yx+2y\frac{dy}{dx} = -\frac{2x + y}{x + 2y}:

=(x+2y)(22x+yx+2y)(2x+y)(12(2x+y)x+2y)(x+2y)2= -\frac{(x + 2y)\left(2 - \frac{2x + y}{x + 2y}\right) - (2x + y)\left(1 - \frac{2(2x + y)}{x + 2y}\right)}{(x + 2y)^2}

=(x+2y)2(x+2y)(2x+y)x+2y(2x+y)(x+2y)2(2x+y)x+2y(x+2y)2= -\frac{(x + 2y) \cdot \frac{2(x + 2y) - (2x + y)}{x + 2y} - (2x + y) \cdot \frac{(x + 2y) - 2(2x + y)}{x + 2y}}{(x + 2y)^2}

Numerator of the inner fractions:

2(x+2y)(2x+y)=2x+4y2xy=3y2(x + 2y) - (2x + y) = 2x + 4y - 2x - y = 3y

(x+2y)2(2x+y)=x+2y4x2y=3x(x + 2y) - 2(2x + y) = x + 2y - 4x - 2y = -3x

So:

d2ydx2=3y(2x+y)(3xx+2y)(x+2y)2=3y+3x(2x+y)x+2y(x+2y)2\frac{d^2y}{dx^2} = -\frac{3y - (2x + y)\left(\frac{-3x}{x + 2y}\right)}{(x + 2y)^2} = -\frac{3y + \frac{3x(2x + y)}{x + 2y}}{(x + 2y)^2}

=3y(x+2y)+3x(2x+y)(x+2y)3=3xy+6y2+6x2+3xy(x+2y)3= -\frac{3y(x + 2y) + 3x(2x + y)}{(x + 2y)^3} = -\frac{3xy + 6y^2 + 6x^2 + 3xy}{(x + 2y)^3}

=6x2+6xy+6y2(x+2y)3=6(x2+xy+y2)(x+2y)3=42(x+2y)3= -\frac{6x^2 + 6xy + 6y^2}{(x + 2y)^3} = -\frac{6(x^2 + xy + y^2)}{(x + 2y)^3} = -\frac{42}{(x + 2y)^3}

(c) The student's approach of differentiating the original equation twice is valid. Starting from:

2x+y+xdydx+2ydydx=02x + y + x\frac{dy}{dx} + 2y\frac{dy}{dx} = 0

Differentiate again:

2+dydx+dydx+xd2ydx2+2(dydx)2+2yd2ydx2=02 + \frac{dy}{dx} + \frac{dy}{dx} + x\frac{d^2y}{dx^2} + 2\left(\frac{dy}{dx}\right)^2 + 2y\frac{d^2y}{dx^2} = 0

2+2dydx+2(dydx)2+(x+2y)d2ydx2=02 + 2\frac{dy}{dx} + 2\left(\frac{dy}{dx}\right)^2 + (x + 2y)\frac{d^2y}{dx^2} = 0

Solving for d2ydx2\frac{d^2y}{dx^2}:

d2ydx2=2+2dydx+2(dydx)2x+2y\frac{d^2y}{dx^2} = -\frac{2 + 2\frac{dy}{dx} + 2\left(\frac{dy}{dx}\right)^2}{x + 2y}

This is equivalent to the result in (b) after substituting dydx=2x+yx+2y\frac{dy}{dx} = -\frac{2x + y}{x + 2y} and simplifying. Both forms are correct; they just express the answer differently.


UT-2: L'Hopital's Rule — When It Does Not Apply

Question:

(a) Evaluate limx0ex1xx22x3\displaystyle\lim_{x \to 0}\frac{e^x - 1 - x - \frac{x^2}{2}}{x^3}.

(b) A student claims L'Hopital's rule applies to limxx+sinxx\displaystyle\lim_{x \to \infty}\frac{x + \sin x}{x}. Apply L'Hopital's rule and explain why the result is misleading.

[Difficulty: hard. Tests repeated L'Hopital application and recognition of when L'Hopital gives an indeterminate loop.]

Solution:

(a) Direct substitution gives 00\frac{0}{0}.

First application:

limx0ex1x3x2\lim_{x \to 0}\frac{e^x - 1 - x}{3x^2}

Still 00\frac{0}{0}:

limx0ex16x\lim_{x \to 0}\frac{e^x - 1}{6x}

Still 00\frac{0}{0}:

limx0ex6=16\lim_{x \to 0}\frac{e^x}{6} = \frac{1}{6}

(b) Direct substitution of xx \to \infty gives \frac{\infty}{\infty}, so L'Hopital technically applies.

limx1+cosx1=limx(1+cosx)\lim_{x \to \infty}\frac{1 + \cos x}{1} = \lim_{x \to \infty}(1 + \cos x)

This limit does not exist because cosx\cos x oscillates between 1-1 and 11. The result is misleading because the original limit does exist:

x+sinxx=1+sinxx\frac{x + \sin x}{x} = 1 + \frac{\sin x}{x}

Since sinx1\lvert \sin x \rvert \le 1 and xx \to \infty, we have sinxx0\frac{\sin x}{x} \to 0 by the squeeze theorem.

So limxx+sinxx=1\displaystyle\lim_{x \to \infty}\frac{x + \sin x}{x} = 1.

L'Hopital's rule fails here because the condition "the limit of f(x)g(x)\frac{f'(x)}{g'(x)} must exist (or be ±\pm\infty)" is not satisfied. This is a case where L'Hopital gives an inconclusive result, not because the original limit is indeterminate.


UT-3: Product Rule — Order of Operations

Question:

Let f(x)=x2e3xsinxf(x) = x^2 e^{3x} \sin x.

(a) Find f(x)f'(x).

(b) A student writes f(x)=2x3e3xcosxf'(x) = 2x \cdot 3e^{3x} \cdot \cos x and claims they applied the product rule correctly to all three functions. Explain the error.

[Difficulty: hard. Tests correct application of the product rule to a product of three functions.]

Solution:

(a) Treat f(x)=uvwf(x) = u \cdot v \cdot w where u=x2u = x^2, v=e3xv = e^{3x}, w=sinxw = \sin x.

Using the product rule for three functions:

(uvw)=uvw+uvw+uvw(uvw)' = u'vw + uv'w + uvw'

u=2x,v=3e3x,w=cosxu' = 2x, \quad v' = 3e^{3x}, \quad w' = \cos x

f(x)=2xe3xsinx+x23e3xsinx+x2e3xcosxf'(x) = 2x \cdot e^{3x} \cdot \sin x + x^2 \cdot 3e^{3x} \cdot \sin x + x^2 \cdot e^{3x} \cdot \cos x

=e3xsinx(2x+3x2)+x2e3xcosx= e^{3x}\sin x(2x + 3x^2) + x^2 e^{3x}\cos x

=e3x[(2x+3x2)sinx+x2cosx]= e^{3x}\left[(2x + 3x^2)\sin x + x^2\cos x\right]

(b) The student's error is that they differentiated each factor independently and multiplied the results: f(x)uvwf'(x) \neq u' \cdot v' \cdot w'. The derivative of a product is not the product of the derivatives. The correct rule is (uvw)=uvw+uvw+uvw(uvw)' = u'vw + uv'w + uvw' — each term differentiates exactly one factor while keeping the others unchanged.


Integration Tests

Tests synthesis of differentiation with other topics.

IT-1: Differentiation with Logarithms (with Algebra)

Question:

Let f(x)=xxf(x) = x^{x} for x>0x \gt 0.

(a) Find f(x)f'(x) using logarithmic differentiation.

(b) Find the xx-coordinate of the stationary point of ff and determine its nature.

(c) Show that the stationary point is a local minimum by considering f(x)=exlnxf(x) = e^{x\ln x}.

[Difficulty: hard. Combines logarithmic differentiation with logarithm laws and the chain rule.]

Solution:

(a) Let y=xxy = x^x. Take natural logarithms:

lny=xlnx\ln y = x \ln x

Differentiate implicitly with respect to xx:

1ydydx=lnx+x1x=lnx+1\frac{1}{y}\frac{dy}{dx} = \ln x + x \cdot \frac{1}{x} = \ln x + 1

dydx=y(lnx+1)=xx(1+lnx)\frac{dy}{dx} = y(\ln x + 1) = x^x(1 + \ln x)

(b) Stationary points: f(x)=0    xx(1+lnx)=0f'(x) = 0 \implies x^x(1 + \ln x) = 0.

Since xx>0x^x \gt 0 for all x>0x \gt 0, we need 1+lnx=0    lnx=1    x=e1=1e1 + \ln x = 0 \implies \ln x = -1 \implies x = e^{-1} = \frac{1}{e}.

To determine the nature: for 0<x<1e0 \lt x \lt \frac{1}{e}, lnx<1\ln x \lt -1 so 1+lnx<01 + \ln x \lt 0 (decreasing). For x>1ex \gt \frac{1}{e}, 1+lnx>01 + \ln x \gt 0 (increasing).

So x=1ex = \frac{1}{e} is a local minimum.

(c) f(x)=exlnxf(x) = e^{x\ln x}. Then:

f(x)=exlnx(lnx+1)=xx(1+lnx)f'(x) = e^{x\ln x} \cdot (\ln x + 1) = x^x(1 + \ln x)

For the second derivative:

f(x)=ddx ⁣[xx(1+lnx)]f''(x) = \frac{d}{dx}\!\left[x^x(1 + \ln x)\right]

=xx(1+lnx)2+xx1x=xx ⁣[(1+lnx)2+1x]= x^x(1 + \ln x)^2 + x^x \cdot \frac{1}{x} = x^x\!\left[(1 + \ln x)^2 + \frac{1}{x}\right]

At x=1ex = \frac{1}{e}:

f ⁣(1e)=(1e)1/e ⁣[0+e]=ee1/e=e11/e>0f''\!\left(\frac{1}{e}\right) = \left(\frac{1}{e}\right)^{1/e}\!\left[0 + e\right] = e \cdot e^{-1/e} = e^{1 - 1/e} \gt 0

Since f ⁣(1e)>0f''\!\left(\frac{1}{e}\right) \gt 0, the stationary point is confirmed as a local minimum by the second derivative test.