Math 166
Final Exam Answers 
Spring 1996

This Mathematica  file contains the questions from last year's final exam.  You may use Mathematica, a calculator, or pencil and paper to answer any of the questions.

The symbol e is the base of the natural logarithm system.  
The symbol ^ is used to show exponentation, so that x^2 means the square of x.
The symbol Sqrt(x) means the square root of x.
The symbol arcsin(x) means the inverse sine of x.
The symbol ¯ is the best Mathematica could do for what we call "theta".

Problems 1 through 10 are worth 5 points each, and for them no partial credit will be assigned.  Please put your answers to these problems in the blanks provided.  Problems 11 through 17 are worth 10 points each, and you are to supply full solutions for them.   Note that exact answers are expected for all problems, except those for which an approximate answer is requested.

1) Evaluate     Ü  (cos(x))^3  dx.

To do this integral with pencil and paper, replace (cos(x))^3 by (1-sin^2(x)) cos(x), and
then integrate cos(x) (easy) and -sin^2(x) cos(x) using u=sin(x), du= cos(x).

Integrate[ Cos[x]^3, x]

2) Evaluate     Ü  x cos(x)  dx.

To do this integral with pencil and paper, use integration by parts, with u=x, dv = cos(x) dx.

Integrate[x Cos[x], x]

3) Calculate the area of the region in the first quadrant, bounded by y=1-x^2 and y=1-x.

First, let's get a plot:

Plot[ {1-x^2, 1-x}, {x,-1,3}]

Now, let's find where the two graphs cross:

Solve[1-x^2 == 1-x, x]

Then, note that 1-x^2 > 1-x in the interval (0,1), so we integrate (1-x^2) - (1-x):

Integrate[ (1-x^2) - (1-x), {x,0,1}]

4) If C is the curve described by y = (2/3) x^(3/2), for 0 æ x æ 3, what is the length of C?

Use the formula for arclength:

y[x_]:= 2/3 x^(3/2)
Integrate[ Sqrt[1 + (y'[x])^2], {x,0,3}]

5) Find a value of x rounded to 3 decimals for which arcsin(x) - arcsin(-1/2) = º/4.

Rather than do any thinking at all, let's just see if Mathematica  can take care of this problem:
(Otherwise, maybe we'd have to try Newton's method)

Solve[ArcSin[x]-ArcSin[-1/2]==Pi/4, x]

N[%]

6) Evaluate    Ü  (4x+6)  /  (x^2 + 3x)   d x.

To solve this problem with pencil and paper, use a  U-substitution.  Set u=x^2+3x.  Then the top of the fraction will be 2*du.

Integrate[ (4x+6)/(x^2+3x), x]

7) Evaluate    Ü e^(x/2)  /  Sqrt (1-e^(-x))  d x.

To solve this problem with pencil and paper, multiply the top and bottom by E^(x/2).  That effectively multiplies the bottom (inside the square root sign) by E^x, so that you end up with
the fraction   E^x / Sqrt(E^x - 1) and now you should see that you have a   du/Sqrt(u) problem.

Integrate[ E^(x/2)/Sqrt[1-E^(-x)], x]

8) Write the Maclaurin series for 1 / (1+x^2).

To solve this problem with pencil and paper, remember (you memorized these things, right?) that the Taylor series for 1/(1+x) is 
  1 - x + x^2 - x^3 + x^4 - ... 
 and so therefore the Taylor series for 1/(1+x^2) can be found by replacing x by x^2 in the series:
   1 - x^2 + x^4 - x^6 + x^8 - ...

Series[ 1/(1+x^2), {x,0,10}]

Now, depending on your instructor, this answer might not be enough.   For full credit, you may need to write this series in the symbolic form that uses the summation symbol.  Here, it's a little more complicated because we only have the even order terms.  One form for the sum would be:
É
Ö     (-1)^n     x^(2n)
n=0

9) If the region R = { (x,y) : 0 æ y æ sin(x), 0 æ x æ º/2} is revolved around the line y=-1 to create a solid region S, write a definite integral whose value is the volume of S.  (Do not evaluate your integral).

This problem is rotating around a horizontal line, so we're best off using the method of disks.
The "radius" or distance from the axis of rotation is sin(x)- (-1).

Plot[{Sin[x], -1}, {x,0,Pi/2}]

Pi*Integrate[ (Sin[x] - -1)^2, {x,0,Pi/2}]

10) Evaluate   lim  (e^(2x) - 1)   /   ( Sqrt(x+4) - 2 )
                      x->0

To solve this problem with pencil and paper, use L'Hopital's rule.

Limit[ (E^(2x)-1)/(Sqrt[x+4]-2), x->0]

11)  From the data in this sketch of a right triangle, express angle A as a function of x, and calculate dA/dx when x = 6.

p1=Line[{{0,0},{15,0},{15,15},{0,0},{15,9}}];
p2=Text["15",{7.5,-1}];
p3=Text["9",{16,4.5}];
p4=Text["A",{4,3}];
p5=Text["x",{16,12}];
Show[Graphics[p1],Graphics[p2],
  Graphics[p3],Graphics[p4],Graphics[p5]]

Here's a problem where you have to think!

Let's call "B" the angle below A.  Then we can certainly say that
 Tan(B)=9/15
and so
  B=ArcTan(9/15).  
Now we can look at the angle made by A+B:
  Tan(A+B )=(x+9)/15.
Therefore
  A+B=ArcTan((x+9)/15)
or
  A+ArcTan(9/15) = ArcTan((x+9)/15)
or
  A = ArcTan((x+9)/15) - ArcTan(9/15)
  
Now if you believe that, we have the angle A as a function of x, and we can differentiate:

A[x_]:=ArcTan[(x+9)/15]-ArcTan[9/15]
A'[6]

É
12)  Explain why the infinite series     Ö  (-1)^(n+1)  ln(n)  /   n  converges conditionally.
                                                            n=1

Mathematica  can only help us partially here.  We're going to have to do a lot of thinking.

But this is an alternating series, so it might pay to see if we can apply the alternating series test:
Are the terms decreasing in size?  

  ln(n+1) / (n+1)  <   ln(n) / n  ?
  
It's not easy to see an algebraic reason why this would be true.  Perhaps we can look at this as
a function of n, and ask if its derivative is negative, at least for n >= 1:

f[n_]:=Log[n]/n
f'[n]

Well, this quantity is negative "eventually", that is, once n is greater than E.  It turns out that it's OK for the first few terms of a series to violate the alternating series test, as long as all the subsequent terms satisfy it.  Let's see if the other requirement is satisfied, namely that the size of the terms goes to zero:

Limit[Log[n]/n, n->Infinity]

OK, this series satisfies the alternating series test (except for the first 2 terms) so it converges.

Now, it converges conditionally  if the series that uses the absolute values of the terms actually diverges.  So let's look at that series:

      É
     Ö  ln(n)  /   n  
     n=1
     
  It sure looks like we should use the integral test here.  So, is f[n] continuous (yes), positive (yes), and decreasing (well, yes, but only after n=E.   But again, it's OK for the function used in the integral test to violate the rules for a "few" early values of n.)  So the integral test may be used.  Let's go ahead and compute the comparison integral:

Integrate[ Log[x]/x, {x,1,Infinity}]

Well, I'm not sure what Mathematica  is saying here, so let's look at the finite integral (which is what we're suppose to do anyway):

Integrate[ Log[x]/x, {x,1,b}]

Limit[ (Log[b])^2, b->Infinity]

So the integral does not converge, and hence the series does not converge, and so the original series only converges conditionally.

É
13) Evaluate    Ü     1  /  ( (x^2+1) (x+1) )      d x.
                          0

To solve this problem with pencil and paper, use the method of partial fractions to integrate the finite integral, and then take the limit as the upper limit goes to Infinity.

Integrate[ 1/ ( (x^2+1) (x+1) ), {x,0,b}]

Limit[ %, b->Infinity]

Don't trust Mathematica  when it doesn't give a straight answer!  Let's combine the two logs in the previous result and try again:

Limit[ ArcTan[b]/2 + Log[ (1+b)^(1/2) / (1+b^2)^(1/4)], 
  b->Infinity]

É
14)  a) Explain why the infinite series   S =  Ö n  (  1/Sqrt(2)  )^(n-1)  converges.
                                                                     n=1

This series is almost a geometric series.  Let's try the good old ratio test on it:

a[n_]:=n (1/Sqrt[2]) ^ (n-1)

Limit[ Abs[ a[n+1]/a[n] ], n->Infinity]

Sometimes, Mathematica  is a little stupid.  It's actually afraid of the Absolute value function.  We know that our ratio is always positive, so let's take away the absolute value signs and see if Mathematica  can do any better:

Limit[ a[n+1]/a[n], n->Infinity]

The ratio is less that 1, so the series converges.

b) What is the exact value of S?

We didn't really look at section 8.9, which talked about playing around with power series, so I wouldn't be surprised if you had trouble with this part of the problem.  But let's try anyway.  Suppose that the series we are looking at is a Taylor series, evaluated at a particular value of x.
In fact, the value of x would be 1/Sqrt(2).  What can we say about the series
           É
f(x) =  Ö n  ( x)^(n-1) ?
           n=1
 
Well, I can't tell what function f(x) this is, but it sure looks like it's the derivative of the
function g(x) whose series is

            É
g(x) =  Ö x^n
           n=0
 
How did I get this?  I integrated the f(x) series term by term, and stuck on a constant at the beginning.

If you memorized your Taylor series, then you might recognize this as the Taylor series for 1/(1-x), which happens to have an interval of convergence of (-1,1).    This is easy to show using the ratio test, or the fact that this series is a geometric series.  In either case, the series for g(x)
converges absolutely for any x in (-1,1), and therefore, the series for its derivative also converges in that same interval.  In other words, the original series converges in (-1,1).

Let's just check that I got the series right.  Here's what I called "g(x)"

g[x_]:=1/(1-x)
Series[ g[x], {x,0,10}]

And here's the function f(x):

Series[ g'[x], {x,0,10}]

And of course, the actual formula for f(x) is...

g'[x]

Now, what the heck was the original question?  What is the value of the original series when
we plug in x=1/Sqrt(2).  Oh, well that's just the value of the derivative of 1/(1-x) at that value of
x, namely 1/(1-x)^2, or 1 / (1 - 1/Sqrt(2)) ^2, which is complicated enough that we might as well
let Mathematica  tell us what it is!

N[ g'[1/Sqrt[2]] ]

OK, so we probably won't get this problem right!  Save it for last!

15) Calculate the area of the region lying inside both the polar curves r=1+cos(¯) and r=3*cos(¯).

Draw a graph, and be careful to get the range of the angles right.

1+Cos[Theta] is a cardioid, and the range of Theta is 0 < Theta < 2 Pi.

p1=ParametricPlot[ { (1+Cos[theta])*Cos[theta],
                     (1+Cos[theta])*Sin[theta]},
                   {theta, 0, 2*Pi}, AspectRatio->Automatic,
                   PlotStyle->RGBColor[1,0,0]]

3 Cos[Theta] is an off center circle, and the range of Theta is 0 < Theta < Pi.

p2=ParametricPlot[ { (3Cos[theta])*Cos[theta],
                     (3Cos[theta])*Sin[theta]},
                   {theta, 0, Pi}, AspectRatio->Automatic,
                   PlotStyle->RGBColor[0,1,0]]

Show[p1,p2,AspectRatio->Automatic]

Now let's use symmetry, and just try to compute the area of the top, and multiply by two.  Then we want to integrate the cardioid from Theta=0 to the point where the circle and cardioid cross.
Then we want to integrate the circle from that value down to Theta=Pi/2.

So first we find the angle theta where the two curves are equal:

Solve[1+Cos[theta]==3Cos[theta], theta]

And now we can get our answer:

2 * ( Integrate[1+Cos[theta], {theta,0,Pi/3}]
     +Integrate[3*Cos[theta], {theta,Pi/3, Pi/2}] )

16) a) Write the Maclaurin series for sin^2(x) = 1/2 - 1/2 cos(2x).

OK, I suppose we could just ask Mathematica  to compute the Taylor series for the square of the sine function, and hand that in:

Series[ (Sin[x])^2, {x,0,10}]

This is certainly an answer, and presumably correct.

However, there's a couple of reasons why we probably shouldn't be satisfied with this answer.  First of all, I don't see the pattern in this result, so I'd have a hard time writing it as a symbolic sum.  Secondly, the person who wrote the problem suggests I look at the formula 1/2 - 1/2 cos(2x), so maybe I'd better do it that way if I can.

We can start by getting the Taylor series for cos(x) (in case we forgot it):

Series[Cos[x], {x,0,10}]

Therefore, the Taylor series for Cos[2x] is simply

  1 - (2x)^2/2! + (2x)^4 / 4! - (2x)^6/6! + ...
  
and so the series for Sin^2[x] = 1/2 - 1/2 Cos[2x] is therefore

  1/2  - 1/2 (  1 - (2x)^2/2! + (2x)^4 / 4! - (2x)^6/6! + ...)
  
Again, depending on your instructor, this answer might not be quite satisfactory.  You may be expected to use the summation symbol.  In that case, the answer could be written as:

                  É
 1/2 - 1/2   Ö    (-1)^n   (2x)^(2n)  / (2n)!
                 n=0

b) If we were to use the first five terms of your answer to a to approximate sin^2(x) for 0æxæ1, find a bound for the error in this approximation.

Oh good grief.  Do they mean the first five terms or terms up to fifth degree?  When you're not sure about something like this, ask your instructor!  I guess I'd assume that they meant the first five terms, meaning the constant, first, second, third and fourth degree terms, which means up to the power of x^4 [ or (2x)^4, actually].  So my polynomial approximation would be 

 sin^2(x) is approximately 1/2  - 1/2 (  1 - (2x)^2/2! + (2x)^4 / 4!)
 
 Now Taylor's formula says that the error in such an approximation can be found by computing
 the 5th derivative of the quantity evaluated at some mystery point z between 0 and x, multiplying by x^5, and dividing by 5:
 
 error = f'''''(z) x^5 / 5!  Let's get some help now:

Clear[f,x]
f[x_]:=(Sin[x])^2
f'''''[x]

Therefore, our error term is

f'''''(z) x^5 / 5!  = 32 Cos(z) Sin(z) x^5 /120
 but we know that the cosine and sine are never more than 1 in size, and we know that x is between 0 and 1, so a bound for this error is 32 / 120.

17) Let R be the region bounded by the graphs of y=ln(x) and y=(x-1)^2.  If R is revolved about the y axis to create a solid region T, approximate the volume of T.

Another problem where you must draw a graph.

Plot[ {Log[x], (x-1)^2}, {x,0,2}]

OK, let's find where those two graphs cross now:

Solve[ Log[x] == (x-1)^2, x]

Well, looks like we're not going to get an exact answer.  Aha, that must be why the problem said that we were to "approximate" the volume.  So I guess we can use FindRoot.  But before we use FindRoot, let's note that one value of x that works is x=1.  So we really only need the other value, which is near x=1.5:

FindRoot[ Log[x] == (x-1)^2, {x, 1.5} ]

OK, now we're about ready to do the volume calculation.  Let's just get the corresponding y value first:

Log[1.74688]

Now since we're rotating about the y axis, we'd probably be best to use the method of shells:

2*Pi*Integrate[x * (Log[x]-(1-x)^2), {x,1,1.74688}]

Morals: 

You can do every problem on this test using Mathematica, or at least, using Mathematica to help you out.  

But:

  you still have to know what formulas to apply for things like volumes of rotation;

  you still having to think about things like which of two functions is larger;

  you still have to be clever enough to remember things like a function is decreasing when its derivative is negative;

  raw output from Mathematica may not be acceptable; in particular,  if you are asked for the form of a Taylor series, you may need to use the summation symbol and a formula; don't just write out a few terms, like Mathematica  does;
  
  explain what you are doing on your written work, so your instructor can give you partial credit if you were on the right track;
  
  you should draw a plot whenever you can!

  you should also realize that some problems are going to take a lot more time than others.