Math concepts

Partial Derivatives: Practice Problems with Worked Solutions

November 10, 2026Ivan Terekhin8 min read
Partial Derivatives: Practice Problems with Worked Solutions

Find both partial derivatives of f(x,y)=x2y+3y2f(x,y)=x^2y+3y^2. If your answers are 2x2x and 6y6y, you have thrown away a coefficient and an entire term. Holding a variable constant means treating it like a number, not deleting everything containing it. The correct pair is fx=2xyf_x=2xy and fy=x2+6yf_y=x^2+6y.

This practice set starts with that mistake and builds toward products, nested functions, mixed partials and numerical checks. Try each problem before reading its solution. Write the variable you are holding fixed beside your first line; that small annotation makes many wrong answers easier to spot.

For the picture behind the calculation, use the intuitive partial-derivatives guide. Here the emphasis is on doing the algebra and checking the result, rather than introducing surfaces and gradients again.

The rule to write above your working

For fxf_x, differentiate with respect to xx while treating yy as a constant. For fyf_y, reverse those roles. The OpenStax definition of partial derivatives makes the fixed input explicit in the difference quotient. Ordinary differentiation rules then apply to the variable that is changing.

For example, when yy is fixed, y2y^2 is a constant, but xy2xy^2 is a constant multiplied by xx. Their derivatives with respect to xx are therefore different:

∂∂x(y2)=0,∂∂x(xy2)=y2.\frac{\partial}{\partial x}(y^2)=0, \qquad \frac{\partial}{\partial x}(xy^2)=y^2.

Do not substitute both coordinates before differentiating. Substituting a whole point turns the expression into a number and loses the nearby variation you need. Differentiate first, then evaluate. Substituting only the fixed coordinate is fine and gives a useful independent check.

Problem 1: a polynomial with two independent inputs

Find fxf_x and fyf_y for

f(x,y)=2x3y−5xy2+7y,f(x,y)=2x^3y-5xy^2+7y,

then evaluate both at (1,2)(1,2).

With respect to x: hold yy still. The coefficients of x3x^3 and xx are 2y2y and −5y2-5y^2. The final term does not change:

fx=6x2y−5y2.f_x=6x^2y-5y^2.

With respect to y: hold xx still. The first term is linear in yy, the second is quadratic, and the third is linear:

fy=2x3−10xy+7.f_y=2x^3-10xy+7.

At the requested point,

fx(1,2)=12−20=−8,fy(1,2)=2−20+7=−11.f_x(1,2)=12-20=-8, \qquad f_y(1,2)=2-20+7=-11.

Both derivatives are negative there. Their signs alone do not tell you the function value: height and slope are different quantities. To check the first answer independently, set y=2y=2 in the original function. You get 4x3−20x+144x^3-20x+14, whose ordinary derivative is 12x2−2012x^2-20. At x=1x=1 it is again −8-8.

Problem 2: a product and an exponential

Find both partial derivatives of

g(x,y)=x2exy.g(x,y)=x^2e^{xy}.

For gxg_x, both factors depend on xx, so apply the product rule. The exponential also needs the chain rule: with yy fixed, the derivative of xyxy is yy.

gx=2xexy+x2exyy=exy(2x+x2y).g_x=2xe^{xy}+x^2e^{xy}y =e^{xy}(2x+x^2y).

For gyg_y, the factor x2x^2 is constant. Only the exponential changes, and the derivative of its exponent with respect to yy is xx:

gy=x2exyx=x3exy.g_y=x^2e^{xy}x=x^3e^{xy}.

At (1,0)(1,0), these become gx=2g_x=2 and gy=1g_y=1. A common wrong answer is gx=2xexyg_x=2xe^{xy}. It differentiates the first factor and forgets that the second factor also depends on xx. Another wrong answer replaces the inner derivative by 1 in both calculations, losing the distinction between xx and yy.

If you need more practice identifying an inner function, the chain-rule examples separate each layer before recombining the factors.

Problem 3: logarithms, fractions and the domain

Let

h(x,y)=ln⁡(x2+2y2).h(x,y)=\ln(x^2+2y^2).

The logarithm requires x2+2y2>0x^2+2y^2>0, so the origin is excluded. Everywhere else, differentiate the inside and divide by the inside:

hx=2xx2+2y2,hy=4yx2+2y2.h_x=\frac{2x}{x^2+2y^2}, \qquad h_y=\frac{4y}{x^2+2y^2}.

At (2,1)(2,1) the denominator is 6, so both derivatives equal 2/32/3. That equality is specific to this point. It does not mean the two derivative functions are identical.

The denominator is a useful warning. Neither the original function nor these formulas has a value at (0,0)(0,0). A calculation that returns zero there has substituted into an undefined fraction. Check the domain before evaluating, especially when an exercise combines roots, logarithms and quotients.

Problem 4: mixed partials in both orders

Take

p(x,y)=x2y3+sin⁡(xy).p(x,y)=x^2y^3+\sin(xy).

In this guide, pxyp_{xy} means differentiate first with respect to xx, then with respect to yy. Write the intermediate derivative to make the order unambiguous:

px=2xy3+ycos⁡(xy).p_x=2xy^3+y\cos(xy).

Now differentiate that expression with respect to yy. The second term needs a product rule:

pxy=6xy2+cos⁡(xy)−xysin⁡(xy).p_{xy}=6xy^2+\cos(xy)-xy\sin(xy).

Reverse the calculation:

py=3x2y2+xcos⁡(xy),p_y=3x^2y^2+x\cos(xy), pyx=6xy2+cos⁡(xy)−xysin⁡(xy).p_{yx}=6xy^2+\cos(xy)-xy\sin(xy).

The answers agree. Here all the relevant derivatives are continuous, so the equality is also expected from the mixed-partial theorem described in OpenStax. Do not treat agreement as an unconditional rule for every imaginable function. In an ordinary smooth exercise it is an excellent check; at a point where regularity fails, the theorem's assumptions matter.

Problem 5: a third variable is another fixed input

For

q(x,y,z)=xy2+zcos⁡x,q(x,y,z)=xy^2+z\cos x,

find all three first partial derivatives. Keeping two inputs fixed gives

qx=y2−zsin⁡x,qy=2xy,qz=cos⁡x.q_x=y^2-z\sin x, \qquad q_y=2xy, \qquad q_z=\cos x.

At (0,2,3)(0,2,3) the values are 4, 0 and 1. The zero in the middle is not a statement that the function never depends on yy. It says the first-order rate in that direction is zero at this particular point. Substituting x=0x=0 into the original expression confirms that the slice is simply q=3q=3 when z=3z=3.

A numerical check that catches a missing factor

Return to Problem 1 at (1,2)(1,2). Keep y=2y=2, take a small positive number ss, and calculate the centred difference

f(1+s,2)−f(1−s,2)2s.\frac{f(1+s,2)-f(1-s,2)}{2s}.

For this polynomial, expanding the numerator gives exactly −8+4s2-8+4s^2. The resulting checks are:

Step sNumerical slopeExact partial derivative
0.1-7.96-8
0.01-7.9996-8
0.001-7.999996-8

This is a check on a symbolic answer, not a proof of a derivative formula. It also checks only the chosen point. If you accidentally change both coordinates in the numerator, you are measuring change along a different path. With floating-point arithmetic, an extremely tiny step can introduce cancellation error, so do not assume that more zeroes always improve the test.

Diagnose the wrong answer before starting over

Your resultLikely missed stepOne useful check
A coefficient containing y vanished from f_xA fixed variable was treated as zeroReplace y by 2 and differentiate the slice
Only one term appears in g_xProduct rule omittedMark both x-dependent factors
h_y has 2y in its numeratorInner derivative of 2y² lost a factorDifferentiate that expression on its own
Mixed partials disagree for the smooth p aboveProduct or chain rule missed on the second passKeep the intermediate first derivative visible
Every evaluated derivative is zeroBoth coordinates were substituted too earlyDifferentiate the function before inserting the point

Use the table to correct the specific step rather than rewriting all the algebra. If ordinary derivative rules still cause mistakes, the derivatives introduction is the prerequisite to revisit.

Try two more, then compare your working

Exercise A. Find rxr_x and ryr_y for r(x,y)=3x2y+y4r(x,y)=3x^2y+y^4 and evaluate at (2,−1)(2,-1).

The derivatives are rx=6xyr_x=6xy and ry=3x2+4y3r_y=3x^2+4y^3. At the point, they are −12-12 and 88. The term y4y^4 disappears only from the x-derivative. In the y-derivative, it contributes 4y3=−44y^3=-4.

Exercise B. Find both first partials of s(x,y)=cos⁡(2x−y)s(x,y)=\cos(2x-y) and evaluate at (0,0)(0,0).

The chain rule gives sx=−2sin⁡(2x−y)s_x=-2\sin(2x-y) and sy=sin⁡(2x−y)s_y=\sin(2x-y). The positive sign in the second answer comes from two negatives: differentiating cosine gives one, and differentiating 2x−y2x-y with respect to yy gives another. Both values at the origin are zero, even though their formulas differ.

Once these calculations are comfortable, continue with partial-derivative practice. Keep a short record of the error type you corrected: fixed input, product rule, inner derivative, or premature substitution. That record tells you which kind of problem to repeat next.

Edited by Ivan Terekhin, drafted with AI tools.

Put This Into Practice