Calculus · real student question

For the expression a*x + b, find the partial derivative with respect to a and the partial derivative with respect to b.

Question

For the expression

f(a,b)=ax+bf(a,b)=ax+b

find fa\dfrac{\partial f}{\partial a} and fb\dfrac{\partial f}{\partial b}.

Step-by-step solution

  1. Decide which symbols are frozen. A partial derivative differentiates with respect to one variable while treating every other symbol as a constant. Here the expression contains three symbols, aa, bb and xx, so which one is "the variable" changes from part to part — and xx is a constant in both parts of this question.

  2. Differentiate with respect to aa. Treating xx and bb as constants, the term axax is a constant multiple of aa and bb is a pure constant:

    a(ax)=x,a(b)=0,\frac{\partial}{\partial a}(ax)=x,\qquad \frac{\partial}{\partial a}(b)=0,

    fa=x.\frac{\partial f}{\partial a}=x.

    The answer is xx, not 11 and not axax: differentiating axax with respect to aa leaves the coefficient of aa, which is xx.

  3. Differentiate with respect to bb. Now aa and xx are frozen, so the entire product axax is a constant:

    b(ax)=0,b(b)=1,\frac{\partial}{\partial b}(ax)=0,\qquad \frac{\partial}{\partial b}(b)=1,

    fb=1.\frac{\partial f}{\partial b}=1.

  4. Contrast with the derivative in xx. For completeness, fx=a\frac{\partial f}{\partial x}=a — the same expression yields three different answers depending on which symbol is the variable. Comparing all three is the fastest way to internalise what "hold the others constant" actually does.

  5. Interpret the result. In a straight-line model y=ax+by=ax+b fitted to data, these two partials are precisely the components of the gradient used by least squares: changing the slope aa by a small amount moves the prediction by xx times that amount, while changing the intercept bb moves every prediction by the same amount, 11 for 11. That is why data points far from the origin dominate the estimate of the slope.

Answer

a(ax+b)=x,b(ax+b)=1(and x(ax+b)=a)\frac{\partial}{\partial a}(ax+b)=x,\qquad \frac{\partial}{\partial b}(ax+b)=1\qquad\left(\text{and }\frac{\partial}{\partial x}(ax+b)=a\right)

Need to solve a different problem like this? Open the solver →