## DESCRIPTION ## Algebra - Transformation of Graphs ## ENDDESCRIPTION ## DBsubject(Algebra) ## DBchapter(Transformations of functions and graphs) ## DBsection(Shifts: vertical and horizontal) ## Date(7/17/2022) ## Institution(UWEC) ## Level(2) ## KEYWORDS('Algebra','Transformtions','Graphs','transformations of functions') # # First comes some stuff that appears at the beginning of every problem # DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGstandard.pl", "MathObjects.pl", "answerHints.pl", "PGtikz.pl", "TikZ_utils.pl", "PGcourse.pl", ); TEXT(beginproblem()); $refreshCachedImages = 1; #Graph the standard function $graph=GraphWithTikZ(function=>Formula("x^2")); #pick offsets $a=non_zero_random(-3,3); do {$b=non_zero_random(-3, 3)} until abs($b)!=abs($a); $c=-$a; #These are the correct answers $ans1 = Compute("(x+$c)**2")->with(limits=>[-5,5]); $ans2 = Compute("x**2+$b")->with(limits=>[-5,5]); #prepare graph of first correct answer $graph1 = GraphWithTikZ(function=>$ans1); # prepare graph of second correct answer $graph2 = GraphWithTikZ(function=>$ans2); BEGIN_TEXT The graph of \( y= x^2 \) is given below: $BR \{ image($graph, width=>200, tex_size=>1000) \} $BR Find a formula for each of the transformations whose graphs are given below. $BR a) $BR \{ image(insertGraph($graph1), width=>200, tex_size=>1000) \} $BR \( y = \) \{ans_rule(30)\} $BR b) $BR \{ image(insertGraph($graph2), width=>200, tex_size=>1000) \} $BR \( y = \) \{ans_rule(30)\} END_TEXT ANS($ans1->cmp()->withPostFilter(AnswerHints( [Compute("x**2+$c"),Compute("x**2-$c")]=>"To get a horizontal shift, f(x-h), you must substitute (x-h) IN PARENTHESES for x in the original function.", Compute("(x+$a)**2")=>"Be careful of the direction of the shift", ))); ANS($ans2->cmp()->withPostFilter(AnswerHints( [Compute("(x+$b)**2"),Compute("(x-($b))**2")]=>"To get a vertical shift, f(x)+k, you must add k to the original function.", Compute("x**2-($b)")=>"Be careful of the direction of the shift", )) ); ENDDOCUMENT(); # This should be the last executable line in the problem.