M HYPE SPLASH
// updates

why the derivative of a quadratic function in a linear function?

By Emily Wilson
$\begingroup$

in a quadratic function, the gradient follows a linear function, as shown by the first derivative. But I cannot accept this, because the rate of change of the gradient seems to be larger when the quadratic function reaches the point where the negative gradient becomes zero and then positive, any idea?

$\endgroup$

2 Answers

$\begingroup$

I suggest retuning your intuition - the gradient is changing sign, but that doesn't necessarily mean it is changing quickly.

It is important to understand the turning point of a quadratic, because the behaviour of functions at turning points (e.g. optimisation problems) is very often approximately quadratic.

$\endgroup$ $\begingroup$

Think about it this way, the first derivative of the function is the slope of the function. As you noted, the rate of change of the function (which is the function's 1st derivative) changes. Perhaps a little bit of finite-difference approximation will help your intuition:

LET: $$y(x)=ax^2+bx+c \rightarrow y'=2ax+b$$ Also, the first central difference (approximate 1st derivative) is as follows: $$y_{diff} \approx \frac{y(x+h)-y(x-h)}{(x+h)-(x-h)} = \frac{\Delta y}{\Delta x}$$ Let's use this to get an approximate 1st derivative: $$y_{diff}=\frac{a(x+h)^2+b(x+h)+c-a(x-h)^2-b(x-h)-c}{2h}$$ $$=\frac{ax^2+2ahx+ah^2+bx+bh+c-ax^2+2ahx-ah^2-bx+bh-c}{2h}$$ $$=\frac{4ahx+2bh}{2h}$$ $$=\frac{4ax+2b}{2}$$ $$=2ax+b$$ Notice how this is exactly the expression we get using analytical derivatives! :)

The second central difference (approximate 2nd derivative) is as follows: $$y_{2diff} \approx \frac{y_{diff}(x+h)-y_{diff}(x-h)}{(x+h)-(x-h)} = \frac{\Delta \frac{\Delta y}{\Delta x}}{\Delta x}$$ Expand the second central difference: $$y_{2diff}=\frac{\frac{y(x+2h)-y(x)}{2h}-\frac{y(x)-y(x-2h)}{2h}}{2h}=\frac{y(x+2h)-2y(x)+y(x-2h)}{4h^2}$$ Let's use this to estimate the second derivative, since we are taking the approximate 1st derivative of the approximate 1st derivative (rate of change of the slope). $$y_{2diff}=\frac{a(x+2h)^2+b(x+2h)+c-2ax^-2bx-2c+a(x-2h)^2+b(x-2h)+c}{4h^2}$$ $$=\frac{ax^2+4ahx+4ah^2+bx+2bh+c-2ax^2-2bx-2c+ax^2-4ahx+4h^2+bx-2bh+c}{4h^2}$$ $$=\frac{8ah^2}{4h^2}$$ $$=2a$$ Notice how this is exactly the expression we should get from an analytical 2nd derivative. Feel free to play with arbitrary values for $x$ and $h$. smaller values of $h$ will make this more accurate.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy