Multivariable calculus
Partial Derivatives of x^2 y e^x
For f(x,y) = x^2 y e^x, the partial with respect to x is x y (x + 2) e^x, and the partial with respect to y is x^2 e^x. Differentiating in x needs the product rule on x^2 times e^x with y held fixed. Differentiating in y does not, because f is linear in y.
Only one of the two partials needs the product rule
Before you reach for a rule, ask which variable is moving. To find , freeze . What is left is the constant multiplying , and that is a genuine product of two functions of , so the product rule applies.
Both terms share , so factor it out. Factoring is worth the extra line: the factored form is what you need later when you set the gradient to zero.
Now freeze instead. With constant, is one fixed number and is that number times , a straight line in . The derivative of a constant times is the constant, so no product rule is involved at all.
The mistake: differentiating every factor at once
The usual error is to see three factors, , , and , and try to apply a three-way product rule in . That produces a stray term where has been differentiated to 1, and the answer picks up an extra that does not belong.
Hold the line on this: a partial derivative in treats exactly like the number 7. You would never differentiate the 7 in , and gets the same treatment.
- In , the product rule pairs with only. The rides along as a constant multiplier.
- In , there is no product of two -dependent factors, so the product rule has nothing to act on.
- A quick sanity check: must not contain , because is degree one in .
Check the answer at a point
Evaluating at gives numbers you can hold in your head. From the factored form, , and .
The ratio 3 to 1 says the surface climbs three times as fast in the direction as in the direction at that point, which matches the fact that appears both as a power and inside the exponential while appears only once.
Frequently asked questions
Why does the x-partial need the product rule but the y-partial does not?
Because the product rule only fires when two factors both depend on the variable you are differentiating. In , both and depend on . In , only the single factor depends on , and is a frozen constant, so the derivative is that constant.
Where is the x-partial equal to zero?
Set . Since is never zero, the zeros are , , and . Combining that with , which forces , the critical points are the whole line .