Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three new OPL problems and one bug fix #1216

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions Contrib/UMN-Morris/MSAF/derivative_rules.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# DESCRIPTION
# A scaffolded problem where students apply derivative rules one step at a time.
# ENDDESCRIPTION

## KEYWORDS('derivative, differentiation, derivative rules')
## TitleText1('Derivative Rules Problem')
## DBsubject(Calculus - single variable)
## DBchapter(Differentiation)
## DBsection(Derivatives of polynomials and power functions)
## MO(1)
## Level(2)
## Static(1)
## Language(en)
## Author('Chenfei Peng, Mercredi Chasman')
## Institution('UMinnMorris, 12/13/2024')
## TitleText1(Calculus)
## EditionText1(6e)
## AuthorText1(Stewart)
## Section1(3.1)

DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"PGcourse.pl",
'scaffold.pl',
'parserPopUp.pl',
);

$showPartialCorrectAnswers = 1;

# Define popup options for each step of the derivative process
$popup1 = PopUp([ '?', 'FOIL', 'Sum/difference Rule', 'Power Rule', 'Constant Rule', 'Constant Multiple Rule',
'Simplify', 'Distribute/expand', 'Product Rule', 'Factor'], 'Distribute/expand');
$popup2 = PopUp([ '?', 'FOIL', 'Sum/difference Rule', 'Power Rule', 'Constant Rule', 'Constant Multiple Rule',
'Simplify', 'Distribute/expand', 'Product Rule', 'Factor'], 'Sum/difference Rule');
$popup3 = PopUp([ '?', 'FOIL', 'Sum/difference Rule', 'Power Rule', 'Constant Rule', 'Constant Multiple Rule',
'Simplify', 'Distribute/expand', 'Product Rule', 'Factor'], 'Constant Multiple Rule');
$popup4 = PopUp([ '?', 'FOIL', 'Sum/difference Rule', 'Power Rule', 'Constant Rule', 'Constant Multiple Rule',
'Simplify', 'Distribute/expand', 'Product Rule', 'Factor'], 'Power Rule');
$popup5 = PopUp([ '?', 'FOIL', 'Sum/difference Rule', 'Power Rule', 'Constant Rule', 'Constant Multiple Rule',
'Simplify', 'Distribute/expand', 'Product Rule', 'Factor'], 'Simplify');

Context("Numeric");
$f=Formula("35x^4 - 44x^3 + 24x^2");
BEGIN_PGML
Evaluate the following derivative without using the Product Rule, Quotient Rule, or Chain Rule. Use only one derivative rule at a time and order terms in descending expression order. Answer blanks should be filled with mathematical expressions, numbers, or mathematical symbols [`+,-,*,/,^`] as appropriate.
END_PGML

Scaffold::Begin(
can_open => "when_previous_correct",
is_open => "correct_or_first_incorrect"
);

Section::Begin('Step 1');

BEGIN_PGML

[``
\frac{d}{dx} \Big[ x^3(7x^2 - 11x + 8) \Big] = \frac{d}{dx} \Big[ ``] [__]{7x^5} - [__]{11x^4} + [__]{8x^3} [`` \Big]
``]

*Which rule applies here?*
[________]{$popup1}
END_PGML

Section::End();

Section::Begin('Step 2');

BEGIN_PGML

[``
= \frac{d}{dx} \Big[ ``] [__]{7x^5} [`` \Big] - \frac{d}{dx} \Big[ ``] [__]{11x^4} [`` \Big] + \frac{d}{dx} \Big[ ``] [__]{8x^3} [`` \Big]
``]

*Which rule applies here?*
[________]{$popup2}
END_PGML

Section::End();

Section::Begin('Step 3');

BEGIN_PGML

[``
= 7\frac{d}{dx} \Big[ ``] [__]{Formula("x^5")} [`` \Big] - 11\frac{d}{dx} \Big[ ``] [__]{Formula("x^4")} [`` \Big] + 8\frac{d}{dx} \Big[ ``] [__]{Formula("x^3")} [`` \Big]
``]

*Which rule applies here?*
[________]{$popup3}
END_PGML

Section::End();

Section::Begin('Step 4');

BEGIN_PGML

[``
= 7 \Big( ``] [__]{5x^4} [`` \Big) - 11 \Big( ``] [__]{4x^3} [`` \Big) + 8 \Big( ``] [__]{3x^2} [`` \Big)
``]

*Which rule applies here?*
[________]{$popup4}
END_PGML

Section::End();

Section::Begin('Step 5');

BEGIN_PGML
Finally, simplify:

[``
= ``] [__]{$f}


END_PGML

Section::End();

Scaffold::End();

BEGIN_PGML_SOLUTION
In this solution, we apply the following derivative rules step by step to compute the derivative .

- **Step 1**: We **Distribute/Expand** the product to put it in a form we can differentiate.
- **Step 2**: We use the **Sum/Difference Rule** to break the derivative into individual terms.
- **Step 3**: We apply the **Constant Multiple Rule**, which allows us to pull out constants from the derivatives.
- **Step 4**: We then apply the **Power Rule** to differentiate each power x^n.
- **Step 5**: Finally, we **Simplify** the expression to get the final result.

Final result: 35x^4 - 44x^3 + 24x^2
END_PGML_SOLUTION


ENDDOCUMENT();
121 changes: 121 additions & 0 deletions Contrib/UMN-Morris/MSAF/limitlaws.pg
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# DESCRIPTION
# A scaffolded problem where students use one limit law or operation at a time to compute a limit.
# ENDDESCRIPTION

## DBsubject(Calculus - single variable)
## DBchapter(Limits and continuity)
## DBsection(Rules of limits - basic)
## KEYWORDS('calculus','limits','Limit')
## Level(2)
## MO(1)
## Static(1)
## Language(en)
## TitleText1('Calculus')
## EditionText1('6')
## AuthorText1('Stewart')
## Section1('2.3')
## Problem1('')
## Author('Chenfei Peng, Mercredi Chasman')
## Institution('UMinnMorris, 12/13/2024')


DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGML.pl",
"PGcourse.pl",
'scaffold.pl',
'parserPopUp.pl',
);

$showPartialCorrectAnswers = 1;
$popup1 = PopUp([ '?', 'Sum/difference law', 'Constant Multiple Law', 'Constant Law', 'Power Law',
'Quotient Law', 'Product Law', 'Linear Law'], 'Sum/difference law');
$popup2 = PopUp([ '?', 'Sum/difference law', 'Constant Multiple Law', 'Constant Law', 'Power Law',
'Quotient Law', 'Product Law', 'Linear Law'], 'Constant Multiple Law');
$popup3 = PopUp([ '?', 'Sum/difference law', 'Constant Multiple Law', 'Constant Law', 'Power Law',
'Quotient Law', 'Product Law', 'Linear Law'], 'Power Law');
$popup4 = PopUp([ '?', 'Sum/difference law', 'Constant Multiple Law', 'Constant Law', 'Power Law',
'Quotient Law', 'Product Law', 'Linear Law'], 'Linear Law');


Context("Numeric");

BEGIN_PGML
Use limit laws to compute the following limit. Use only one rule at a time. Answer blanks should be filled with mathematical expressions, numbers, or mathematical symbols [`+,-,*,/,^`] as appropriate.
END_PGML

Scaffold::Begin(
can_open => "when_previous_correct",
is_open => "correct_or_first_incorrect"
);

Section::Begin('Step 1');

BEGIN_PGML
[``
\lim_{x \to 3} \Big[7x^2 + 11x \Big] = \lim_{x \to 3}\Big[ ``] [___]{7x^2} [``\Big]``] [___]{str_cmp("+")} [``\lim_{x \to 3}\Big[ ``] [_]{11x} [``\Big]``]

*Which limit law applies here?*
[________]{$popup1}
END_PGML

Section::End();

Section::Begin('Step 2');
BEGIN_PGML

[``
= ``] [___]{7} [`` \lim_{x \to 3}\Big[ ``] [___]{Formula("x^2")} [``\Big]``] + [_]{11} [``\lim_{x \to 3}\Big[ ``] [_]{x} [``\Big]``]

*Which limit law applies here?*
[________]{$popup2}
END_PGML
Section::End();

Section::Begin('Step 3');
BEGIN_PGML

[``
= 7 ( \lim_{x \to 3} \Big[ ``] [___]{x} [``\Big] )^2 + 11 \lim_{x \to 3} \Big[ ``] [_]{x} [``\Big]``]

*Which limit law applies here?*
[________]{$popup3}
END_PGML
Section::End();

Section::Begin('Step 4');
BEGIN_PGML

[`` = 7 ( ``] [___]{3} [`` )^2 + 11 ( ``] [___]{3} [`` ) ``]

*Which limit law applies here?*
[________]{$popup4}
END_PGML
Section::End();

Section::Begin('Step 5');
BEGIN_PGML

[`` = ``] [___]{96}

END_PGML
Section::End();

Scaffold::End();


BEGIN_PGML_SOLUTION
In this solution, we apply the limit laws step by step to simplify the expression and find the value of the limit.

- **Step 1**: Apply the **Sum/Difference Law** to split the limit.
- **Step 2**: Apply the **Constant Multiple Law** to factor out the constants.
- **Step 3**: Use the **Power Law** to deal with the powers of \( x \).
- **Step 4**: Evaluate the limits by substitution.
- **Step 5**: Combine the results to get the final answer.

Final result: 96.
END_PGML_SOLUTION

ENDDOCUMENT();
Loading