Quadratic approximation in Maple

A few of my students are having trouble using Maple to pull off a quadratic approximation. I wanted to post a little code to help them along.

As usual, I strongly encourage my students to use Maple Classic. The java interface of normal Maple may be flashy an appealing to the ignorant or those unfortunate enough to get used to it, but most real world work in Maple is done with Maple classic.

For a function f(x), the quadratic approximation about a point a is given by

    \[   Q(x) = f(a) + f'(a) (x-a) + \frac{f''(a)}{2}\,(x-a)^2. \]

In Maple, this can be implemented as:

> restart;
> f:=ln(x)/sqrt(x); # Define a function
> a:=1; # The point about which we'll expand
> Q:=subs(x=a, f) + subs(x=a, diff(f, x))*(x-a) + subs(x=a, diff(f, x, x))*(x-a)^2/2;
> plot([f, Q], x=-5..5, y=-5..5);

Now try playing around with the above code. Change the values of a and f(x).

No related posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.