Difference Quotient

Difference quotients

Complete Code

Download file: DifferenceQuotient.pg

POD for Macro Files

PG problem file

Explanation

DOCUMENT();

loadMacros(
    'PGstandard.pl',               'PGML.pl',
    'parserDifferenceQuotient.pl', 'PGcourse.pl'
);

Preamble

We need to include the macros file parserDifferenceQuotient.pl.

$limit = DifferenceQuotient('2 * x + h', 'h');

$fp = Compute('2 x');

Setup

The routine DifferenceQuotient(‘function’, ‘variable’) takes the simplified function and a variable name. If the variable is omitted, dx is used by default.

BEGIN_PGML
Simplify and then evaluate the limit.

[``
    \frac{d}{dx} \big( x^2 \big)
    = \lim_{h \to 0} \frac{(x+h)^2-x^2}{h}
    = \lim_{h \to 0} \Big(
``] [_]{$limit}{15} [``\Big) =``] [_]{$fp}{15}
END_PGML

Statement

This is the problem statement in PGML.
BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.