Thursday, October 29, 2009

Piecewise Function, y = |x^2-9| Plot & Find Derivative

Problem:
Find the derivative of y =|x^2-9|. Plot the function and the derivative.

Solution:
Lets say you had the graph of just x^2-9 (without the absolute value, represented by the orange line in the graph below) that would look like the graph of x^2 shifted down 9 units.

But, there is an absolute value sign so the part of the graph that goes below zero becomes positive. That’s why you have that blue bubble in the middle of the graph. This bubble is just a reflection of the orange line about the x axis. So the blue hump in the middle of the graph is y = -x^2 + 9. In order to reflect a function about the x axis just multiply the right hand side of the equation by -1.

If you redefine the function in |x^2-9| in a piece wise fashion, you can find the derivative on each part.
y = { x^2 - 9 when x <= -3
9-x^2 when -3< x < -3 (the reflection)
x^2 -9 when x >= 3

y' = {2x when x <=-3
-2x when -3>x<3
2x when x >= 3

Now every where you have a negative slope the value of the derivative is negative and everywhere you have a positive slope the value of the derivative is positive.

Notice that where the red line goes vertical you actually have jump discontinuity. So at x = -3 and x = 3 the left and right hand limits of the function are not equal and therefore the derivative of the function does not exist at these points.


if you'd like to experiment with the excel file I made for this problem here is a link PiecewiseProblem_1.xls

No comments:

Post a Comment