16 std::cout <<
"DERIVATIVE EXAMPLE\n\n";
24 std::cout <<
"Original Polynomial 1: \n";
29 std::cout <<
"Derivative 1: \n";
41 std::cout <<
"Original Polynomial 2: \n";
46 std::cout <<
"Derivative 2: \n";
51 std::cout <<
"<------------>\n";
54 double result = derivative2.
eval(x_value);
55 std::cout <<
"Derivative2 at x = " << x_value <<
": " << result
64 std::cout <<
"Original Polynomial 3: \n";
68 std::cout <<
"Second derivative of Polynomial 3: \n";
73 std::cout <<
"<------------>\n";
81 std::cout <<
"Original Polynomial 4: \n";
84 double limitAtX = poly4->
limit_at(2);
85 std::cout <<
"Limit at x = 2: " << limitAtX << std::endl;
88 std::cout <<
"Limit as x approaches infinity: " << limitAtInfinity
92 std::cout <<
"Second derivative of Polynomial 4: \n";
97 std::cout <<
"<------------>\n";
111 std::cout <<
"Derivative of (4x^2 + 1)^5 is: ";
User API for OpenGPMP CALCULUS MODULE.
Calculus Class with methods pertaining to basic operations.
double limit_at_infinity() const
Calculate the limit of the polynomial as x approaches infinity.
Differential power_rule() const
Computes the derivative using the power rule.
double limit_at(double x) const
Calculate the limit of the polynomial at a specific point.
void add_term(double coefficient, int exponent)
Adds a term to the Differential object.
Differential chain_rule(const Differential &inner) const
Computes the derivative using the chain rule.
void display() const
Displays the polynomial in a readable format.
double eval(double x) const
Evaluates the polynomial for a given value of x.