## 2017 Problem Authoring Workshop

### Two Methods for writing Solutions. ### Two Methods for writing Solutions.

by tim Payer -
Number of replies: 1
Greeting all,

I have submitted a Homework problem for our Last homework assignment HW #3. But I thought I would include it here too for comment.

The problem shows a data table with a sign analysis but this is secondary point.
My main point of concern is how to write solutions more efficiently. Before the data table in this problem the student is asked to find the first and second derivative. The solution shows two duplicated displays for finding the derivatives but the code that generated these solutions is very different.
Could you perhaps comment on what might be a better or more efficient way to improve on either or both methods.

I find that the writing of solutions is fairly important if one wants to make use of the "show me another" option to give the student a glimpse into the solving procedure for a similar problem. But writing these solutions is often more of a challenge than the construction of the original problem.

##DESCRIPTION
## Sign Analysis on a Rational Function #4

##KEYWORDS('sign analysis')

## DBsubject('Precalculus')
## DBchapter('Rational equations and functions')
## DBsection('Asymptotes')
## Date('6/26/2017')
## Author('Tim Payer')
# WeBWorK problem written by TimPayer <tsp1@humboldt.edu>
# ENDDESCRIPTION

DOCUMENT();

"PGstandard.pl",
"PGunion.pl",
"PGnumericalmacros.pl",
"PGstatisticsmacros.pl",
"MathObjects.pl",
"parserPopUp.pl",
"PGML.pl",
"unionTables.pl",
"niceTables.pl",
"PGcourse.pl",
"PGchoicemacros.pl",
);

#Text(beginproblem()); #uncomment

$showPartialCorrectAnswers = 1; Context("Numeric"); Parser::Number::NoDecimals($context); # we want exact value of critical numbers
Context()->flags->set(
tolerance => 0.01,
tolType => "absolute",
);

############ Start Problem HW 1.4 #################

#$a = non_zero_random(-7,7); #$b = non_zero_random(-7,7);
#$c = random(2,7)*list_random(-1,1);$a = Real(-5);
$b = Real(-3);$c = Real(-7);

#########################################
### Creating Solution Variables ####
#########################################
$cb = Compute($c*$b); if (($a < 0) && ($b < 0) && ($c < 0)) {
$ai = -$a;
$bi = -$b;
$ci = -$c;
$s1 = "\frac{$ai}{$ci (\pm\infty)^2 +$cb}";
$s2 = "\frac{$ai}{$ci (\infty)^2 +$cb}";
} else {
$ai =$a;
$bi =$b;
$ci =$c;
$s1 = "\frac{$ai}{$ci (\pm\infty)^2-$cb}";
$s2 = "\frac{$ai}{$ci (\infty)^2-$cb}";
}

$gc1 =gcf($a,$c); if ($gc1 == 1) {
$ag =$a;
$cg =$c;
} else {
$ag = Compute($a/$gc1); ## Reducing coeffients$cg = Compute($c/$gc1); ## Reducing coeffients
}

$s3 = Formula("$ag/($cg*(x**2-$b))")->reduce;
#$s3 = Formula("$ag/($cg*(x**2-$b))");

######## END SOLUTION VARIABLES ###########

$sa = Real(0); ## Horizontal Asymptote$fp0 = Formula("$a/($c*x**2- $c*$b)")->reduce; # f(x)
$fpnr = Formula("$a/($c*x**2-$c*$b)"); # f(x)$fpD = $fp0->D;$fp1 = Formula("(-2*$a*x)/($c*(x**2-$b)**2)")->reduce; # first derivative$fp2 = Formula("(2*$a*(3*x**2 +$b))/($c*(x**2 -$b)**3)")->reduce; # second derivative

## For f(x) a critical point at x = 0 will be stradled by either two vertical asymptotes
## or two points of inflection dependent upon whether $b is positive ## or negative. Accordingly an if-conditional will assign these values as critical numbers ## of$cn1 and $cn2 and the student will have to determine in their sign analysis whether ## they are working with a pair of vertical asymptotes or a pair of inflection points. ## if ($b > 0 ) {
$cnl ="V. asymptote"; ## Vertical asymptotes$cn1 = Compute("-sqrt($b)")->reduce;$cn2 = Compute("sqrt($b)")->reduce;$cn1f = "$$-\sqrt{b}$$";
$cn2f = "$$\sqrt{b}$$"; @cnt = ('denominator', 'vertical asymptotes'); if ($a*$c < 0 ) {$qa = Compute("-abs($ag)");$qc = Compute("abs($cg)");$t4 = "\frac{ ($qa)'\cdot$qc(x^2-$b)-$qc(x^2-$b)'($qa)}{$qc^2(x^2-$b)^2}";
$t5 = Formula("(0 -$qc*(2x)*($qa))/($qc**2*(x**2-$b)**2)");$t6 = Formula("(0 - $qc*2*$qa*x)/($qc**2(x**2-$b)**2)")->reduce;
$t7 = Formula("(-2*$qa*x)/($qc*(x**2-$b)**2)")->reduce;
$ag2 = Compute("-2*$qa");
$t8 = "\frac{ ($ag2 x)'\cdot $qc(x^2-$b)^2 - \left($qc(x^2-$b)^2\right)'($ag2 x)}{$qc^2(x^2-$b)^4}";$t9 = Formula("(($ag2)*($qc)*(x**2 - $b)**2 -2*($qc)*(x**2 - $b)*(2*x)*$ag2*x)/($qc**2(x**2-$b)**4)");
$t10 = Formula("($ag2*$qc(x**2 -$b)**2 -4*$ag2*$qc*(x**2 - $b)*x**2)/($qc**2(x**2-$b)**4)");$t11 = Formula("($ag2*(x**2 -$b) -4*$ag2*x**2)/($qc*(x**2-$b)**3)");$t12 = Formula("($ag2*x**2 -$b*$ag2 -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;
$t13 = Formula("($ag2*-3*(x**2) - $b*$ag2)/($qc*(x**2-$b)**3)");
$t14 = Formula("(-$ag2*( 3*x**2 + $b))/($qc*(x**2-$b)**3)"); } else { #$a*$c > 0$qa = Compute("abs($ag)");$qc = Compute("abs($cg)");$t4 = "\frac{ ($qa)'\cdot$qc(x^2-$b)-$qc(x^2-$b)'($qa)}{$qc^2(x^2-$b)^2}";
$t5 = Formula("(0 -$qc*(2x)*($qa))/($qc**2*(x**2-$b)**2)");$t6 = Formula("(0 - $qc*2*$qa*x)/($qc**2(x**2-$b)**2)")->reduce;
$t7 = Formula("(-2*$qa*x)/($qc*(x**2-$b)**2)")->reduce;
$ag2 = Compute("-2*$qa");
$t8 = "\frac{ ($ag2 x)'\cdot $qc(x^2-$b)^2 - \left($qc(x^2-$b)^2\right)'($ag2 x)}{$qc^2(x^2-$b)^4}";$t9 = Formula("($ag2*$qc*(x**2 - $b)**2 -2*($qc)*(x**2 - $b)*(2*x)*$ag2*x)/($qc**2(x**2-$b)**4)");
$t10 = Formula("($ag2*$qc(x**2 -$b)**2 -4*$ag2*$qc*(x**2 - $b)*x**2)/($qc**2(x**2-$b)**4)")->reduce;$t11 = Formula("($ag2*(x**2 -$b) -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;$t12 = Formula("($ag2*x**2 -$b*$ag2 -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;
$t13 = Formula("($ag2*-3*(x**2) - $b*$ag2)/($qc*(x**2-$b)**3)")->reduce;
$t14 = Formula("(-$ag2*( 3*x**2 + $b))/($qc*(x**2-$b)**3)"); } } else { ### When$b < 0
$cnl ="inflection point"; ## Points of inflection$cb1 = Compute(-$b)->reduce; ## To enforce exact values, no Decimals$cn1 = Compute("-sqrt($cb1/3)")->reduce; @cnt = ('second derivative', 'points of inflection');$cn2 = Compute("sqrt($cb1/3)");$gc3 = gcf(3,$cb1); if ($gc3 ==1 ) {
$cn1f = "$$-\sqrt{cb1/3}$$";$cn2f = "$$\sqrt{cb1/3}$$";
} else {
$ip1 = Compute("$cb1/3");
$cn1f = "$$-\sqrt{ip1}$$";$cn2f = "$$\sqrt{ip1}$$";
}
if ( $a*$c < 0 ) {
$qa = Compute("-abs($ag)");
$qc = Compute("abs($cg)");
$t4 = "\frac{ ($qa)'\cdot $qc(x^2-$b)- $qc(x^2-$b)'($qa)}{$qc^2(x^2-$b)^2}";$t5 = Formula("((3-3) - $qc*(2x)*($qa))/($qc**2*(x**2-$b)**2)")->reduce;
$t6 = Formula("(0 -$qc*2*$qa*x)/($qc**2(x**2-$b)**2)")->reduce;$t7 = Formula("(-2*$qa*x)/($qc*(x**2-$b)**2)")->reduce;$ag2 = Compute("-2*$qa");$t8 = "\frac{ ($ag2 x)'\cdot$qc(x^2-$b)^2 - \left($qc(x^2-$b)^2\right)'($ag2 x)}{$qc^2(x^2-$b)^4}";
$t9 = Formula("(($ag2)*($qc)*(x**2 -$b)**2 -2*($qc)*(x**2 -$b)*(2*x)*($ag2*x))/($qc**2(x**2-$b)**4)")->reduce;$t10 = Formula("($ag2*$qc(x**2 - $b)**2 -4*$ag2*$qc*(x**2 -$b)*x**2)/($qc**2(x**2-$b)**4)")->reduce;
$t11 = Formula("($ag2*(x**2 - $b) -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;
$t12 = Formula("($ag2*x**2 - $b*$ag2 -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;$t13 = Formula("($ag2*-3*(x**2) -$b*$ag2)/($qc*(x**2-$b)**3)")->reduce;$t14 = Formula("($ag2*( -3*x**2 -$b))/($qc*(x**2-$b)**3)")->reduce;
} else { # When $a*$c > 0
$qa = Compute("abs($ag)");
$qc = Compute("abs($cg)");
$t4 = "\frac{ ($qa)'\cdot $qc(x^2-$b)- $qc(x^2-$b)'($qa)}{$qc^2(x^2-$b)^2}";$t5 = Formula("(0 - $qc*(2x)*($qa))/($qc**2*(x**2-$b)**2)")->reduce;
$t6 = Formula("(0 -$qc*2*$qa*x)/($qc**2(x**2-$b)**2)")->reduce;$t7 = Formula("(-2*$qa*x)/($qc*(x**2-$b)**2)")->reduce;$ag2 = Compute("-2*$qa");$t8 = "\frac{ ($ag2 x)'\cdot$qc(x^2-$b)^2 - \left($qc(x^2-$b)^2\right)'($ag2 x)}{$qc^2(x^2-$b)^4}";
$t9 = Formula("($ag2*$qc*(x**2 -$b)**2 -2*($qc)*(x**2 -$b)*(2*x)*$ag2*x)/($qc**2(x**2-$b)**4)")->reduce;$t10 = Formula("($ag2*$qc(x**2 - $b)**2 -4*$ag2*$qc*(x**2 -$b)*x**2)/($qc**2(x**2-$b)**4)")->reduce;
$t11 = Formula("($ag2*(x**2 - $b) -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;
$t12 = Formula("($ag2*x**2 - $b*$ag2 -4*$ag2*x**2)/($qc*(x**2-$b)**3)")->reduce;$t13 = Formula("($ag2*-3*(x**2) -$b*$ag2)/($qc*(x**2-$b)**3)")->reduce;$t14 = Formula("(-$ag2*( 3*x**2 +$b))/($qc*(x**2-$b)**3)")->reduce;
}
}

### A Separate method and if then condition for forming solutions:
### Focus on using variable substitution with LaTeX expressions.
## Using just a few if-then conditions below:

if ( $a*$c < 0 ) {
$aa = Compute("-abs($ag)"); ## For Solution coeficcents
$cc = Compute("abs($cg)"); ## For Solution coeficcents
} else { # When $a*$c > 0
$aa = Compute("abs($ag)"); ## For Solution coeficcents
$cc = Compute("abs($cg)"); ## For Solution coeficcents
}

if ( $b > 0 ) {$xxb = "x^2 - $b"; # for solution quantity } else {$bb = Compute("-$b");$xxb = "x^2 + $bb"; } ## [$cc*$aa*6]x^2 [@$cc*$aa*$b*2 < 0 ? " ":" + "@] [$cc*$aa*$b*2] if ($b == -3 ) {
$nn1 = " ";$nn2 = -1;
$gc6 = -$aa*$b*2; } elsif ($b == 3) {
$nn1 = " ";$nn2 = 1;
$gc6 =$aa*$b*2; } else {$nn1 = 3;
$nn2 =$b;
$gc6 =$aa*2;
}

if ( $a*$c < 0 ) {
$f1s = "dec";$f2s = "dec";
$f3s = "inc";$f4s = "inc";
$d1s = "-";$d2s = "-";
$d3s = "+";$d4s = "+";
$dd1s = "CD";$dd2s = "CU";
$dd3s = "CU";$dd4s = "CD";
} else { ## $a*$c > 0
$f1s = "inc";$f2s = "inc";
$f3s = "dec";$f4s = "dec";
$d1s = "+";$d2s = "+";
$d3s = "-";$d4s = "-";
$dd1s = "CU";$dd2s = "CD";
$dd3s = "CD";$dd4s = "CU";
}
$cp0 = Real(0); #### Column Header: Critical number ID$cpop1 = PopUp(
["?", 'V. asymptote', 'critical point', 'inflection point'], $cnl);$cpop2 = PopUp(
["?", 'V. asymptote', 'critical point', 'inflection point'], 'critical point');

$cpop3 = PopUp( ["?", 'V. asymptote', 'critical point', 'inflection point'],$cnl);

### Row 2, f(x) is incresing or decreasing

$f1 = PopUp( ["?", 'inc', 'dec'],$f1s);
$f2 = PopUp( ["?", 'inc', 'dec'],$f2s);
$f3 = PopUp( ["?", 'inc', 'dec'],$f3s);
$f4 = PopUp( ["?", 'inc', 'dec'],$f4s);

### Row 3, f'(x) is positive or negative
$d1 = PopUp( ["?", '+', '-'],$d1s);
$d2 = PopUp( ["?", '+', '-'],$d2s);
$d3 = PopUp( ["?", '+', '-'],$d3s);
$d4 = PopUp( ["?", '+', '-'],$d4s);

### Row 4, f''(x) is positive with f(x) CU or f''(x) is negative with f(x) CD
$dd1 = PopUp( ["?", 'CU', 'CD'],$dd1s);

$dd2 = PopUp( ["?", 'CU', 'CD'],$dd2s);

$dd3 = PopUp( ["?", 'CU', 'CD'],$dd3s);

$dd4 = PopUp( ["?", 'CU', 'CD'],$dd4s);
########################################

#################### Begin Problem...#######################

BEGIN_PGML
*WeBWorK workshop 2017 HW 1.4)
A sign analysis for a rational function
This Assignment Explores 2 Methods of Solution Displays in regards to the first
and second derivatives.
Please Comment on these two approaches and perhaps offer improvements?*

*HW 1.4)* Given the rational function [f(x) = [$fp0]], perform a sign analysis for the function and the first and second derivatives. Find all critical points, points of inflection, and asymptotes associated with the function. *1.4a)* Find the horizontal aymptote at [\lim_{x\to \pm\infty}f(x)] = [_______]* *1.4b)* Find the first derivative [f'(x)] = [_______]* *1.4b2)* Find the first derivative using "D" [f'(x)] = [_______]* *1.4c)* Find the second derivative [f''(x)] = [_______]* [@ DataTable( [ ["$BBOLD 1.4d) $EBOLD Complete the table below for a correct sign analysis display. Use the key at the right to enter the correct values for the function. Use ascending order to display the numerical value for each critical number. Indicate whether a given critical number is a critical point, a vertical asymptote or an inflection point.","","V. asymptote = Vertical asymptote.$BR inc = \$$f(x)\$$ is increasing. $BR dec = \$$f(x)\$$ is decreasing.$BR + = \$$f(x)\$$ is positive. $BR - = \$$f (x)\$$ is negative.$BR CU = \$$f^{\\prime \\prime}(x) > 0\$$ and \$$f(x)\$$ is concave up. BR CD = \$$f^{\\prime \\prime}(x) < 0\$$ and \$$f(x)\$$ is concave down." ], ], caption => " ", midrules=>1, align => "|p{3in} p{0.2in}|p{3in}|" ); @]*** [@ DataTable( [ ["","BeforeBR the first $BR critical$BR number:","The first critical $BR number is a:$BR".$cpop1->menu."","After$BR the first $BR critical$BR number:","The second critical $BR number is a:$BR ".$cpop2->menu."","Before the$BR third critical $BR number:", "The third critical$BR number is a: $BR".$cpop3->menu."", "After the $BR third critical$BR number:" ],
["\$$x =\$$","","".$cn1->ans_rule(5)."","","".$cp0->ans_rule(2)."", "", "".$cn2->ans_rule(5)."","" ], ["\$$f(x)\$$","".$f1->menu."","","".$f2->menu."","", "".$f3->menu."", "","".$f4->menu."" ], ["\$$f^\\prime (x)\$$","".$d1->menu."","","".$d2->menu."","", "".$d3->menu."", "","".$d4->menu."" ], ["\$$f^{\\prime \\prime} (x)\$$","".$dd1->menu."","","".$dd2->menu."","", "".$dd3->menu."", "","".dd4->menu."" ], ], caption => " ", midrules=>1, align => "|p{0.25in}|p{0.6in}|p{1.4in}|p{0.6in}| p{1.4in}|p{0.7in}|p{1.4in}|p{0.6in}|" ); @]*** END_PGML #Adapted weighted answers values: ## Asymptotes and derivatives ## WEIGHTED_ANS( (sa)->cmp, 5 );
WEIGHTED_ANS( ($fp1)->cmp, 10 ); WEIGHTED_ANS( ($fpD)->cmp, 10 );
WEIGHTED_ANS( ($fp2)->cmp, 15 ); ## HW 1.4d Sign Analysis Table: ## ###Column Header: Critical number ID WEIGHTED_ANS( ($cpop1)->cmp, 3 );
WEIGHTED_ANS( ($cpop2)->cmp, 3 ); WEIGHTED_ANS( ($cpop3)->cmp, 3 );
###Row 1:

WEIGHTED_ANS( ($cn1)->cmp, 10 ); WEIGHTED_ANS( ($cp0)->cmp, 2 );
WEIGHTED_ANS( ($cn2)->cmp, 10 ); ###Row 2: WEIGHTED_ANS( ($f1)->cmp, 1 );
WEIGHTED_ANS( ($f2)->cmp, 1 ); WEIGHTED_ANS( ($f3)->cmp, 1 );
WEIGHTED_ANS( ($f4)->cmp, 1 ); ###Row 3: WEIGHTED_ANS( ($d1)->cmp, 1 );
WEIGHTED_ANS( ($d2)->cmp, 1 ); WEIGHTED_ANS( ($d3)->cmp, 1 );
WEIGHTED_ANS( ($d4)->cmp, 1 ); ###Row 4: WEIGHTED_ANS( ($dd1)->cmp, 1 );
WEIGHTED_ANS( ($dd2)->cmp, 1 ); WEIGHTED_ANS( ($dd3)->cmp, 1 );
WEIGHTED_ANS( ($dd4)->cmp, 1 ); ########################################## BEGIN_PGML_SOLUTION *Solution:* *HW 1.4)* Given the rational function [f(x) = [$fp0]], perform a sign analysis for the function and the first and second derivatives.
Find all critical points, points of inflection, and asymptotes associated with the function.

*1.4a)* Find the horizontal aymptote at [\lim_{x\to \pm\infty}f(x) = ??]
By taking the limit as [x\to \pm\infty] for [\lim_{x\to \pm\infty}[fp0]] [\begin{aligned}&\\ \lim_{x\to \pm\infty}[fp0] &= [$s1] && \text{Squaring infinity in the denominator... }\\ \lim_{x\to \pm\infty}[$fp0] &= [$s2] && \text{overwhelms the numerator and brings the function...}\\ \lim_{x\to \pm\infty}[$fp0] &= 0 && f(x) \text{ to zero.}\\
y &= 0 && \text{Then the function } f(x) \text{ has a horizontal asymptote at } y = 0.
\end{aligned}]

*WRITING SOLUTIONS METHOD 1: Using Formula, ->reduce, and parentheses enable partial reductions:*
*METHOD 1 required 4 conditions within two if-else conditions in 62 lines of code (before the solution display).*

*1.4b)* Find the first derivative [f'(x) = ??]

[\begin{aligned}&\\
f(x) &= [$fpnr] = [$fp0] = [$s3] && \text{First reduce the function if possible. }\\ f'(x) &= \left([$s3]\right)' && \text{Apply the derivative.}\\
f'(x) &= [$t4] && \text{Apply the quotient rule. t4}\\ f'(x) &= [$t5] && \text{Apply prime tics of the derivative. t5 }\\
f'(x) &= [$t6] && \text{Combine factors. t6 }\\ f'(x) &= [$t7] && \text{Reduce. t7 }
\end{aligned}]

*1.4c)* Find the second derivative [f''(x) = ??]

[\begin{aligned}&\\
f''(x) &= \left([$t7]\right)' && \text{Apply the second derivative. t7}\\ f''(x) &= [$t8] && \text{Apply the quotient rule. t8}\\
f''(x) &= [$t9] && \text{Applying prime tics and chain rule. t9}\\ f''(x) &= [$t10] && \text{Combine constants. t10}\\
f''(x) &= [$t11] && \text{Cancel common factors. t11}\\ f''(x) &= [$t12] && \text{Distribute. t12}\\
f''(x) &= [$t13] && \text{Combine like terms. t13}\\ f''(x) &= [$t14] && \text{Factor if possible. t14}\\
\end{aligned}]

*WRITING SOLUTIONS METHOD 2: Using LaTeX with substituted variables and inline if-then commands.*
*METHOD 2 Required only 26 lines of code before the solution display, with 3 if else conditions*
*and 6 in-line if-else conditions. The benefit of the second method is that it can be written*
*primarily within the PGML solution. The downside is that even with fewer lines of code the*
*second method requires that greater attention be paid to changes of sign for each and every*
*term for a given scenario, and often strings must be substituted to simulate connecting signs*
*of "+" and "-" between terms.*
**Do You have any Suggestions for a better approach, especially for Method 2?**

*1.4b)* Find the first derivative [f'(x) = ??]

[\begin{aligned}&\\
f(x) &= [$fpnr] = [$fp0] = [$s3] && \text{First reduce the function if possible. }\\ f'(x) &= \left([$s3]\right)' && \text{Apply the derivative.}\\
f'(x) &= \frac{([$aa])'\cdot [$cc] \cdot([$xxb])-[$cc]\cdot ([$xxb])'([$aa])}{[$cc*$cc]([$xxb])^2} && \text{Apply the quotient rule.}\\ f'(x) &= \frac{0 -[$cc]\cdot (2x)([$aa])}{[$cc*$cc]([$xxb])^2} && \text{Apply prime tics of the derivative.}\\
f'(x) &= \frac{[$cc*$aa*-2]x}{[$cc*$cc]([$xxb])^2} && \text{Combine factors. }\\ f'(x) &= \frac{[$aa*-2]x}{[$cc]([$xxb])^2} && \text{Reduce. }
\end{aligned}]

*1.4c Find the second derivative Using TeX variable Sub)* Find the second derivative Using TeX sub [f''(x) = ??]

[\begin{aligned}&\\
f''(x) &= \left(\frac{[$aa*-2]x}{[$cc]([$xxb])^2}\right)' && \text{Apply the second derivative.}\\ f''(x) &= \frac{([$aa*-2]x)'\cdot [$cc]([$xxb])^2 - \left([$cc]([$xxb])^2 \right)' ([$aa*-2]x)}{[$cc]^2([$xxb])^4} && \text{Apply the quotient rule.}\\ f''(x) &= \frac{[$aa*-2]\cdot [$cc]([$xxb])^2 - 2\cdot[$cc]([$xxb])(2x) ([$aa*-2]x)}{[$cc]^2([$xxb])^4} && \text{Applying prime tics and chain rule.}\\ f''(x) &= \frac{[$cc*$aa*-2]([$xxb])^2 [@ $aa < 0 ? " " : " + " @][$cc*$aa*8]([$xxb])x^2}{[$cc]^2([$xxb])^4} && \text{Combine constants.}\\
f''(x) &= \frac{[$aa*-2]([$xxb]) [@ $aa < 0 ? " " : " + " @][$aa*8]x^2}{[$cc]([$xxb])^3} && \text{Cancel common factors.}\\
f''(x) &= \frac{[$aa*-2]x^2 [@$aa*$b < 0 ? " ":" + "@] [$aa*$b*2] [@$aa < 0 ? " ":" + "@][$aa*8]x^2}{[$cc]([$xxb])^3} && \text{Distribute.}\\ f''(x) &= \frac{[$aa*6]x^2 [@ $aa*$b < 0 ? " ":" + "@] [$aa*$b*2] }{[$cc]([$xxb])^3} && \text{Combine like terms.}\\
f''(x) &= \frac{[$gc6]([$nn1]x^2 [@ $b < 0 ? " ":" + "@] [$nn2] ) }{[$cc]([$xxb])^3} && \text{Factor if possible.}
\end{aligned}]

The middle critical number is a critical point at [x = 0].
We find it by setting the first derivative to zero: [f'(x) = 0] and then solving for [x].
The first and third critical numbers are found by setting the [$cnt] to zero and then solving for [x]. Doing so will reveal two [$cnt] at [x = ] [$cn1f] [\approx] [$cn1] and [x = ] [$cn2f] [\approx] [$cn2].
Knowing these three values allows us to complete the sign analysis in the table below.

[@
DataTable(
[
["","Before $BR the first$BR critical $BR number:","The first critical$BR number is a: $BR$cpop1","After $BR the first$BR critical $BR number:","The second critical$BR number is a: $BR$cpop2 ","Before the $BR third critical$BR number:", "The third critical $BR number is a:$BR $cpop3 ", "After the$BR third critical $BR number:" ], ["\$$x =\$$","",$cn1,"",$cp0, "",$cn2,"" ],
["\$$f(x)\$$","$f1","","$f2","", "$f3", "","$f4" ],
["\$$f^\\prime (x)\$$","$d1","","$d2","", "$d3", "","$d4" ],
["\$$f^{\\prime \\prime} (x)\$$","$dd1","","$dd2","", "$dd3", "","$dd4" ],
],
caption => " ",
midrules=>1,
align => "|p{0.25in}|p{0.6in}|p{1.4in}|p{0.6in}| p{1.4in}|p{0.7in}|p{1.4in}|p{0.6in}|"
);
@]***

END_PGML_SOLUTION

ENDDOCUMENT(); ### Re: Two Methods for writing Solutions.

by tim Payer -
Okay Hold on!

I will be adding a third solution scenario:

Tim Lauck showed me a way to use sub-routines with inline if-then conditions.

This promises to work smoothly if I can press it into place.

Wait for version 3 in this HW 1 problem come Wed. morn.

Tim