[npl] / trunk / NationalProblemLibrary / Rochester / setIntegrals19Area / ns6_1_25.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# Diff of /trunk/NationalProblemLibrary/Rochester/setIntegrals19Area/ns6_1_25.pg

Revision 464 Revision 465
24"PG.pl", 24"PG.pl",
25"PGbasicmacros.pl", 25"PGbasicmacros.pl",
26"PGchoicemacros.pl", 26"PGchoicemacros.pl",
28"PGauxiliaryFunctions.pl" 28"PGauxiliaryFunctions.pl",
29"PGgraphmacros.pl"
29); 30);
30 31
31$showPartialCorrectAnswers = 1; 32$showPartialCorrectAnswers = 1;
32 33
33$pi = 4*arctan(1); 34$pi = 4*arctan(1);
45$$x=0$$ to $$x=a\pi$$. 46$$x=0$$ to $$x=a\pi$$.
46$BR 47$BR
47Hint: Notice that this region consists of two parts. 48Hint: Notice that this region consists of two parts.
48$BR 49$BR
49\{ans_rule(45)\} 50\{ans_rule(45)\}
50$PAR 51END_TEXT 51END_TEXT 52 52 53ANS(num_cmp($ans)); 53ANS(num_cmp($ans)); 54 54 55##set$PG_environment{'textbook'} in webworkCourse.ph 55##set $PG_environment{'textbook'} in webworkCourse.ph 59This is similar to Example 1 in Section 5.8 of the text. 59This is similar to Example 1 in Section 5.8 of the text. 60END_TEXT 60END_TEXT 61} 61} 62} 62} 63 63 64$soln_leftx = -0.5;
65$soln_rightx =$b+0.5;
66$soln_boty = -0.5; 67$soln_topy = ($g >$f*sin($b)) ?$g+0.5 : $f*sin($b)+0.5;
68
69$graph = init_graph($soln_leftx,$soln_boty,$soln_rightx,$soln_topy, 70 'axes'=>[0,0], 71 'grid'=>[$soln_rightx-$soln_leftx,$soln_topy-$soln_boty], 72 'size'=>[400,400]); 73plot_functions($graph,FEQ(
74 "$g*cos(x) for x in [0,$b] using color=blue and weight=2"
75 ));
76plot_functions($graph,FEQ( 77 "$f*sin(x) for x in [0,$b] using color=red and weight=2" 78 )); 79 80$graphtext = image(insertGraph($graph)); 81 82$soln_fog = $f /$g;
83
84&SOLUTION(EV3(<<'EOT'));
85
86$SOL$BR $BR 87You can examine what this situation looks like by viewing the following graph: 88$BR $graphtext$BR $BR 89 90We note that the functions cross, and we need to calculate that point at which 91they cross, so we can integrate on each side of it separately. We need to do 92those two integrals separately because in the once case one function is 93greater, and in the other case the other function is greater. This matters 94because the integral will need to contain an expression of the difference 95between the functions, so we'll need to know which is greater to decide in what 96order to take that difference.$BR BR 97 98So we wish to discover the point at which $$y = g \cos(x)$$ crosses 99$$y = f \sin(x)$$. So we set them equal to one another and solve for $$x$$: 100 101 \begin{align*} 102 g \cos(x) = f \sin(x) 103 &\iff \frac{\cos(x)}{\sin(x)} = \frac{f}{g} \\\\ 104 &\iff \tan(x) = soln_fog \\\\ 105 &\iff x = \tan^{-1}(soln_fog) 106 \end{align*} 107 108BR \$BR
109
110So then we simply integrate from 0 to $$\tan^{-1}(soln_fog)$$ in one section,
111and then from there to $$a\pi$$ in another section. For ease of notation,
112let's say $$C = \tan^{-1}(soln_fog)$$.
113114\begin{align*} 115 & \int_0^{C} ( g \cos(x) - f \sin(x) ) \; dx 116 + \int_{C}^{a\pi} ( f \sin(x) - g \cos(x) ) \; dx \\\\ 117=& \left ( g \sin(x) + f \cos(x) ) \right|_0^{C} 118 + \left ( g \sin(x) + f \cos(x) ) \right|_{C}^{a\pi} \\\\ 119=& g \sin(C) + f \cos(C) - g \sin(0) - f \cos(0) - f \cos(a\pi) 120 - g \sin(a\pi) + f \cos(C) + g \sin(C) \\\\ 121=& answer 122\end{align*} 123
124
125EOT
126
127
128
64ENDDOCUMENT(); # This should be the last executable line in the problem. 129ENDDOCUMENT(); # This should be the last executable line in the problem.

Legend:
 Removed from v.464 changed lines Added in v.465