Symbolic Math Toolbox    

Calculus Example

This section describes how to analyze a simple function to find its asymptotes, maximum, minimum, and inflection point. The section covers the following topics:

Defining the Function

The function in this example is

To create the function, enter the following commands:

This returns

You can plot the graph of f by entering

This displays the following plot.

Finding the Asymptotes

To find the horizontal asymptote of the graph of f, take the limit of f as x approaches positive infinity:

The limit as x approaches negative infinity is also 3. This tells you that the line
y = 3 is a horizontal asymptote to the graph.

To find the vertical asymptotes of f, set the denominator equal to 0 and solve by entering the following command:

This returns to solutions to :

This tells you that vertical asymptotes are the lines

and

You can plot the horizontal and vertical asymptotes with the following commands:

Note that roots must be converted to double to use the plot command.

The preceding commands display the following figure.

To recover the graph of f without the asymptotes, enter

Finding the Maximum and Minimum

You can see from the graph that f has a local maximum somewhere between the points x = 2 and x = 3, and might have a local minimum between x = -4 and x = -2. To find the x-coordinates of the maximum and minimum, first take the derivative of f:

This returns

To simplify this expression, enter

which returns

You can display f1 in a more readable form by entering

which returns

Next, set the derivative equal to 0 and solve for the critical points:

This returns

It is clear from the graph of f that it has a local minimum at

and a local maximum at

You can plot the maximum and minimum of f with the following commands:

This displays the following figure.

Finding the Inflection Point

To find the inflection point of f, set the second derivative equal to 0 and solve.

This returns

In this example, only the first entry is a real number, so this is the only inflection point. (Note that in other examples, the real solutions might not be the first entries of the answer.) Since you are only interested in the real solutions, you can discard the last two entries, which are complex numbers.

To see the symbolic expression for the inflection point, enter

This returns

To plot the inflection point, enter

The extra argument, [-9 6], in ezplot extends the range of x values in the plot so that you see the inflection point more clearly, as shown in the following figure.


  Taylor Series Extended Calculus Example 

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS