## DBsubject(Calculus - multivariable)
## DBchapter(Calculus of vector valued functions)
## DBsection(Parameterized curves)
## Institution(W.H.Freeman)
## Author(JustAsk - Vladimir Finkelshtein)
## MLT(pc_circles_in_intersections)
## Level(2)
## MO(1)
## TitleText1('Calculus: Early Transcendentals')
## AuthorText1('Rogawski')
## EditionText1('2')
## Section1('13.1')
## Problem1('27')
## KEYWORDS('calculus')

DOCUMENT();
loadMacros(
  "PGstandard.pl",
  "Parser.pl",
  "freemanMacros.pl",
  "parserMultiAnswer.pl",
  "PGcourse.pl"
);

TEXT(beginproblem());

$a=random(2,9,1);
$a2=$a**2;
$z=random(2,8,1);
$zpow=random(2,4,1);

$context = Context();
$context->variables->add(t=>'Real');

$ansx=Formula("$a*cos(t)");
$ansy=Formula("$a*sin(t)");
$anszc=Formula("$z*($a*cos(t))^($zpow)");
$anszs=Formula("$z*($a*sin(t))^($zpow)");

$multipart = MultiAnswer($ansx, $ansy, $anszc)->with(
  singleResult => 1,
  checker => sub {
      my($correct, $student, $self) = @_;
      my($fx, $fy, $fzc) = @{$correct};
      my($sx, $sy, $sz) = @{$student};
      return (($fx == $sx && $fy == $sy && $fzc == $sz) ||
         ($fx == $sy && $fy == $sx && $anszs == $sz));
    }
  );

Context()->texStrings;

BEGIN_TEXT
\{ textbook_ref_exact("Rogawski ET 2e", "13.1","27") \}
$PAR
Use \(\cos(t)\) and \(\sin(t)\), with positive coefficients, to parametrize the intersection of the surfaces \(x^2+y^2=$a2\) and \(z=$z x^{$zpow}\).
$PAR
\(\bf r\it (t)=\left< \right.\)
  \{$multipart->ans_rule()\},
  \{$multipart->ans_rule()\},
  \{$multipart->ans_rule()\}
\(\left. \right>\)
$PAR
END_TEXT

Context()->normalStrings;
ANS($multipart->cmp());

Context()->texStrings;
SOLUTION(EV3(<<'END_SOLUTION'));
$PAR
$SOL
$BR
The points on the cylinder \(x^2+y^2=$a2\) and on \(z=$z x^{$zpow}\) can be written in the form: $BR
\(x^2+y^2=$a2 \rightarrow \left($a \cos t, $a \sin t, z\right)\) $BR
\(z=$z x^{$zpow} \rightarrow \left(x,y,$z x^{$zpow} \right)\) $PAR
The points \((x,y,z)\) on the intersection curve must satisfy the following equations:
$BR
\(x=$a\cos t\)$BR
\(y=$a\sin t\) $BR
\(z=$z x^{$zpow}=$z ($a \cos t)^{$zpow}\) $PAR
We obtain the vector parametrization: $BR
\( \bf r\it (t)=\left< $a \cos t, $a \sin t, $z($a \cos t)^{$zpow} \right> \)
$BR
END_SOLUTION

ENDDOCUMENT();
