Shared11 - Function Analysis Part 2 Assignment / Function Analysis Part 2 Notes.sagewsOpen in CoCalc
This material was developed by Aaron Tresham at the University of Hawaii at Hilo and is

### Prerequisites:

• Intro to Sage
• Graphing and Solving Equations
• Differentiation
• Function Analysis, Part 1

# Function Analysis, Part 2

We continue to try to understand the key features of a function using calculus, rather than depending on a graph alone. In part 1, we only had functions with domain . In this lab, we'll consider functions where the function (or its derivative) has domain restrictions.

## Example 1

Analyze and graph .

Step 1 Find the domain. Discuss vertical asymptotes and holes.

For a rational function, the domain is all real numbers such that the denominator is not . So let's find out when the denominator is .

solve(x^4 + 9*x^3 + 18*x^2 - 32*x - 96==0,x)

[x == -3, x == 2, x == -4]

The denominator is when , , or . So the domain is all real numbers except , , and , in other words, .

We need to determine what happens near these holes in the domain, so we will take limits.

f(x)=(x^3 - x^2 - 14*x + 24)/(x^4 + 9*x^3 + 18*x^2 - 32*x - 96)
limit(f(x),x=-4)
limit(f(x),x=-3)
limit(f(x),x=2)

Infinity Infinity -1/30

Based on these limits, we know that has vertical asymptotes at and , and has a hole at the point .

Step 2 Find the derivative.

df(x)=derivative(f,x);show(df(x))


Step 3 Find the critical points of .

We need to know where the derivative is or undefined. Notice that the derivative has the same denominator as , so it has the same gaps in the domain (, , and ).

Now let's find where the derivative is .

solve(df(x)==0,x)

[x == -sqrt(42) + 3, x == sqrt(42) + 3]
N(-sqrt(42) + 3)
N(sqrt(42) + 3)

-3.48074069840786 9.48074069840786

So is at and .

Step 4 See if the sign of actually changes at the critical points of , and determine whether has a local maximum or local minimum at these points.

First, we'll check x-values near .

df(-3.5)
df(-3.4)

-4.00000000000000 18.0555555555558

Since changes sign from negative to positive, has a local min at .

Now check x-values near .

df(9)
df(10)

1/4056 -1/4732

Since changes sign from positive to negative, has a local max at .

Step 5 Find .

d2f(x)=derivative(f,x,2);show(d2f(x))


Step 6 Find the critical points of .

Once again, is undefined at the same x-values as and (, , and ).

Now we'll find where is .

solve(d2f(x)==0,x)

[x == 1/294*294^(2/3)*(21*I*sqrt(3) - 21) - 1/2*294^(1/3)*(I*sqrt(3) + 1) + 3, x == 1/294*294^(2/3)*(-21*I*sqrt(3) - 21) - 1/2*294^(1/3)*(-I*sqrt(3) + 1) + 3, x == 1/7*294^(2/3) + 294^(1/3) + 3]
N(1/294*294^(2/3)*(21*I*sqrt(3) - 21) - 1/2*294^(1/3)*(I*sqrt(3) + 1) + 3)
N(1/294*294^(2/3)*(-21*I*sqrt(3) - 21) - 1/2*294^(1/3)*(-I*sqrt(3) + 1) + 3)
N(1/7*294^(2/3) + 294^(1/3) + 3)

-3.48287967940368 - 0.288421242066844*I -3.48287967940368 + 0.288421242066844*I 15.9657593588074

We have one real solution, so is at .

Step 7 See if the sign of actually changes at the critical points of , and determine whether has an inflection point at these points.

Check the sign of near .

d2f(15)
d2f(16)

-55/3333474 13/27436000

Since changes sign from negative to postive, changes from concave down to concave up at , so has an inflection point here.

Step 8 Find the x- and y-intercepts.

solve(f(x)==0,x)  #find x-intercepts

[x == 3]
f(0)  #find y-intercept

-1/4

Step 9 Determine the end behavior.

limit(f(x),x=-Infinity);limit(f(x),x=+Infinity)

0 0

So the x-axis is a horizontal asymptote for this function.

Step 10 Make an informed graph. Mark any - and -intercepts, relative maxima and minima, and inflection points.

First, we'll calculate the function values at the critical points.

f(-3.48074069840786);f(9.48074069840786);f(15.9657593588074)

25.9614813968190 0.0385186031842795 0.0342406411926452

So, we'll need a graph that covers these three points. We also need to remember the hole, vertical asymptotes, and intercepts.

Here is a first attempt:

f(x)=(x^3 - x^2 - 14*x + 24)/(x^4 + 9*x^3 + 18*x^2 - 32*x - 96)
plot(f,xmin=-5,xmax=20,ymin=-10,ymax=30)


So this picture is not very clear. We need to make xmin smaller so we can see more of the branch on the left. It would also be nice to extend the range on the y-axis. The vertical asymptotes at and are marked with solid lines, but it would be nice to make them dashed instead. We also should mark the hole at .

We can see the local minimum at , but the local maximum at is not clear from the graph. We also can't see the inflection point at . The x-intercept at is also not obvious.

If we want to see all these features, we'll need a really big picture (which won't fit on our screen).

So we will have to produce a second graph that reveals the local max, inflection point, and x-intercept.

Here's another graph of the overall picture, and then we'll do a second plot that zooms in on the positive x-axis.

plot(f,xmin=-15,xmax=20,ymin=-20,ymax=40,detect_poles=True,figsize=5)+point((2,-1/30),size=15,faceted=True,color='white',markeredgecolor='blue')+line([(-4,-25),(-4,45)],linestyle='dashed')+line([(-3,-25),(-3,45)],linestyle='dashed')+point([(-3.48,25.96),(9.48,0.0385),(15.97,0.0342),(3,0)],color='black',size=20)


This is a good picture of the overall shape. Note: I do not expect you to add dashed lines for the asymptotes or open circles for the holes.

Here is a close up so we can see the local max and inflection point:

plot(f,xmin=0,xmax=40,ymin=-.05,ymax=.05)+point((2,-1/30),size=15,faceted=True,color='white',markeredgecolor='blue')+point([(9.48,0.0385),(15.97,0.0342),(3,0)],color='black',size=20)


This is another good example of why we bother analyzing the function with calculus. A single graph may not show all the important features of a function.

Step 11 Discuss absolute max/min, increasing/decreasing, concave up/down.

There is no absolute max or min.

The function is increasing on , , and .

The function is decreasing on , , and .

The function is concave up on and .

The function is concave down on , , and .

Comment: Notice where all the endpoints come from: critical points and domain restrictions (don't forget the hole at ).

## Example 2

Analyze and graph .

Step 1 Find the domain. Discuss vertical asymptotes and holes.

The domain of is .

There is a vertical asymptote or hole at . We'll use a limit to determine which it is.

f(x)=ln(x)/x
limit(f(x),x=0)

-Infinity

Since the limit is infinite, there is a vertical asymptote at .

Step 2 Find the derivative.

df(x)=derivative(f,x);show(df(x))


Step 3 Find the critical points of .

The derivative has the same domain as the original , so we just need to find where the derivative is 0.

solve(df(x)==0,x)

[e == x]

Our one critical point is .

Step 4 See if the sign of actually changes at the critical points of , and determine whether has a local maximum or local minimum at these points.

df(2.5);df(3.0)

0.0133934829001352 -0.0109569209631233

Since changes sign from positive to negative, has a local max at .

Step 5 Find .

d2f(x)=derivative(f,x,2);show(d2f(x))


Step 6 Find the critical points of .

has the same domain as and , so we need to find where is 0.

solve(d2f(x)==0,x)

[x == e^(3/2)]
N(e^(3/2))

4.48168907033806

We have at .

Step 7 See if the sign of actually changes at the critical points of , and determine whether has an inflection point at these points.

d2f(4.4);d2f(4.5)

-0.000431899396031749 0.0000894901898770770

Since changes sign, there is an inflection point at .

Step 8 Find the x- and y-intercepts.

solve(f(x)==0,x)  #find x-intercept

[x == 1]

There is no y-intercept, since 0 is not in the domain.

Step 9 Determine the end behavior.

limit(f(x),x=0,dir='right');limit(f(x),x=infinity)

-Infinity 0

We have a vertical asymptote at (y-axis) and a horizontal asymptote at (x-axis).

Step 10 Make an informed graph. Mark any - and -intercepts, relative maxima and minima, and inflection points.

Our graph needs to include and their corresponding y-values.

N(f(e));N(f(e^(3/2)))

0.367879441171442 0.334695240222645

Here is a first attempt. Notice that the inflection point and the horizontal asymptote are not clear.

plot(f,xmin=0,xmax=5,ymin=-.5,ymax=.5)


Here is a second attempt, with the important points marked.

plot(f,xmin=0,xmax=25,ymin=-.5,ymax=.5)+point([(1,0),(e,f(e)),(e^1.5,f(e^1.5))],color='black',size=20)


Step 11 Discuss absolute max/min, increasing/decreasing, concave up/down.

There is no absolute min. The absolute max is at .

The function is increasing on and decreasing on .

The function is concave up on and concave down on .

## Example 3

Analyze and graph

Step 1 Find the domain. Discuss vertical asymptotes and holes.

The only potential domain issue is dividing by 0, but since is never 0, the domain is .

Step 2 Find the derivative.

f(x)=(x^2-6*x+9)^(1/3)/(x^2+1)^(1/5)
df(x)=derivative(f,x)
show(df(x))


Step 3 Find the critical points of .

First, we'll think about where the derivative is undefined.

Looking back at the formula for , we see we get division by 0 when .

solve(x^2-6*x+9==0,x)

[x == 3]

So the derivative is undefined at , so this is a critical point.

Now we'll find where the derivative is 0.

solve(df(x)==0,x)

[x == -1/4*sqrt(41) - 9/4, x == 1/4*sqrt(41) - 9/4, x == 3]

Notice that Sage gives as a solution, even though we know does not exist. This is actually a mistake in Sage's solve command.

But the other two numbers are places where the derivative is 0, so they are critical points. Let's convert them to decimals.

N(-1/4*sqrt(41) - 9/4)
N(1/4*sqrt(41) - 9/4)

-3.85078105935821 -0.649218940641788

We have three critical points: , and .

Step 4 See if the sign of actually changes at the critical points, and determine whether has a local maximum or local mininum at these points.

df(2.9)
df(3.1)

-0.934289205592418 0.879868999227662

Since changes sign from negative to positive, has a local min at .

df(-3.9)
df(-3.8)

-0.000792013772198064 0.000843740680385702

Since changes sign from negative to positive, has a local min at .

df(-.7)
df(-.6)

0.0170948233809796 -0.0192489860586108

Since changes sign from postive to negative, has a local max at .

Step 5 Find .

d2f(x)=derivative(f,x,2)
show(d2f(x))


Step 6 Find the critical points of .

Looking at the formula for , we see the same problem with division by 0 that we saw for , so does not exist.

Now we need to find where .

solve(d2f(x)==0,x)

[x == -1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) - 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4, x == -1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4, x == 1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) - 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4, x == 1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4, x == 3]

Notice that Sage incorrectly gives us again.

Let's convert the four remaining solutions to decimals.

N(-1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) - 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4)

N(-1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4)

N(1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) - 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4)

N(1/132*sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 1/2*sqrt(-(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 137641/1089/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) - 40905/2/sqrt((4356*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(2/3) + 142593*(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3) + 550564)/(25/1331*I*sqrt(404272455)*sqrt(11) + 24113314/35937)^(1/3)) + 4321/66) - 9/4)

-10.5718681539223 + 5.47924906323833e-17*I -1.26168389059917 + 1.72972993360071e-16*I 0.680639364999719 - 4.18499764306598e-17*I 2.15291267952170 - 1.85915507561795e-16*I

Notice that all four of these solutions have "" in the answer. This is Sage's notation for , and it usually indicates a complex number (which we will ignore). However, as we can see from the decimal approximation, the imaginary part of these solutions actually cancels out in the end, and all four solutions are real numbers (Notice the scientific notation in each of the decimals above).

We conclude that has five critical points: , , , , and .

Step 7 See if the sign of actually changes at the critical points of , and determine whether has an inflection point at these points.

d2f(2.9)
d2f(3.1)

-2.82489609113212 -3.18861678816105

Since does not change sign at , does not have an inflection point here.

d2f(-10.6)
d2f(-10.5)

-6.87833320245357e-6 0.0000179922253477384

Since the sign changes, has an inflection point at .

d2f(-1.3)
d2f(-1.2)

0.00770424683905568 -0.0147822036307242

Since the sign changes, has an inflection point at .

d2f(.6)
d2f(.7)

-0.0805864668319887 0.0166625176968990

Since the sign changes, has an inflection point at .

d2f(2.1)
d2f(2.2)

0.0175507707028564 -0.0171586030217367

Since the sign changes, has an inflection point at .

Step 8 Find the x- and y-intercepts.

solve(f(x)==0,x)  #find x-intercept

[x == 3]
f(0)  #find y-intercept

9^(1/3)
N(_)

2.08008382305190

The x-intercept is , and the y-intercept is .

Step 9 Determine the end behavior.

limit(f(x),x=+infinity)
limit(f(x),x=-infinity)

+Infinity +Infinity

This function has no horizontal asymptote.

Step 10 Make an informed graph. Mark any - and -intercepts, relative maxima and minima, and inflection points.

Our graph needs to include the following x-values with their corresponding y-values:

f(3);f(-3.85);f(-.65);f(-10.57);f(-1.26);f(.68);f(2.15)

0 2.07621357743516 2.20928352836990 2.21130811676451 2.17283611390427 1.62422212052417 0.635272502740562

We don't want the inflection point at to be right on the edge of the graph, so let's try and .

plot((x^2-6*x+9)^(1/3)/(x^2+1)^(1/5),xmin=-20,xmax=5,ymin=0,ymax=3)+point([(3,0),(-3.85,2.08),(-.65,2.21),(-10.57,2.21),(-1.26,2.17),(.68,1.62),(2.15,.64),(0,2.08)],color='black',size=20)


It's hard to see that the function is concave down on the left side, but if we went far enough in the negative direction to see that, we would obscure the rest of the graph.

Step 11 Discuss absolute max/min, increasing/decreasing, concave up/down.

There is no absolute maximum.

The absolute minimum is 0 at .

The function is increasing on and .

The function is decreasing on and .

The function is concave up on and

The function is concave down on , , , and .